big update. i prob broke something, let me know in discord
This commit is contained in:
1 parent
009b0a4f4a
commit
028c5f771f
42 files changed
+2042
-3056
No files matched your search
+33
-55
@@ -4,85 +4,63 @@ local QBCore = exports['qb-core']:GetCoreObject()
|
||||
RegisterServerEvent('md-drugs:server:makecrackone', function(num)
|
||||
local src = source
|
||||
local Player = QBCore.Functions.GetPlayer(src)
|
||||
local playerPed = GetPlayerPed(source)
|
||||
if CheckDist(source, playerPed, Config.makecrack[num]['loc']) then end
|
||||
if not Itemcheck(Player, 'bakingsoda', 1, 'true') then return end
|
||||
if CheckDist(src, Config.makecrack[num]['loc']) then return end
|
||||
if Config.TierSystem then
|
||||
local locoke = Player.Functions.GetItemByName('loosecoke')
|
||||
local locoke2 = Player.Functions.GetItemByName('loosecokestagetwo')
|
||||
local locoke3 = Player.Functions.GetItemByName('loosecokestagethree')
|
||||
if locoke then
|
||||
RemoveItem('loosecoke', 1 )
|
||||
RemoveItem('bakingsoda', 1)
|
||||
AddItem('crackrock', 1)
|
||||
Notifys(Lang.Crack.makecrack, "success")
|
||||
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Cut Crack', 'crack')
|
||||
if not GetRecipe(src, 'crack', 'cookcrack', 'tier1') then return end
|
||||
Log(GetName(src) .. ' Cut Crack', 'crack')
|
||||
elseif locoke2 then
|
||||
RemoveItem('loosecokestagetwo', 1 )
|
||||
RemoveItem('bakingsoda', 1)
|
||||
AddItem('crackrockstagetwo', 1)
|
||||
Notifys(Lang.Crack.makecrack, "success")
|
||||
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Cut Crack', 'crack')
|
||||
if not GetRecipe(src, 'crack', 'cookcrack', 'tier2') then return end
|
||||
Log(GetName(src) .. ' Cut Crack', 'crack')
|
||||
elseif locoke3 then
|
||||
RemoveItem('loosecokestagethree', 1 )
|
||||
RemoveItem('bakingsoda', 1)
|
||||
AddItem('crackrockstagethree', 1)
|
||||
Notifys(Lang.Crack.makecrack, "success")
|
||||
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Cut Crack', 'crack')
|
||||
if not GetRecipe(src, 'crack', 'cookcrack', 'tier3') then return end
|
||||
Log(GetName(src) .. ' Cut Crack', 'crack')
|
||||
else
|
||||
Notifys(Lang.Crack.nocoke, 'error')
|
||||
Notifys(src,Lang.Crack.nocoke, 'error')
|
||||
end
|
||||
else
|
||||
if RemoveItem('loosecoke', 1 ) then
|
||||
RemoveItem('bakingsoda', 1)
|
||||
AddItem('crackrock', 1)
|
||||
Notifys(Lang.Crack.makecrack, "success")
|
||||
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Cut Crack', 'crack')
|
||||
else
|
||||
Notifys(Lang.Crack.nocoke, 'error')
|
||||
end
|
||||
if not GetRecipe(src, 'crack', 'cookcrack', 'tier1') then return end
|
||||
Log(GetName(src) .. ' Cut Crack', 'crack')
|
||||
end
|
||||
end)
|
||||
|
||||
RegisterServerEvent('md-drugs:server:bagcrack', function(num)
|
||||
local src = source
|
||||
local Player = QBCore.Functions.GetPlayer(src)
|
||||
local playerPed = GetPlayerPed(source)
|
||||
if CheckDist(source, playerPed, Config.bagcrack[num]['loc']) then return end
|
||||
if not Itemcheck(Player, 'empty_weed_bag', 1, 'true') then return end
|
||||
if CheckDist(src, Config.bagcrack[num]['loc']) then return end
|
||||
if Config.TierSystem then
|
||||
local rock = Player.Functions.GetItemByName('crackrock')
|
||||
local rock2 = Player.Functions.GetItemByName('crackrockstagetwo')
|
||||
local rock3 = Player.Functions.GetItemByName('crackrockstagethree')
|
||||
if rock then
|
||||
RemoveItem('crackrock', 1 )
|
||||
RemoveItem('empty_weed_bag', 1)
|
||||
AddItem('baggedcracked', 1)
|
||||
Notifys(Lang.Crack.makecrack, "success")
|
||||
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Bagged Crack', 'crack')
|
||||
if not GetRecipe(src, 'crack', 'bagcrack', 'tier1') then return end
|
||||
Log(GetName(src) .. ' Bagged Crack', 'crack')
|
||||
elseif rock2 then
|
||||
RemoveItem('crackrockstagetwo', 1 )
|
||||
RemoveItem('empty_weed_bag', 1)
|
||||
AddItem('baggedcrackedstagetwo', 1)
|
||||
Notifys(Lang.Crack.makecrack, "success")
|
||||
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Bagged Crack', 'crack')
|
||||
if not GetRecipe(src, 'crack', 'bagcrack', 'tier2') then return end
|
||||
Log(GetName(src) .. ' Bagged Crack', 'crack')
|
||||
elseif rock3 then
|
||||
RemoveItem('crackrockstagethree', 1 )
|
||||
RemoveItem('empty_weed_bag', 1)
|
||||
AddItem('baggedcrackedstagethree', 1)
|
||||
Notifys(Lang.Crack.makecrack, "success")
|
||||
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Bagged Crack', 'crack')
|
||||
if not GetRecipe(src, 'crack', 'bagcrack', 'tier3') then return end
|
||||
Log(GetName(src) .. ' Bagged Crack', 'crack')
|
||||
else
|
||||
Notifys(Lang.Crack.nocoke, "error")
|
||||
Notifys(src, Lang.Crack.nocoke, "error")
|
||||
end
|
||||
else
|
||||
if RemoveItem('crackrock', 1 ) then
|
||||
RemoveItem('empty_weed_bag', 1)
|
||||
AddItem('baggedcracked', 1)
|
||||
Notifys(Lang.Crack.makecrack, "success")
|
||||
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Bagged Crack', 'crack')
|
||||
else
|
||||
Notifys(Lang.Crack.nocoke, "error")
|
||||
end
|
||||
if not GetRecipe(src, 'crack', 'bagcrack', 'tier1') then return end
|
||||
Log(GetName(src) .. ' Bagged Crack', 'crack')
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
||||
local cokecut = {crackrockstagetwo = 2, crackrockstagethree = 3}
|
||||
for k, v in pairs (cokecut) do
|
||||
QBCore.Functions.CreateUseableItem(k, function(source, item)
|
||||
local src = source
|
||||
local Player = QBCore.Functions.GetPlayer(src)
|
||||
if Player.Functions.GetItemByName(item.name) then
|
||||
if not Itemcheck(src, 'bakingsoda', 1) then return end
|
||||
TriggerClientEvent('md-drugs:client:minusTier', src, {type = 'crack', xt = 'bakingsoda', item = k, amount = v,recieve = 'crackrock'})
|
||||
end
|
||||
end)
|
||||
end
|
||||
Reference in new issue
Block a user