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:
IMPORTANT
From 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.
server.cfg
ensure oxmysql
ensure qb-core
ensure origen_inventory
...(make sure to start other scripts that use inventory functions after the origen_inventory)
Now you have to insert the SQL files into your database:
Replace all the qb-inventory strings with origen_inventory in all the resources folder using visual studio code:
server.cfg
ensure oxmysql
ensure es_extended
ensure origen_inventory
...(make sure to start other scripts that use inventory functions after the origen_inventory)
Now you have to insert the SQL files into your database:
Go to es_extended/client/common.lua and add this code:
ifGetResourceState('origen_inventory') ~='missing' then Config.OrigenInventory =trueend
Go to es_extended/client/functions.lua and replace the ESX.GetPlayerData function:
functionESX.GetPlayerData()if Config.OrigenInventory thenTriggerEvent('__cfx_export_origen_inventory_getPlayerInventory', function(ref)if ref then ESX.PlayerData.inventory =ref()endend)endreturn ESX.PlayerDataend
Go to es_extended/server/common.lua and add this code above the StartDBSync function:
ifGetResourceState('origen_inventory') ~='missing' then Config.OrigenInventory =true Config.PlayerFunctionOverride ='OrigenInventory'end
Go to es_extended/server/common.lua and add this code below the Core.DatabaseConnected = true:
if Config.OrigenInventory then ESX.Items = exports['origen_inventory']:GetItemList()end
Go to es_extended/server/functions.lua and add this code at the end of the file:
AddEventHandler('onResourceStop', function(resourceName)if (resourceName =="origen_inventory") then Core.SavePlayers()endend)
Go to es_extended/server/functions.lua and replace the ESX.RegisterUsableItem function:
functionESX.RegisterUsableItem(item,cb) Core.UsableItemsCallbacks[item] = cbif Config.OrigenInventory then exports['origen_inventory']:CreateUseableItem(item, cb)endend
Go to es_extended/server/functions.lua and replace the ESX.UseItem function:
functionESX.UseItem(source,item, ...)local src, itm = source, itemiftype(src) =='string' then item = src source = itm endif ESX.Items[item] thenlocal itemCallback = Core.UsableItemsCallbacks[item]if Config.OrigenInventory thenreturn exports['origen_inventory']:UseItem(item, source, ...)endif itemCallback thenlocal success, result =pcall(itemCallback, source, item, ...)ifnot success then return result and print(result) or print(('[^3WARNING^7] An error occured when using item ^5"%s"^7! This was not caused by ESX.'):format(item))
endendelseprint(('[^3WARNING^7] Item ^5"%s"^7 was used but does not exist!'):format(item))endend
Go to es_extended/server/functions.lua and replace the ESX.GetItemLabel function:
functionESX.GetItemLabel(item)if Config.OrigenInventory thenreturn exports['origen_inventory']:GetItemLabel(item)endif Config.OxInventory then item = exports.ox_inventory:Items(item)if item thenreturn item.labelendendif ESX.Items[item] thenreturn ESX.Items[item].labelelseprint(('[^3WARNING^7] Attemting to get invalid Item -> ^5%s^7'):format(item))endend
Go to es_extended/server/functions.lua and add this code at the bottom of the file: