🔧Installation

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

First we want you to know that our script only supports the following versions of the two most used frameworks, in older versions it may be usable but we do not provide support since the development focuses on the following versions:

VERY IMPORTANT for any framework

For a safe startup, please do not put your framework and inventory folders in shared folders (they are in brackets)

If you do:

ensure qb-core

ensure origen_inventory

And, we assume that origin_inventory is inside [origen] and then do:

ensure [origen]

This will cause origin_inventory to restart again and make it error out, same for core.

REMOVE THESE RESOURCES FROM BRACKETS FOLDERS AND SET ON ROOT RESOURCES FOLDER.

IMPORTANT

From inventory versions 1.9.8 onwards, installation of QB-Core is automatic and requires NO code modifications.

Just install the SQL and the changes that appear in the video.

Only in certain cases it is possible that unrecognized function errors appear, for this we recommend following the steps below and implementing the code snippets.

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

Now you have to insert the SQL files into your database:

Add some code

Go to qb-core/server/functions.lua replace those functions:

function QBCore.Functions.CreateUseableItem(item, data)
    QBCore.UsableItems[item] = data
    exports['origen_inventory']:CreateUseableItem(item, data)
end
function QBCore.Functions.UseItem(source, item)
    if GetResourceState('origen_inventory') == 'missing' then return end
    exports['origen_inventory']:UseItem(source, item)
end
function QBCore.Functions.HasItem(source, items, amount)
    if GetResourceState('origen_inventory') == 'missing' then return end
    return exports['origen_inventory']:HasItem(source, items, amount)
end

Go to qb-core/server/player.lua, replace those functions:

function QBCore.Player.GetTotalWeight(items)
    if GetResourceState('origen_inventory') == 'missing' then return 0 end
    return exports['origen_inventory']:GetTotalWeightByItems(items)
end

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

Last updated