Can someone help me with the error? Once I add my job to the list of jobs that don’t require items, everything works fine. It also works when I say that no one needs items. But when the person needs items, the visn_are menu can no longer be opened and this error appears in the live console.
the code looks like this
—Gets all items from the player
—@param source any
—@return table
function GetItems(source)
source = tonumber(source)
if not ServerConfig.m_itemsNeeded or ShouldIgnoreItems(source) then return GetAvailableItems() end
if FRAMEWORK == ENUM_DEFINED_FRAMEWORKS.ES_EXTENDED then
local frameworkPlayer = FRAMEWORK_DATA.GetPlayerFromId(source)
if not frameworkPlayer then return {} end
local items = frameworkPlayer.getInventory(true)
if ServerConfig.m_customInventory.enabled and ServerConfig.m_customInventory.inventory_type == "core_inventory" then
items = exports["core_inventory"]:getInventory('content-' .. frameworkPlayer.identifier:gsub(":", ""))
end
for _, v in pairs(items) do
if type(v) == "table" and v.count > 0 then
items[v.name] = v.count
end
end
return items
elseif FRAMEWORK == ENUM_DEFINED_FRAMEWORKS.QB_CORE then
local frameworkPlayer = FRAMEWORK_DATA.Functions.GetPlayer(source)
if not frameworkPlayer then return {} end
local items = {}
for _, v in pairs(frameworkPlayer.PlayerData.items) do
items[v.name] = v.amount
end
return items
end
-- Implement your own logic (standalone)
return {}
end
