Forgot Sylundef PR

This commit is contained in:
LuaDeldu
2018-01-18 16:01:05 +01:00
parent d08bcc6b77
commit ac3c7492bf
+7 -2
View File
@@ -24,9 +24,14 @@ AddEventHandler('esx_policejob:confiscatePlayerItem', function(target, itemType,
if itemType == 'item_standard' then
local label = sourceXPlayer.getInventoryItem(itemName).label
local playerItemCount = targetXPlayer.getInventoryItem(itemName).count
targetXPlayer.removeInventoryItem(itemName, amount)
sourceXPlayer.addInventoryItem(itemName, amount)
if playerItemCount <= amount then
targetXPlayer.removeInventoryItem(itemName, amount)
sourceXPlayer.addInventoryItem(itemName, amount)
else
TriggerClientEvent('esx:showNotification', _source, _U('invalid_quantity'))
end
TriggerClientEvent('esx:showNotification', sourceXPlayer.source, _U('you_have_confinv') .. amount .. ' ' .. label .. _U('from') .. targetXPlayer.name)
TriggerClientEvent('esx:showNotification', targetXPlayer.source, '~b~' .. targetXPlayer.name .. _U('confinv') .. amount .. ' ' .. label )