Files
community_bridge/modules/inventory/jpr-inventory/client.lua
T

26 lines
919 B
Lua
Raw Normal View History

if GetResourceState('jpr-inventory') ~= 'started' then return end
2025-02-17 12:48:47 -05:00
local jpr = exports['jpr-inventory']
Inventory = Inventory or {}
RegisterNetEvent('community_bridge:client:jpr-inventory:openStash', function(id, data)
if source ~= 65535 then return end
TriggerEvent("inventory:client:SetCurrentStash", id)
TriggerServerEvent('inventory:server:OpenInventory', 'stash', id, { maxweight = data.weight, slots = data.slots })
end)
2025-03-03 01:09:24 -05:00
---comment
---@param item string
---@return boolean
2025-02-17 12:48:47 -05:00
Inventory.HasItem = function(item)
return jpr:HasItem(item)
end
2025-03-03 01:09:24 -05:00
---comment
---@param item string
---@return string
Inventory.GetImagePath = function(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)
return imagePath or "https://avatars.githubusercontent.com/u/47620135"
2025-02-17 12:48:47 -05:00
end