🔧OLD Installation

Here we're going to guide you in the installation of an old origen_inventory version.

This guide is going to work only for and old origen_inventory version,

server.cfg
ensure oxmysql
ensure qb-core
ensure origen_inventory
...(make sure to start other scripts that use inventory functions after the origen_inventory)

Add some code

Replace those functions in the qb-core/server/functions.lua

function QBCore.Functions.CreateUseableItem(item, data)
    -- print ('^5[QBCore] Creating usable item: ^0', item, GetInvokingResource())
     QBCore.UsableItems[item] = data
     if GetResourceState('origen_inventory'):match('start') then
         exports['origen_inventory']:CreateUsableItem(item, data)
     end
 end

---Checks if the given item is usable
 ---@param item string
 ---@return any
 function QBCore.Functions.CanUseItem(item)  
    return QBCore.UsableItems[item]
end

---Use item
---@param source any
---@param item string
function QBCore.Functions.UseItem(source, item)
    if QBCore.UsableItems[item] then 
        QBCore.UsableItems[item](source, item)
        return 
    end
    if GetResourceState('origen_inventory') == 'missing' or not QBCore.UsableItems[item] then return end
    exports['origen_inventory']:UseItem(source, item)
end

Replace all the qb-inventory strings with origen_inventory in all the resources folder using visual studio code:

Last updated