RegisterServerEvent('esx:removeInventoryItem')
AddEventHandler('esx:removeInventoryItem', function(type, itemName, itemCount)
local _source = source
if type == 'item_standard' then
if itemCount == nil or itemCount < 1 then
TriggerClientEvent('esx:showNotification', _source, _U('imp_invalid_quantity'))
else
local xPlayer = ESX.GetPlayerFromId(source)
local xItem = xPlayer.getInventoryItem(itemName)
if (itemCount > xItem.count or xItem.count < 1) then
TriggerClientEvent('esx:showNotification', _source, _U('imp_invalid_quantity'))
else
xPlayer.removeInventoryItem(itemName, itemCount)
local pickupLabel = ('~y~%s~s~ [~b~%s~s~]'):format(xItem.label, itemCount)
ESX.CreatePickup('item_standard', itemName, itemCount, pickupLabel, _source)
TriggerClientEvent('esx:showNotification', _source, _U('threw_standard', itemCount, xItem.label))
end
end
elseif type == 'item_money' then