ESX

1. Framework configuration:

A. es_extended version highter or equal too 1.7.5

in es_extended/config.lua, under

Config.OxInventory = GetResourceState("ox_inventory") ~= 'missing'

add :

Config.CoreInventory = GetResourceState("core_inventory") ~= 'missing'

in es_extended/server/common.lua , under

if Config.OxInventory then
    Config.PlayerFunctionOverride = "OxInventory"
    SetConvarReplicated("inventory:framework", "esx")
    SetConvarReplicated("inventory:weight", Config.MaxWeight * 1000)
end

add:

if Config.CoreInventory then
    Config.PlayerFunctionOverride = "CoreInventory"
    SetConvarReplicated("inventory:framework", "esx")
    SetConvarReplicated("inventory:weight", Config.MaxWeight * 1000)
end

Now, in es_extended/server/classes/overrides add this file into the folder :

B. es_extended version lower than 1.7.5 (example: ESX 1.2)

Please set NewEsx = falsein your core inventory/config.lua

Replace existing functions by these functions in es_extended/server/classes/player.lua Note : All of these function should be placed inside the CreateExtendedPlayer function

function self.getInventory(minimal, inventory)
        inventory = inventory or 'content-' ..  self.identifier:gsub(":", "")
        return exports['core_inventory']:getInventory(inventory)
end
function self.getInventoryItem(name, inventory)
	inventory = inventory or 'content-' ..  self.identifier:gsub(":", "")
        return exports['core_inventory']:getItem(inventory, name)
end
function self.addInventoryItem(name, count, metadata, inventory)
        count = count or 1
        inventory = inventory or 'content-' ..  self.identifier:gsub(":", "")
        local result = exports['core_inventory']:addItem(inventory, name, tonumber(count), metadata)
        if result then
                TriggerClientEvent('core_inventory:client:notification', self.source, name, 'add',  tonumber(count))
        end
        return result
end
function self.removeInventoryItem(name, count, inventory)
         count = count or 1         
         inventory = inventory or 'content-' ..  self.identifier:gsub(":", "")
         local result = exports['core_inventory']:removeItem(inventory, name, tonumber(count))
         if result then
                TriggerClientEvent('core_inventory:client:notification', self.source, name, 'remove',  tonumber(count))
         end
         return result
end
function self.canCarryItem(name, count, inventory, metadata)
        count = count or 1
        inventory = inventory or 'content-' ..  self.identifier:gsub(":", "")
        return exports['core_inventory']:canCarry(inventory, name, count, metadata)
end

2. Global configuration

  • Add the image of your items in core_inventory/html/img folder.

  • All your images should have the same name as your items. For example, if you have an item called sandwich_bacon, the image name should be sandwich_bacon.png.

  • Only .png image are include in the FXManifest so be sure to use this extension for your images

  • if you don't have weapon as item, run the sql file called core_weapons.sql on your dataabse to add it.

  • if you don't have all the weapon component, run the sql file called core_weapon_component.sql on your database to add it.

  • for each item in your items database table, configure the category, if you don't set category, the default apply by the SQL file is misc

  • the stack property come from the category apply to the item. The default one apply is misc and the stack value is 2. If you want to increase / decrease this number, open core_inventory/config.lua and search for ItemCategories section. You can create a new category and then apply this category in your item database.

  • You can configure the x and y value for each item, x is the number column take by the item, y the number of row. The default value is 1x1

  • For backpack item, you need to set the backpackModel (list can be find here) and the backpackTexture (default is 0 for each backpack model)

  • To add image's item, just put the image file (with .png extension) in the core_inventory/html/img folder

3. Money as item

In core_inventory/config.lua make sure to enable the money as item option and set the right account name in the option, for example :

MoneyAsItem = true,
AccountMoneyAsItem = 'money',
ItemMoneyAsItem = 'money',

DirtyMoneyAsItem = true,
AccountDirtyMoneyAsItem = 'black_money',
ItemDirtyMoneyAsItem = 'markedbills',

Make sure to also have the item in your item database called money (with money category set on it ) and markedbills (with markedbill category set on it)

Last updated