fix(drugs/server): removing check for health, becuause why the fuck

This commit is contained in:
Christopher
2020-12-06 15:38:33 +01:00
parent b9977d7c6d
commit 06c5102564
2 changed files with 11 additions and 12 deletions
+7 -8
View File
@@ -88,21 +88,20 @@ end)
RegisterServerEvent('esx_drugs:processCannabis')
AddEventHandler('esx_drugs:processCannabis', function()
if not playersProcessingCannabis[source] then
if not playersProcessingCannabis[source] then
local _source = source
local xPlayer = ESX.GetPlayerFromId(_source)
local xCannabis = xPlayer.getInventoryItem('cannabis')
TriggerClientEvent('esx_drugs:getPlayer',xCannabis.count,_source)
local can = true
outofbound = false
if xCannabis.count >=3 then
while outofbound == false and can and GetEntityHealth(GetPlayerPed(_source))>0 do
if xCannabis.count >= 3 then
while outofbound == false and can do
if playersProcessingCannabis[_source] == nil then
playersProcessingCannabis[_source] = ESX.SetTimeout(Config.Delays.WeedProcessing , function()
if xCannabis.count >= 3 then
if xPlayer.canSwapItem('cannabis', 3, 'marijuana', 1) then
xPlayer.removeInventoryItem('cannabis', 3)
xPlayer.addInventoryItem('marijuana', 1)
if xCannabis.count >= 3 then
if xPlayer.canSwapItem('cannabis', 3, 'marijuana', 1) then
xPlayer.removeInventoryItem('cannabis', 3)
xPlayer.addInventoryItem('marijuana', 1)
xPlayer.showNotification(_U('weed_processed'))
else
can = false