Update weed.lua

Fix error when making transformation cannabis into marijuana if Config.LicenseEnable is enable (true). Error in client consol xCannabis is null and when exiting the zone transformation still running.
This commit is contained in:
StopherTv
2022-04-26 17:44:22 +02:00
committed by GitHub
parent 75522caf5f
commit aa0749d51f
+12 -13
View File
@@ -26,20 +26,19 @@ CreateThread(function()
end
if IsControlJustReleased(0, 38) and not isProcessing then
if Config.LicenseEnable then
ESX.TriggerServerCallback('esx_license:checkLicense', function(hasProcessingLicense)
if hasProcessingLicense then
ProcessWeed()
else
OpenBuyLicenseMenu('weed_processing')
end
end, GetPlayerServerId(PlayerId()), 'weed_processing')
else
ESX.TriggerServerCallback('esx_drugs:cannabis_count', function(xCannabis)
ESX.TriggerServerCallback('esx_drugs:cannabis_count', function(xCannabis)
if Config.LicenseEnable then
ESX.TriggerServerCallback('esx_license:checkLicense', function(hasProcessingLicense)
if hasProcessingLicense then
ProcessWeed(xCannabis)
else
OpenBuyLicenseMenu('weed_processing')
end
end, GetPlayerServerId(PlayerId()), 'weed_processing')
else
ProcessWeed(xCannabis)
end)
end
end
end)
end
end
Wait(wait)