i am trying to set limits when someone collecting drugs
if xPlayer.canCarryItem('sulfuric_acid', 20) then
but when i am trying to collect , it gives me more than 20 :/
RegisterServerEvent('esx_illegal:pickedUpSulfuricAcid')
AddEventHandler('esx_illegal:pickedUpSulfuricAcid', function()
local xPlayer = ESX.GetPlayerFromId(source)
if xPlayer.canCarryItem('sulfuric_acid', 20) then
xPlayer.addInventoryItem('sulfuric_acid', 1)
else
xPlayer.showNotification(_U('sulfuric_acid_inventoryfull'))
end
end)
i am trying to set limits when someone collecting drugs if xPlayer.canCarryItem('sulfuric_acid', 20) then but when i am trying to collect , it gives me more than 20 :/