Project-Sloth / ps-drugprocessing

An advanced drug script by Project Sloth
https://discord.gg/projectsloth
GNU General Public License v3.0
103 stars 87 forks source link

Add items to the required items CokeLab "Fixed" #31

Closed DarrianJCairns closed 2 years ago

DarrianJCairns commented 2 years ago

RegisterNetEvent('ps-drugprocessing:ProcessCocaFarm') AddEventHandler('ps-drugprocessing:ProcessCocaFarm', function() local coords = GetEntityCoords(PlayerPedId(source))

if GetDistanceBetweenCoords(coords, Config.CircleZones.CokeProcessing.coords, true) < 5 then
    if not isProcessing then
        QBCore.Functions.TriggerCallback('QBCore:HasItem', function(result)
            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 cut with!..', 'error')
            end
        end, 'trimming_scissors')
    end
end

end)

Alivemonstor commented 2 years ago

Done