Xovos / esx_illegal

I changed ESX_Drugs and added a lot of features like more drugs and licenses for the money was and the money wash itself.
GNU General Public License v3.0
16 stars 16 forks source link

set inventory limits for the drugs #33

Open giannistsitsis97 opened 3 years ago

giannistsitsis97 commented 3 years ago

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)