Update client.lua

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