mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-04 16:23:21 +00:00
Improved confiscate messages, closes #107
This commit is contained in:
+12
-11
@@ -33,9 +33,9 @@ AddEventHandler('esx_policejob:confiscatePlayerItem', function(target, itemType,
|
||||
TriggerClientEvent('esx:showNotification', _source, _U('invalid_quantity'))
|
||||
else
|
||||
targetXPlayer.removeInventoryItem(itemName, amount)
|
||||
sourceXPlayer.addInventoryItem(itemName, amount)
|
||||
TriggerClientEvent('esx:showNotification', sourceXPlayer.source, _U('you_have_confinv') .. amount .. ' ' .. sourceItem.label .. _U('from') .. targetXPlayer.name)
|
||||
TriggerClientEvent('esx:showNotification', targetXPlayer.source, '~b~' .. targetXPlayer.name .. _U('confinv') .. amount .. ' ' .. sourceItem.label)
|
||||
sourceXPlayer.addInventoryItem (itemName, amount)
|
||||
TriggerClientEvent('esx:showNotification', _source, _U('you_confiscated', amount, sourceItem.label, targetXPlayer.name))
|
||||
TriggerClientEvent('esx:showNotification', target, _U('got_confiscated', amount, sourceItem.label, sourceXPlayer.name))
|
||||
end
|
||||
else
|
||||
TriggerClientEvent('esx:showNotification', _source, _U('invalid_quantity'))
|
||||
@@ -43,17 +43,18 @@ AddEventHandler('esx_policejob:confiscatePlayerItem', function(target, itemType,
|
||||
|
||||
elseif itemType == 'item_account' then
|
||||
targetXPlayer.removeAccountMoney(itemName, amount)
|
||||
sourceXPlayer.addAccountMoney(itemName, amount)
|
||||
sourceXPlayer.addAccountMoney (itemName, amount)
|
||||
|
||||
TriggerClientEvent('esx:showNotification', sourceXPlayer.source, _U('you_have_confdm') .. amount .. _U('from') .. targetXPlayer.name)
|
||||
TriggerClientEvent('esx:showNotification', targetXPlayer.source, '~b~' .. targetXPlayer.name .. _U('confdm') .. amount)
|
||||
TriggerClientEvent('esx:showNotification', _source, _U('you_confiscated_account', amount, itemName, targetXPlayer.name))
|
||||
TriggerClientEvent('esx:showNotification', target, _U('got_confiscated_account', amount, itemName, sourceXPlayer.name))
|
||||
|
||||
elseif itemType == 'item_weapon' then
|
||||
targetXPlayer.removeWeapon(itemName)
|
||||
sourceXPlayer.addWeapon(itemName, amount)
|
||||
if amount == nil then amount = 0 end
|
||||
targetXPlayer.removeWeapon(itemName, amount)
|
||||
sourceXPlayer.addWeapon (itemName, amount)
|
||||
|
||||
TriggerClientEvent('esx:showNotification', sourceXPlayer.source, _U('you_have_confweapon') .. ESX.GetWeaponLabel(itemName) .. _U('from') .. targetXPlayer.name)
|
||||
TriggerClientEvent('esx:showNotification', targetXPlayer.source, '~b~' .. targetXPlayer.name .. _U('confweapon') .. ESX.GetWeaponLabel(itemName))
|
||||
TriggerClientEvent('esx:showNotification', _source, _U('you_confiscated_weapon', ESX.GetWeaponLabel(itemName), targetXPlayer.name, amount))
|
||||
TriggerClientEvent('esx:showNotification', target, _U('got_confiscated_weapon', ESX.GetWeaponLabel(itemName), amount, sourceXPlayer.name))
|
||||
end
|
||||
end)
|
||||
|
||||
@@ -488,7 +489,7 @@ AddEventHandler('playerDropped', function()
|
||||
Citizen.Wait(5000)
|
||||
TriggerClientEvent('esx_policejob:updateBlip', -1)
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
RegisterServerEvent('esx_policejob:spawned')
|
||||
|
||||
Reference in New Issue
Block a user