ESX

FRAMEWORK CONFIGURATION

Choose your framework version. Complete the neccicerry changes and continue at BASICS to finalize installation.

FOR ES_EXTENDED HIGHER OR EQUAL TO 1.11.0

in es_extended/shared/config/main.lua, replace

Config.CustomInventory = false

with

Config.CustomInventory = 'core_inventory'
Config.CoreInventory = Config.CustomInventory == 'core_inventory'

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

override file to put in es_extended/server/classes/overrides folder

FOR ES_EXTENDED FROM 1.7.5 to 1.10.X

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 :

Now you can go to step ESX


FOR ES_EXTENDED LOWER THEN 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

BASICS

IMAGES

  • 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

ITEMS

  • Upload SQL files for default items from [items] folder. First upload setup.sql file

  • For all your weapons items you can use the weapons.sql we provide in [items] folder. All weapons have a size and the right category already set on it.

  • Open config_weapon.lua and choose your attachment component mode, then add the attachment items in your items table on database related to the mode you choose.

  • For every other item in your items table set a category parameter . This will change its color, sound, stacking properties in inventory. If not set will default to misc category.

  • Setup every added category in core_inventory/config.lua under ItemCategories = { . Make sure to read the variables and what they do in config

  • Setup item sizes in items table on database by defining x and y parameters. The x defines how many slots the items takes up horizontally and the y vertically.

  • For more item information checkout ITEMS

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