GetPlayerInventory client side, event fires client now
community_bridge:client:inventory:updateInventory
This commit is contained in:
1 parent
651c8ae6df
commit
2a326c4811
14 files changed
+110
-3
No files matched your search
@@ -21,4 +21,22 @@ Inventory.GetImagePath = function(item)
|
||||
local file = LoadResourceFile("origen_inventory", string.format("html/images/%s.png", item))
|
||||
local imagePath = file and string.format("nui://origen_inventory/html/images/%s.png", item)
|
||||
return imagePath or "https://avatars.githubusercontent.com/u/47620135"
|
||||
end
|
||||
|
||||
Inventory.GetPlayerInventory = function()
|
||||
local items = {}
|
||||
local inventory = origin:GetInventory()
|
||||
for _, v in pairs(inventory) do
|
||||
table.insert(items, {
|
||||
name = v.name,
|
||||
label = v.label,
|
||||
count = v.count,
|
||||
slot = v.slot,
|
||||
metadata = v.metadata,
|
||||
stack = v.unique,
|
||||
close = v.useable,
|
||||
weight = v.weight
|
||||
})
|
||||
end
|
||||
return items
|
||||
end
|
||||
Reference in new issue
Block a user