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
This is the simplest and most recommended installation for the newest es_extended version.
in es_extended/shared/config/main.lua, replace
Config.CustomInventory = falsewith
Config.CustomInventory = 'core_inventory'
Config.CoreInventory = Config.CustomInventory == 'core_inventory'Now, in es_extended/server/classes/overrides add this file into the 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)
endadd:
if Config.CoreInventory then
Config.PlayerFunctionOverride = "CoreInventory"
SetConvarReplicated("inventory:framework", "esx")
SetConvarReplicated("inventory:weight", Config.MaxWeight * 1000)
endNow, 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)
endfunction self.getInventoryItem(name, inventory)
inventory = inventory or 'content-' .. self.identifier:gsub(":", "")
return exports['core_inventory']:getItem(inventory, name)
endfunction 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
endfunction 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
endfunction 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)
endBASICS
IMAGES
Add the image of your items in
core_inventory/html/imgfolder.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.sqlwe provide in [items] folder. All weapons have a size and the right category already set on it.Open
config_weapon.luaand choose your attachment component mode, then add the attachment items in youritemstable on database related to the mode you choose.For every other item in your
itemstable set acategoryparameter . 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.luaunderItemCategories = {. Make sure to read the variables and what they do in configSetup item sizes in
itemstable 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