GetPlayerInventory client side, event fires client now

community_bridge:client:inventory:updateInventory
This commit is contained in:
MrNewb committed 2025-02-05 01:54:55 -05:00
1 parent 651c8ae6df
commit 2a326c4811
14 files changed
+110 -3

No files matched your search

+20 -1
View File
@@ -25,4 +25,23 @@ Inventory.GetImagePath = function(item)
local file = LoadResourceFile("qs-inventory", string.format("html/images/%s.png", item))
local imagePath = file and string.format("nui://qs-inventory/html/images/%s.png", item)
return imagePath or "https://avatars.githubusercontent.com/u/47620135"
end
end
Inventory.GetPlayerInventory = function()
local items = {}
local inventory = quasar:getUserInventory()
for _, v in pairs(inventory) do
table.insert(items, {
name = v.name,
label = v.label,
count = v.amount,
slot = v.slot,
metadata = v.info,
stack = v.unique,
close = v.useable,
weight = v.weight
})
end
return items
end