fuckin christ

This commit is contained in:
Mustache Dom committed 2025-07-18 01:19:12 -07:00
1 parent 314f7381d1
commit daa1a4f8a3
12 files changed
+425 -384

No files matched your search

+32 -23
View File
@@ -1,17 +1,17 @@
QBCore = exports['qb-core']:GetCoreObject()
local prices = {
payfortruck = 500,
hotchance = 30,
itemChance = 20,
}
ps.registerCallback('md-drugs:server:payfortruck', function()
local onRoute = {}
ps.registerCallback('md-drugs:server:payfortruck', function(source)
local src = source
local Player = getPlayer(src)
if Player.Functions.RemoveMoney('cash', prices.payfortruck) or Player.Functions.RemoveMoney('bank', prices.payfortruck) then
--Log(GetName(src) .. ' Rented A Van For OxyRuns', 'oxy')
if ps.removeMoney(src, 'cash', prices.payfortruck) or ps.removeMoney(src, 'bank', prices.payfortruck) then
onRoute[src] = true
ps.notify(src, ps.lang('oxy.paid') .. prices.payfortruck, "success")
return true
else
ps.notify(src, Lang.oxy.broke, "error")
ps.notify(src, ps.lang('oxy.broke'), "error")
return false
end
end)
@@ -19,29 +19,38 @@ end)
RegisterServerEvent('md-drugs:server:giveoxybox', function()
local src = source
local Player = getPlayer(src)
local chance = math.random(1,100)
local cash = 200
if not onRoute[src] then
ps.notify(src, ps.lang('oxy.notonroute'), "error")
return
end
if not ps.checkDistance(src, GlobalState.MDDrugsLocs.oxylocations[onRoute[src]], 3.5) then
ps.notify(src, ps.lang('oxy.toofar'), "error")
return
end
local cash = math.random(50, 200)
local itemchance = math.random(1,100)
local itemList = {
{item = 'oxy', amount = 2},
{item = 'houselockpick', amount = 1},
}
local item = itemList[math.random(1, #itemList)]
if chance <= prices.hotchance then
ps.notify(src, Lang.oxy.hot, "error")
Player.Functions.AddMoney("cash", cash * 0.5)
if itemchance <= prices.itemChance then
AddItem(src, item.item, item.amount)
end
else
ps.notify(Lang.oxy.next, "success")
TriggerClientEvent("md-drugs:client:getoxylocationroute", src)
Player.Functions.AddMoney("cash", cash)
if itemchance <= prices.itemChance then
AddItem(src, item.item, item.amount)
end
ps.addMoney(src,"cash", cash)
if itemchance <= prices.itemChance then
ps.addItem(src, item.item, item.amount)
end
end)
ps.registerCallback('md-drugs:server:getRoute', function(source)
if not onRoute[source] then return false end
local giveLocation = math.random(1, 10)
if giveLocation == 10 then
onRoute[source] = nil
return false
else
onRoute[source] = math.random(1, #GlobalState.MDDrugsLocs.oxylocations)
return GlobalState.MDDrugsLocs.oxylocations[onRoute[source]]
end
end)