Skip to content

Commit

Permalink
Merge pull request #40 from Flobbah/Flobbah
Browse files Browse the repository at this point in the history
[FIX] infinite coke bug fix
  • Loading branch information
MonkeyWhisper authored May 1, 2022
2 parents 7452740 + f5ed083 commit 42b6a52
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions client/coke.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ local QBCore = exports['qb-core']:GetCoreObject()

local spawnedCocaLeaf = 0
local CocaPlants = {}
local isPickingUp, isProcessing, CWarehouse = false, false, false
local isPickingUp, isProcessing, CWarehouse, hasitem1, hasitem2 = false, false, false, false, false


Citizen.CreateThread(function()
Expand All @@ -29,19 +29,22 @@ AddEventHandler('ps-drugprocessing:ProcessCocaFarm', function()
if result then
print('You have this item SA')
hasitem1 = true
else
QBCore.Functions.Notify('You need Coca Leafs!', 'error')
end
end, 'coca_leaf')
Citizen.Wait(1000) -- BUFFER
QBCore.Functions.TriggerCallback('QBCore:HasItem', function(result)
if result and hasitem1 then
print('You have this item HA')
ProcessCoke()
else
QBCore.Functions.Notify('You need scissors to do this!', 'error')
end
end, 'trimming_scissors')
if hasitem1 then
QBCore.Functions.TriggerCallback('QBCore:HasItem', function(result)
if result and hasitem1 then
print('You have this item HA')
ProcessCoke()
hasitem1 = false
else
QBCore.Functions.Notify('You need scissors to do this!', 'error')
end
end, 'trimming_scissors')
else
QBCore.Functions.Notify('You need Coca Leafs!', 'error')
end
end
end
end)
Expand Down

0 comments on commit 42b6a52

Please sign in to comment.