mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-04 08:13:21 +00:00
Possibly fixing issues with putting stock.
This commit is contained in:
+13
-9
@@ -393,15 +393,19 @@ end
|
||||
function OpenPutStocksMenu()
|
||||
ESX.TriggerServerCallback('esx_taxijob:getPlayerInventory', function(inventory)
|
||||
local elements = {}
|
||||
|
||||
for i=1, #inventory.items, 1 do
|
||||
local item = inventory.items[i]
|
||||
|
||||
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
|
||||
|
||||
if item.count > 0 then
|
||||
table.insert(elements, {
|
||||
label = item.label .. ' x' .. item.count,
|
||||
type = 'item_standard',
|
||||
value = item.name
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'stocks_menu', {
|
||||
title = _U('inventory'),
|
||||
align = 'top-left',
|
||||
@@ -744,4 +748,4 @@ end)
|
||||
|
||||
AddEventHandler('esx:onPlayerSpawn', function(spawn)
|
||||
IsDead = false
|
||||
end)
|
||||
end)
|
||||
+5
-3
@@ -100,7 +100,9 @@ AddEventHandler('esx_taxijob:putStockItems', function(itemName, count)
|
||||
end
|
||||
end)
|
||||
|
||||
ESX.RegisterServerCallback('esx_taxijob:getPlayerInventory', function(source, cb)
|
||||
ESX.RegisterServerCallback('esx_policejob:getPlayerInventory', function(source, cb)
|
||||
local xPlayer = ESX.GetPlayerFromId(source)
|
||||
cb(xPlayer.getInventory())
|
||||
end)
|
||||
local items = xPlayer.inventory
|
||||
|
||||
cb({items = items})
|
||||
end)
|
||||
Reference in New Issue
Block a user