Security improvement and minor cleanup

This commit is contained in:
ElPumpo
2020-03-04 11:05:31 +01:00
parent f147a7be81
commit 7e9cee19a8
3 changed files with 69 additions and 86 deletions
+6 -11
View File
@@ -392,19 +392,14 @@ end
function OpenPutStocksMenu()
ESX.TriggerServerCallback('esx_taxijob:getPlayerInventory', function(inventory)
local elements = {}
for i=1, #inventory.items, 1 do
local item = inventory.items[i]
if item.count > 0 then
table.insert(elements, {
label = item.label .. ' x' .. item.count,
type = 'item_standard', -- not used
value = item.name
})
end
for k,v in ipairs(inventory) do
table.insert(elements, {
label = v.label .. ' x' .. v.count,
type = 'item_standard', -- not used
value = v.name
})
end
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'stocks_menu', {