This commit is contained in:
Mustache Dom committed 2024-11-16 23:39:34 -08:00
1 parent 07481651b8
commit c81d113494
8 files changed
+171 -164

No files matched your search

+10 -7
View File
@@ -1,9 +1,13 @@
QBCore = exports['qb-core']:GetCoreObject()
local prices = {
payfortruck = 500,
hotchance = 30,
itemChance = 20,
}
lib.callback.register('md-drugs:server:payfortruck', function()
local src = source
local Player = getPlayer(src)
if Player.Functions.RemoveMoney('cash', 500) or Player.Functions.RemoveMoney('bank', 500) then
if Player.Functions.RemoveMoney('cash', prices.payfortruck) or Player.Functions.RemoveMoney('bank', prices.payfortruck) then
Log(GetName(src) .. ' Rented A Van For OxyRuns', 'oxy')
return true
else
@@ -21,21 +25,20 @@ RegisterServerEvent('md-drugs:server:giveoxybox', function()
local itemchance = math.random(1,100)
local itemList = {
{item = 'oxy', amount = 2},
{item = 'lockpick', amount = 1},
{item = 'cryptostick', amount = 1},
{item = 'houselockpick', amount = 1},
}
local item = itemList[math.random(1, #itemList)]
if chance <= 30 then
if chance <= prices.hotchance then
Notifys(src, Lang.oxy.hot, "error")
Player.Functions.AddMoney("cash", cash * 0.5)
if itemchance <= 30 then
if itemchance <= prices.itemChance then
AddItem(src, item.item, item.amount)
end
else
Notifys(Lang.oxy.next, "success")
TriggerClientEvent("md-drugs:client:getoxylocationroute", src)
Player.Functions.AddMoney("cash", cash)
if itemchance <= 30 then
if itemchance <= prices.itemChance then
AddItem(src, item.item, item.amount)
end
end