Update client.lua

This commit is contained in:
PenguScripts authored and GitHub committed 2025-02-17 12:48:47 -05:00
1 parent 2628111978
commit 3542aff067
1 file changed
+5
@@ -1,5 +1,6 @@
if GetResourceState('jpr-inventory') ~= 'started' then return end if GetResourceState('jpr-inventory') ~= 'started' then return end
local jpr = exports['jpr-inventory']
Inventory = Inventory or {} Inventory = Inventory or {}
RegisterNetEvent('community_bridge:client:jpr-inventory:openStash', function(id, data) RegisterNetEvent('community_bridge:client:jpr-inventory:openStash', function(id, data)
@@ -8,6 +9,10 @@ RegisterNetEvent('community_bridge:client:jpr-inventory:openStash', function(id,
TriggerServerEvent('inventory:server:OpenInventory', 'stash', id, { maxweight = data.weight, slots = data.slots }) TriggerServerEvent('inventory:server:OpenInventory', 'stash', id, { maxweight = data.weight, slots = data.slots })
end) end)
Inventory.HasItem = function(item)
return jpr:HasItem(item)
end
Inventory.GetImagePath = function(item) Inventory.GetImagePath = function(item)
local file = LoadResourceFile("jpr-inventory", string.format("html/images/%s.png", item)) local file = LoadResourceFile("jpr-inventory", string.format("html/images/%s.png", item))
local imagePath = file and string.format("nui://jpr-inventory/html/images/%s.png", item) local imagePath = file and string.format("nui://jpr-inventory/html/images/%s.png", item)