lots of shit
This commit is contained in:
1 parent
9e84111da3
commit
1b29aaa3b0
37 files changed
+699
-664
No files matched your search
+50
-30
@@ -1,62 +1,82 @@
|
||||
local QBCore = exports['qb-core']:GetCoreObject()
|
||||
|
||||
RegisterServerEvent('md-drugs:server:makecrackone', function(num)
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
local count,type, tier = 0, 'cookcrack', 'tier1'
|
||||
if not checkLoc(src, 'makecrack', num) then return end
|
||||
local tier = 'tier1'
|
||||
if not ps.checkDistance(src, GlobalState.MDDrugsLocs.makecrack[num].loc, 2.0) then
|
||||
ps.notify(src, 'You are not in the correct location', 'error')
|
||||
return
|
||||
end
|
||||
if Config.TierSystem then
|
||||
local crackTiers = {
|
||||
{item = 'loosecoke', tier = 'tier1', log = ' Cut Crack'},
|
||||
{item = 'loosecokestagetwo', tier = 'tier2', log = ' Cut Crack tier 2'},
|
||||
{item = 'loosecokestagethree', tier = 'tier3', log = ' Cut Crack tier 3'}
|
||||
{item = 'loosecoke', tier = 'tier1'},
|
||||
{item = 'loosecokestagetwo', tier = 'tier2'},
|
||||
{item = 'loosecokestagethree', tier = 'tier3'}
|
||||
}
|
||||
for _, v in ipairs(crackTiers) do
|
||||
if count >= 1 then break end
|
||||
if Player.Functions.GetItemByName(v.item) then
|
||||
tier = v.tier
|
||||
count = count + 1
|
||||
if ps.hasItem(src, v.item) then
|
||||
tier = v.tier
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
if not GetRecipe(src, 'crack', type, tier) then return end
|
||||
if not GetRecipe(src, 'crack', 'cookcrack', tier) then return end
|
||||
end)
|
||||
|
||||
|
||||
RegisterServerEvent('md-drugs:server:bagcrack', function(num)
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
local count,type, tier = 0, 'bagcrack', 'tier1'
|
||||
if not checkLoc(src, 'bagcrack', num) then return end
|
||||
local tier = 'tier1'
|
||||
if not ps.checkDistance(src, GlobalState.MDDrugsLocs.bagcrack[num].loc, 2.0) then
|
||||
ps.notify(src, 'You are not in the correct location', 'error')
|
||||
return
|
||||
end
|
||||
if Config.TierSystem then
|
||||
local crackTiers = {
|
||||
{item = 'crackrock', tier = 'tier1', log = ' Bagged Crack'},
|
||||
{item = 'crackrockstagetwo', tier = 'tier2', log = ' Bagged Crack tier 2'},
|
||||
{item = 'crackrockstagethree', tier = 'tier3', log = ' Bagged Crack tier 3'}
|
||||
{item = 'crackrock', tier = 'tier1'},
|
||||
{item = 'crackrockstagetwo', tier = 'tier2'},
|
||||
{item = 'crackrockstagethree', tier = 'tier3'}
|
||||
}
|
||||
for _, v in ipairs(crackTiers) do
|
||||
if count >= 1 then break end
|
||||
if Player.Functions.GetItemByName(v.item) then
|
||||
tier = v.tier
|
||||
count = count + 1
|
||||
if ps.hasItem(src, v.item) then
|
||||
tier = v.tier
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
if not GetRecipe(src, 'crack', type, tier) then return end
|
||||
if not GetRecipe(src, 'crack', 'bagcrack', tier) then return end
|
||||
end)
|
||||
|
||||
local cokecut = {crackrockstagetwo = 2, crackrockstagethree = 3}
|
||||
for k, v in pairs (cokecut) do
|
||||
CUI(k, function(source, item)
|
||||
ps.createUseable(k, function(source, item)
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
if Player.Functions.GetItemByName(item.name) then
|
||||
if not Itemcheck(src, 'bakingsoda', 1) then return end
|
||||
local check = lib.callback.await('md-drugs:client:uncuff', src, 'Cutting Crack Rock Further')
|
||||
if ps.hasItem(src, item.name) then
|
||||
if not ps.hasItem(src, 'bakingsoda', 1) then return end
|
||||
local check = ps.callback('md-drugs:client:uncuff', src, 'Cutting Crack Rock Further')
|
||||
if not check then return end
|
||||
if RemoveItem(src, k, 1) and RemoveItem(src, 'bakingsoda', 1) then
|
||||
AddItem(src, 'crackrock', v)
|
||||
if ps.removeItem(src, k, 1) and ps.removeItem(src, 'bakingsoda', 1) then
|
||||
ps.addItem(src, 'crackrock', v)
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
RegisterNetEvent("md-drugs:server:failcrackone", function(num)
|
||||
local src = source
|
||||
if not ps.checkDistance(src, GlobalState.MDDrugsLocs.makecrack[num].loc, 2.0) then
|
||||
ps.notify(src, 'You are not in the correct location', 'error')
|
||||
return
|
||||
end
|
||||
local items = {
|
||||
loosecoke = 1,
|
||||
loosecokestagetwo = 1,
|
||||
loosecokestagethree = 1
|
||||
}
|
||||
for k,v in pairs(items) do
|
||||
if ps.hasItem(src, k, v) then
|
||||
ps.removeItem(src, k, v)
|
||||
ps.notify(src, 'You failed to make crack and lost '..v..' '..k, 'error')
|
||||
return
|
||||
end
|
||||
end
|
||||
end)
|
||||
Reference in new issue
Block a user