Files
md-drugs/server/oxyruns.lua
T

44 lines
1.2 KiB
Lua
Raw Normal View History

2025-01-27 23:56:13 -08:00
2024-11-16 23:39:34 -08:00
local prices = {
payfortruck = 500,
hotchance = 30,
itemChance = 20,
}
lib.callback.register('md-drugs:server:payfortruck', function()
2023-12-07 15:45:48 -08:00
local src = source
2025-01-28 20:15:32 -08:00
if removeMoney(src, 'cash', prices.payfortruck) or removeMoney(src, 'bank', prices.payfortruck) then
Log(GetName(src) .. ' Rented A Van For OxyRuns', 'oxy')
return true
2023-12-07 15:45:48 -08:00
else
Notifys(src, Lang.oxy.broke, "error")
return false
2023-12-07 15:45:48 -08:00
end
end)
RegisterServerEvent('md-drugs:server:giveoxybox', function()
local src = source
local chance = math.random(1,100)
2024-11-12 01:04:42 -08:00
local cash = 200
2023-12-07 15:45:48 -08:00
local itemchance = math.random(1,100)
2024-11-12 01:04:42 -08:00
local itemList = {
{item = 'oxy', amount = 2},
2024-11-16 23:39:34 -08:00
{item = 'houselockpick', amount = 1},
2024-11-12 01:04:42 -08:00
}
local item = itemList[math.random(1, #itemList)]
2024-11-16 23:39:34 -08:00
if chance <= prices.hotchance then
Notifys(src, Lang.oxy.hot, "error")
2025-01-28 20:15:32 -08:00
addMoney(src, "cash", cash * 0.5)
2024-11-16 23:39:34 -08:00
if itemchance <= prices.itemChance then
2024-11-12 01:04:42 -08:00
AddItem(src, item.item, item.amount)
2025-01-28 20:15:32 -08:00
end
2023-12-07 15:45:48 -08:00
else
2024-05-02 18:34:49 -07:00
Notifys(Lang.oxy.next, "success")
2023-12-07 15:45:48 -08:00
TriggerClientEvent("md-drugs:client:getoxylocationroute", src)
Player.Functions.AddMoney("cash", cash)
2024-11-16 23:39:34 -08:00
if itemchance <= prices.itemChance then
2024-11-12 01:04:42 -08:00
AddItem(src, item.item, item.amount)
2023-12-07 15:45:48 -08:00
end
end
end)