Update client.lua

This commit is contained in:
PenguScripts authored and GitHub committed 2025-02-17 12:59:00 -05:00
1 parent db6a1045db
commit ccf2219ad2
1 file changed
+7 -1
+7 -1
View File
@@ -1,5 +1,7 @@
if GetResourceState('qb-inventory') ~= 'started' then return end
local qb = exports['qb-inventory']
Inventory = Inventory or {}
RegisterNetEvent('community_bridge:client:qb-inventory:openStash', function(id, data)
@@ -8,8 +10,12 @@ RegisterNetEvent('community_bridge:client:qb-inventory:openStash', function(id,
TriggerServerEvent('inventory:server:OpenInventory', 'stash', id, { maxweight = data.weight, slots = data.slots })
end)
Inventory.HasItem = function(item)
return exports['qb-inventory']:HasItem(item)
end
Inventory.GetImagePath = function(item)
local file = LoadResourceFile("qb-inventory", string.format("html/images/%s.png", item))
local imagePath = file and string.format("nui://qb-inventory/html/images/%s.png", item)
return imagePath or "https://avatars.githubusercontent.com/u/47620135"
end
end