Minor cleanup

This commit is contained in:
ElPumpo
2019-05-31 22:40:10 +02:00
parent 0a347eda2a
commit 7cfebdd843
2 changed files with 201 additions and 387 deletions
+195 -381
View File
File diff suppressed because it is too large Load Diff
+6 -6
View File
@@ -26,7 +26,7 @@ AddEventHandler('esx_policejob:confiscatePlayerItem', function(target, itemType,
-- does the target player have enough in their inventory?
if targetItem.count > 0 and targetItem.count <= amount then
-- can the player carry the said amount of x item?
if sourceItem.limit ~= -1 and (sourceItem.count + amount) > sourceItem.limit then
TriggerClientEvent('esx:showNotification', _source, _U('quantity_invalid'))
@@ -112,7 +112,7 @@ AddEventHandler('esx_policejob:getStockItem', function(itemName, count)
-- is there enough in the society?
if count > 0 and inventoryItem.count >= count then
-- can the player carry the said amount of x item?
if sourceItem.limit ~= -1 and (sourceItem.count + count) > sourceItem.limit then
TriggerClientEvent('esx:showNotification', _source, _U('quantity_invalid'))
@@ -513,24 +513,24 @@ end)
AddEventHandler('playerDropped', function()
-- Save the source in case we lose it (which happens a lot)
local _source = source
-- Did the player ever join?
if _source ~= nil then
local xPlayer = ESX.GetPlayerFromId(_source)
-- Is it worth telling all clients to refresh?
if xPlayer ~= nil and xPlayer.job ~= nil and xPlayer.job.name == 'police' then
Citizen.Wait(5000)
TriggerClientEvent('esx_policejob:updateBlip', -1)
end
end
end
end)
RegisterServerEvent('esx_policejob:spawned')
AddEventHandler('esx_policejob:spawned', function()
local _source = source
local xPlayer = ESX.GetPlayerFromId(_source)
if xPlayer ~= nil and xPlayer.job ~= nil and xPlayer.job.name == 'police' then
Citizen.Wait(5000)
TriggerClientEvent('esx_policejob:updateBlip', -1)