client side GetItemCount

Qbox is hardcoded for ox and the only inventory I know that supports it other than ox is quasar, both are bridged so should be completely fine
This commit is contained in:
MrNewb committed 2025-04-07 14:37:22 -04:00
1 parent 9ad8c6188c
commit e5190cdca0
8 files changed
+70

No files matched your search

+4
View File
@@ -14,6 +14,10 @@ Inventory.HasItem = function(item)
return Framework.HasItem(item)
end
Inventory.GetItemCount = function(item)
return Framework.GetItemCount(item)
end
---comment
---@param item string
---@return string
@@ -27,6 +27,18 @@ Inventory.HasItem = function(item)
return origin:HasItem(item)
end
---comment
---@param item string
---@return number
Inventory.GetItemCount = function(item)
local searchItem = origin:Search('slots', item)
local count = 0
for _, v in pairs(searchItem) do
count = count + v.count
end
return count
end
---comment
---@param item string
---@return string
@@ -29,6 +29,13 @@ Inventory.HasItem = function(item)
return hasItem
end
---comment
---@param item string
---@return number
Inventory.GetItemCount = function(item)
return ox_inventory:GetItemCount(item, nil, false)
end
---comment
---@param item string
---@return string
@@ -44,6 +44,14 @@ Inventory.GetImagePath = function(item)
return imagePath or "https://avatars.githubusercontent.com/u/47620135"
end
---comment
---@param item string
---@return number
Inventory.GetItemCount = function(item)
local searchItem = quasar:Search(item)
return searchItem or 0
end
---comment
---@return table
Inventory.GetPlayerInventory = function()
@@ -25,6 +25,14 @@ Inventory.GetItemInfo = function(item)
return repackedTable
end
---comment
---@param item string
---@return number
Inventory.GetItemCount = function(item)
local searchItem = tgiann:GetItemCount(item, nil, false)
return searchItem or 0
end
---This will return a boolean if the player has the item in the inventory
---@param item string
---@return boolean