Possible fix for drag out vehicle, Possible fix #131, locale improvements, see desc

- Moved phone string to locale
- The police society can no longer wash money
This commit is contained in:
ElPumpo
2018-07-17 13:25:31 +02:00
parent a162cb9b2b
commit 91a5e9bca4
10 changed files with 77 additions and 58 deletions
+21 -15
View File
@@ -81,23 +81,29 @@ end)
RegisterServerEvent('esx_policejob:getStockItem')
AddEventHandler('esx_policejob:getStockItem', function(itemName, count)
local _source = source
local xPlayer = ESX.GetPlayerFromId(_source)
local sourceItem = xPlayer.getInventoryItem(itemName)
local xPlayer = ESX.GetPlayerFromId(source)
TriggerEvent('esx_addoninventory:getSharedInventory', 'society_police', function(inventory)
TriggerEvent('esx_addoninventory:getSharedInventory', 'society_police', function(inventory)
local item = inventory.getItem(itemName)
local item = inventory.getItem(itemName)
if item.count >= count then
inventory.removeItem(itemName, count)
xPlayer.addInventoryItem(itemName, count)
else
TriggerClientEvent('esx:showNotification', xPlayer.source, _U('quantity_invalid'))
end
TriggerClientEvent('esx:showNotification', xPlayer.source, _U('have_withdrawn') .. count .. ' ' .. item.label)
end)
-- is there enough in the society?
if count > 0 and item.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'))
else
inventory.removeItem(itemName, count)
xPlayer.addInventoryItem(itemName, count)
TriggerClientEvent('esx:showNotification', _source, _U('have_withdrawn', count, item.label))
end
else
TriggerClientEvent('esx:showNotification', _source, _U('quantity_invalid'))
end
end)
end)
@@ -117,7 +123,7 @@ AddEventHandler('esx_policejob:putStockItems', function(itemName, count)
TriggerClientEvent('esx:showNotification', xPlayer.source, _U('quantity_invalid'))
end
TriggerClientEvent('esx:showNotification', xPlayer.source, _U('added') .. count .. ' ' .. item.label)
TriggerClientEvent('esx:showNotification', xPlayer.source, _U('have_deposited', count, item.label))
end)