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
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.luaunder ItemCategories = { . Make sure to read the variables and what they do in config
Setup item sizes in itemstable on databaseby defining x and y parameters. The x defines how many slots the items takes up horizontally and the y vertically.
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 :
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)
if Config.OxInventory then
Config.PlayerFunctionOverride = "OxInventory"
SetConvarReplicated("inventory:framework", "esx")
SetConvarReplicated("inventory:weight", Config.MaxWeight * 1000)
end
if Config.CoreInventory then
Config.PlayerFunctionOverride = "CoreInventory"
SetConvarReplicated("inventory:framework", "esx")
SetConvarReplicated("inventory:weight", Config.MaxWeight * 1000)
end
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