removed 90% of logs ( added logs to getrecipe, locationcheck, and fixed wholesale, dealers, and oxyruns, and meth
This commit is contained in:
1 parent
cdd26ab465
commit
5c5f454207
14 files changed
+97
-212
No files matched your search
@@ -212,13 +212,4 @@ RegisterServerEvent('md-drugs:server:cornerselling:stop', function()
|
||||
table.remove(DrugDeals, k)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
CreateThread(function()
|
||||
while true do
|
||||
for k, v in pairs (DrugDeals) do
|
||||
print('DrugDeals: ', json.encode(v))
|
||||
end
|
||||
Wait(1000)
|
||||
end
|
||||
end)
|
||||
@@ -133,7 +133,6 @@ RegisterServerEvent('md-drugs:server:getheroinlabkitback', function()
|
||||
AddItem(src, 'heroinlabkit', 1)
|
||||
end
|
||||
end
|
||||
print(json.encode(heroinLabKits))
|
||||
end)
|
||||
|
||||
|
||||
@@ -152,7 +151,6 @@ QBCore.Functions.CreateUseableItem('heroinlabkit', function(source, item)
|
||||
})
|
||||
Notifys(src, Lang.Heroin.placed, "success")
|
||||
end
|
||||
print(json.encode(heroinLabKits))
|
||||
end)
|
||||
|
||||
|
||||
|
||||
@@ -137,4 +137,9 @@ lib.callback.register('md-drugs:server:getLocs', function()
|
||||
end)
|
||||
lib.callback.register('md-drugs:server:GetMerchant', function(source)
|
||||
return loc
|
||||
end)
|
||||
end)
|
||||
|
||||
function getRandW(src)
|
||||
local rand = math.random(1, #Target.oxylocations)
|
||||
return Target.oxylocations[rand]
|
||||
end
|
||||
@@ -34,7 +34,6 @@ QBCore.Functions.CreateUseableItem('lsdlabkit', function(source, item)
|
||||
})
|
||||
end
|
||||
end
|
||||
print(json.encode(lsdTables))
|
||||
end)
|
||||
|
||||
local function hasLabKit(source)
|
||||
@@ -64,7 +63,6 @@ RegisterServerEvent('md-drugs:server:getlabkitback', function()
|
||||
AddItem(src, 'lsdlabkit', 1)
|
||||
end
|
||||
end
|
||||
print(json.encode(lsdTables))
|
||||
end)
|
||||
|
||||
RegisterServerEvent('md-drugs:server:heatliquid', function()
|
||||
@@ -217,5 +215,4 @@ AddEventHandler('playerDropped', function()
|
||||
AddItem(src, 'lsdlabkit', 1)
|
||||
end
|
||||
end
|
||||
print(json.encode(lsdTables))
|
||||
end)
|
||||
@@ -4,7 +4,6 @@ RegisterServerEvent('md-drugs:server:startcook', function()
|
||||
local src = source
|
||||
if not GetRecipe(source, 'meth', 'cook', 'heat') then return end
|
||||
Notifys(src, "Adding Things To The Mix", "success")
|
||||
Log(GetName(source) .. ' Started A Meth Batch', 'Meth')
|
||||
end)
|
||||
|
||||
RegisterServerEvent('md-drugs:server:givemethingridients', function()
|
||||
@@ -25,7 +24,6 @@ end)
|
||||
RegisterServerEvent('md-drugs:server:getmeth', function()
|
||||
local src = source
|
||||
if not GetRecipe(src, 'meth', 'bag', 'bags') then return end
|
||||
Log(GetName(src) .. ' Bagged 5 Of Meth', 'Meth')
|
||||
end)
|
||||
|
||||
RegisterServerEvent('md-drugs:server:geteph', function(num)
|
||||
@@ -33,7 +31,6 @@ RegisterServerEvent('md-drugs:server:geteph', function(num)
|
||||
if not checkLoc(src, 'MethEph', num) then return end
|
||||
if AddItem(src, 'ephedrine', 1) then
|
||||
Notifys(src, 'Got Ephedrine!', "success")
|
||||
Log(GetName(src) .. ' Got ' .. 1 .. 'Of Ephedrine', 'Meth')
|
||||
end
|
||||
end)
|
||||
|
||||
@@ -42,6 +39,5 @@ RegisterServerEvent('md-drugs:server:getace', function(num)
|
||||
if not checkLoc(src, 'Methace', num) then return end
|
||||
if AddItem(src, 'acetone', 1) then
|
||||
Log(GetName(src) .. ' Got ' .. 1 .. 'Of Acetone', 'Meth')
|
||||
Notifys(src, 'Got Acetone!', "success")
|
||||
end
|
||||
end)
|
||||
+47
-147
@@ -4,162 +4,62 @@ local crack = {"baggedcracked", "baggedcrackedstagetwo", "baggedcrackedstagethre
|
||||
local lsd = {'smiley_tabs', 'yinyang_tabs', 'wildcherry_tabs', 'pineapple_tabs', 'bart_tabs', 'gratefuldead_tabs'}
|
||||
local heroin = {'heroin_ready', 'heroin_readystagetwo', 'heroin_readystagethree'}
|
||||
local xtc = {"white_playboys", "white_playboys2", "white_playboys3", "white_playboys4", "blue_playboys", "blue_playboys2", "blue_playboys3", "blue_playboys4", "red_playboys", "red_playboys2", "red_playboys3", "red_playboys4", "orange_playboys", "orange_playboy2s", "orange_playboys3", "orange_playboys4", "white_aliens", "white_aliens2", "white_aliens3", "white_aliens4", "blue_aliens", "blue_aliens2", "blue_aliens3", "blue_aliens4", "red_aliens", "red_aliens3", "red_aliens2", "red_aliens4", "orange_aliens", "orange_aliens2", "orange_aliens3", "orange_aliens4", "white_pl", "white_pl2", "white_pl3", "white_pl4", "blue_pl", "blue_pl2", "blue_pl3", "blue_pl4", "red_pl", "red_pl2", "red_pl3", "red_pl4", "orange_pl", "orange_pl2", "orange_pl3", "orange_pl4", "white_trolls", "white_trolls2", "white_trolls3", "white_trolls4", "blue_trolls", "blue_trolls2", "blue_trolls3", "blue_trolls4", "red_trolls", "red_trolls2", "red_trolls3", "red_trolls4", "orange_trolls", "orange_trolls2", "orange_trolls3", "orange_trolls4", "white_cats2", "white_cats3", "white_cats4", "white_cats", "blue_cats", "blue_cats3", "blue_cats2", "blue_cats4", "red_cats", "red_cats2", "red_cats3", "red_cats4", "orange_cats", "orange_cats2", "orange_cats3", "orange_cats4" }
|
||||
|
||||
local burners = {cokeburner = coke, crackburner = crack, lsdburner = lsd, heroinburner = heroin, xtcburner = xtc}
|
||||
local active = {}
|
||||
local Price = {
|
||||
coke = {min = 20, max = 60},
|
||||
crack = {min = 20, max = 60},
|
||||
lsd = {min = 20, max = 60},
|
||||
heroin = {min = 20, max = 60},
|
||||
xtc = {min = 20, max = 60},
|
||||
|
||||
}
|
||||
QBCore.Functions.CreateUseableItem("cokeburner", function(source, item)
|
||||
local src = source
|
||||
local Player = getPlayer(source)
|
||||
TriggerClientEvent("md-drugs:client:GetLocation", src, 'coke', "Bring Me All The Coke You Have")
|
||||
end)
|
||||
for k, v in pairs (burners) do
|
||||
QBCore.Functions.CreateUseableItem(k, function(source, item)
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
for m, d in pairs (active) do
|
||||
if d.cid == Player.PlayerData.citizenid then
|
||||
return Notifys(src, 'You Already Have A Delivery To Make', 'error' )
|
||||
end
|
||||
end
|
||||
local tab = ''
|
||||
if k == 'cokeburner' then tab = 'coke' end
|
||||
if k == 'crackburner' then tab = 'crack' end
|
||||
if k == 'lsdburner' then tab = 'lsd' end
|
||||
if k == 'heroinburner' then tab = 'heroin' end
|
||||
if k == 'xtcburner' then tab = 'xtc' end
|
||||
if RemoveItem(src, k, 1) then
|
||||
table.insert(active, {
|
||||
src = src,
|
||||
item = k,
|
||||
location = getRandW(src),
|
||||
cid = Player.PlayerData.citizenid,
|
||||
type = v,
|
||||
price = Price[tab]
|
||||
})
|
||||
for m, d in pairs (active) do
|
||||
if d.cid == Player.PlayerData.citizenid then
|
||||
TriggerClientEvent("md-drugs:client:GetLocation", src, active[m])
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
RegisterServerEvent('md-drugs:server:wholesalecoke', function()
|
||||
local src = source
|
||||
RegisterNetEvent('md-drugs:server:SuccessSale', function(data)
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
local price = math.random(Price['coke'].min, Price['coke'].max)
|
||||
for k, v in pairs(coke) do
|
||||
local item = Player.Functions.GetItemByName(v)
|
||||
|
||||
if item and item.amount > 0 then
|
||||
local removed = Player.Functions.RemoveItem(v, item.amount)
|
||||
Player.Functions.AddMoney("cash", item.amount * price)
|
||||
Notifys("You received " .. item.amount * price .. " Dollars!" , "success")
|
||||
Log(GetName(source) .. ' Wholesaled Drugs ', 'wholesale')
|
||||
for k, v in pairs (active) do
|
||||
if v.cid == Player.PlayerData.citizenid then
|
||||
local payout = math.random(v.price.min, v.price.max)
|
||||
for m, d in pairs (v.type) do
|
||||
local git = Player.Functions.GetItemByName(d)
|
||||
if git and git.amount >= 1 then
|
||||
RemoveItem(src, d, git.amount)
|
||||
Player.Functions.AddMoney('cash', git.amount * payout)
|
||||
end
|
||||
table.remove(active, k)
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
QBCore.Functions.CreateUseableItem("crackburner", function(source, item)
|
||||
local src = source
|
||||
local Player = getPlayer(source)
|
||||
TriggerClientEvent("md-drugs:client:GetLocation", src, 'crack', "Bring Me All The Crack You Have")
|
||||
end)
|
||||
|
||||
RegisterServerEvent('md-drugs:server:wholesalecrack', function()
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
local price = math.random(Price['crack'].min, Price['crack'].max)
|
||||
for k, v in pairs(crack) do
|
||||
local item = Player.Functions.GetItemByName(v)
|
||||
if item and item.amount > 0 then
|
||||
local removed = Player.Functions.RemoveItem(v, item.amount)
|
||||
Player.Functions.AddMoney("cash", item.amount * price)
|
||||
Notifys("You received " .. item.amount * price .. " Dollars!" , "success")
|
||||
Log(GetName(source) .. ' Wholesaled Drugs ', 'wholesale')
|
||||
end
|
||||
end
|
||||
end)
|
||||
----------------- lsd
|
||||
|
||||
QBCore.Functions.CreateUseableItem("lsdburner", function(source, item)
|
||||
local src = source
|
||||
local Player = getPlayer(source)
|
||||
TriggerClientEvent("md-drugs:client:GetLocation", src, 'lsd', "Bring Me All The lsd You Have")
|
||||
end)
|
||||
|
||||
RegisterServerEvent('md-drugs:server:wholesalelsd', function()
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
local price = math.random(Price['lsd'].min, Price['lsd'].max)
|
||||
|
||||
for k, v in pairs(lsd) do
|
||||
local item = Player.Functions.GetItemByName(v)
|
||||
|
||||
if item and item.amount > 0 then
|
||||
local removed = Player.Functions.RemoveItem(v, item.amount)
|
||||
Player.Functions.AddMoney("cash", item.amount * price)
|
||||
Notifys("You received " .. item.amount * price .. " Dollars!" , "success")
|
||||
Log(GetName(source) .. ' Wholesaled Drugs ', 'wholesale')
|
||||
end
|
||||
end
|
||||
end)
|
||||
----------------- heroin
|
||||
|
||||
QBCore.Functions.CreateUseableItem("heroinburner", function(source, item)
|
||||
local src = source
|
||||
local Player = getPlayer(source)
|
||||
TriggerClientEvent("md-drugs:client:GetLocation", src, 'heroin', "Bring Me All The Heroin You Have")
|
||||
end)
|
||||
|
||||
RegisterServerEvent('md-drugs:server:wholesaleheroin', function()
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
local price = math.random(Price['heroin'].min, Price['heroin'].max)
|
||||
for k, v in pairs(heroin) do
|
||||
local item = Player.Functions.GetItemByName(v)
|
||||
|
||||
if item and item.amount > 0 then
|
||||
local removed = Player.Functions.RemoveItem(v, item.amount)
|
||||
Player.Functions.AddMoney("cash", item.amount * price)
|
||||
Notifys("You received " .. item.amount * price .. " Dollars!" , "success")
|
||||
Log(GetName(source) .. ' Wholesaled Drugs ', 'wholesale')
|
||||
end
|
||||
end
|
||||
end)
|
||||
---- xtc
|
||||
QBCore.Functions.CreateUseableItem("xtcburner", function(source, item)
|
||||
local src = source
|
||||
local Player = getPlayer(source)
|
||||
TriggerClientEvent("md-drugs:client:GetLocation", src, 'xtc', "Bring Me All The xtc You Have")
|
||||
end)
|
||||
|
||||
RegisterServerEvent('md-drugs:server:wholesalextc', function()
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
local price = math.random(Price['xtc'].min, Price['xtc'].max)
|
||||
for k, v in pairs(xtc) do
|
||||
local item = Player.Functions.GetItemByName(v)
|
||||
|
||||
if item and item.amount > 0 then
|
||||
local removed = Player.Functions.RemoveItem(v, item.amount)
|
||||
Player.Functions.AddMoney("cash", item.amount * price)
|
||||
Notifys("You received " .. item.amount * price .. " Dollars!" , "success")
|
||||
Log(GetName(source) .. ' Wholesaled Drugs ', 'wholesale')
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
RegisterServerEvent('md-drugs:server:RemoveBurner', function(item)
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
|
||||
if item == 'coke' then
|
||||
if Player.Functions.RemoveItem('cokeburner', 1) then
|
||||
else
|
||||
DropPlayer(src, 'How Did You Trigger The Event Without The Item?')
|
||||
end
|
||||
elseif item == 'crack' then
|
||||
if Player.Functions.RemoveItem('crackburner', 1) then
|
||||
else
|
||||
DropPlayer(src, 'How Did You Trigger The Event Without The Item?')
|
||||
end
|
||||
elseif item == 'heroin' then
|
||||
if Player.Functions.RemoveItem('heroinburner', 1) then
|
||||
else
|
||||
DropPlayer(src, 'How Did You Trigger The Event Without The Item?')
|
||||
end
|
||||
elseif item == 'lsd' then
|
||||
if Player.Functions.RemoveItem('lsdburner', 1) then
|
||||
else
|
||||
DropPlayer(src, 'How Did You Trigger The Event Without The Item?')
|
||||
end
|
||||
elseif item == 'xtc' then
|
||||
if Player.Functions.RemoveItem('xtcburner', 1) then
|
||||
else
|
||||
DropPlayer(src, 'How Did You Trigger The Event Without The Item?')
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -40,7 +40,6 @@ local check, loc = lib.callback.await('md-drugs:client:setpress', src, v.data)
|
||||
})
|
||||
end
|
||||
end
|
||||
print(json.encode(activePresses))
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
Reference in new issue
Block a user