Return true if the player inventory isopen, false if it close
Usage :
Example :
Return :
getClothingItemFromPedSkin
Return the cloth items from the actual skin of the player
Usage :
Example :
Return :
Parameters:
Name
Type
Description
ped
number
The player ped or any ped you want to get cloth item from the skin
notIncludeDefaultSkin
boolean
If false, it will also return the default skins cloth item (apply by default to the ped), if true, it won"t include it
addClothingItemFromPedSkinInInventory
Will add all the cloth from the skin player to his inventory.
Usage :
Example :
Parameters:
Name
Type
Description
ped
string or number
string : the inventory name / number : the player id
addAlreadyOwnCloth
boolean
true will also add the cloth already in player holder, false will not
notIncludeDefaultSkin
boolean
true won't add item that are from the default skin that is from the config file and not set as item
notCheckSpace
boolean
true won't check if there is enought space in inventory, false willcheck
addClothingItemFromPedSkinInClothHolder
Will add all the cloth from the skin player to the right holder directly
Usage :
Example :
Parameters:
Name
Type
Description
ped
string or number
string : the inventory name / number : the player id
addAlreadyOwnCloth
boolean
true will also add the cloth already in player holder, false will not
notIncludeDefaultSkin
boolean
true won't add item that are from the default skin that is from the config file and not set as item
notCheckSpace
boolean
true won't check if there is enought space in inventory, false willcheck
getInventory / getPlayerItems
Return all items from player content inventory
Usage :
Example :
Return :
search / searchInventory
Return full / count/ slots / ids of the item in the player inventory
Usage :
Example :
Return :
Parameters:
Name
Type
Description
searchtype
string
full / count/ slots/ ids are available.
itemsName
string or table
Item or all items you want information about in player inventory
metadata
table (optional)
Returns only items containing specified metadata
getItemCount
Return count of the item pass in parameters
Usage :
Example :
Return :
Parameters:
Name
Type
Description
itemName
string
name of the item you want to retrieve amount
hasItem
Return true or false if you have or not the item or items in the define amount
Usage :
Example :
Return :
Parameters:
Name
Type
Description
itemName
string / table
name or names of the item or items you want to know if it has enought or not
amount
number
amount of item needed (for all the item listed in itemsName)
lockInventory
Lock the inventory, it can be open or close by the player. Use unlockInventory to unlock it
Usage :
unlockInventory
Unlock player inventory (can open / close it again)
Usage :
lockCloth
the cloth detection. Every time you will load or open the player inventory, the cloth in cloth slot won"t be read and the skin won"t be changed. Use unlockCloth to read again the cloth items
Usage :
unlockCloth
Unlock the cloth holder and when the inventory will be load or open, the cloth item will be read again and overide the player skin.
Usage :
EVENTS
core_inventory:client:itemAdd
This event is send to the client every time player receive an item
Usage :
core_inventory:client:itemRemove
This event is send to the client every time player receive an item
Usage :
core_inventory:client:handleWeapon
This event is send to the client every time player receive an item
Usage :
core_inventory:server:getInventory (callback)
Return all items present in the player inventory (content inventory only)
Usage :
core_inventory:server:openInventory
Open the inventory using a server event
To open private inventory no one can access with same trigger add identifier/citizenid to inventory name "cupboard-" .. Player.PlayerData.citizenid
Usage :
Example :
Parameters :
Name
Type
Description
inventoryname
string
inventory name like
'police_storage'
'cupboard-' .. citizenid
inventorytype
string
any inventory type you have in your core inventory config file like :
'content'
'stash'
'big_storage' etc.
Open other player inventory
Can be add to your radial menu, gang script or police job script when you want to search someone
Usage :
Parameters :
Name
Type
Description
playerid
number
server id of the player you want to search
withCloth
boolean
true will open the other player cloth slot if Disable clothing is not set to true in the config
Use the events Client in your character selection script when the character is selected and after skin load or use Clientto load the cloth from player character inventory if the character is already selected
Another is to use a command or export to add item with example metadata shown below.
Load clothing items from cloth holder
Will load the cloth from the holder cloth inventory of the player that are actually played
Usage :
Load clothing items from clothes holder from CHARACTER SELECTION screen
Will load the cloth in character selection. You need to trigger this event in your character selection script, when the player is selected in the list, after the skin is load
Usage :
Example :
Parameters QBCore:
Name
Type
Description
citizenid
string
Character citizenid to load the cloth
pedNumber
number
ped id to apply the cloth skin
Parameters ESX:
Name
Type
Description
charPrefix
string
Prefix of the multi character (most of the time char)
charSlot
number
slot of the player actually selected
identifierType
string
type of identifier use for player identifier (most of the time license or steam)
local clothes = exports.core_inventory:getClothingItemFromPedSkin(PlayerPedId(), false)
-- OR
local clothes = exports.core_inventory:getClothingItemFromPedSkin(PlayerPedId(), true)
-- OR
local clothes = exports.core_inventory:getClothingItemFromPedSkin(1456273, false)
// With default skin and `notIncludeDefaultSkin` to true
[]
// With skin and `notIncludeDefaultSkin` to true
{"accessory":{"mTexture":0,"mModel":1,"mID":7},"torso":{"mTexture":0,"mModel":6,"mID":11},"tshirt":{"mTexture":1,"mModel":10,"mID":8}}
// key = item
// value = metadata
exports.core_inventory:hasItem('water_bottle', 2)
-- OR
exports.core_inventory:hasItem({'water_bottle', 'iron'}, 2)
//Seach for 2 water_bottle
true
//Seach for 2 water_bottle and 2 iron
true
exports.core_inventory:lockInventory()
exports.core_inventory:unlockInventory()
exports.core_inventory:lockCloth()
exports.core_inventory:unlockCloth()
RegisterNetEvent('core_inventory:client:itemAdd', function(itemName, amountAdded)
-- Your code here
end)
RegisterNetEvent('core_inventory:client:itemRemove', function(itemName, amountRemoved)
-- Your code here
end)
RegisterNetEvent('core_inventory:client:handleWeapon', function(weaponName, weaponData, weaponInventoryamountAdded)
-- Your code here
end)
QBCore.TriggerCallback('core_inventory:server:getInventory', function(inventory)
for _, v in pairs(inventory) do
print(v.id)
print(v.name)
print(v.metadata)
end
end)
ESX.TriggerServerCallback('core_inventory:server:getInventory', function(inventory)
for _,v in ipairs(inventory) do
print(v.id)
print(v.name)
print(v.metadata)
end
end)
# QBCore in qb-multicharacter/client/main.lua
# in function `cDataPed` after the first two
# initializePedModel function call
Wait(500)
TriggerServerEvent('core_inventory:server:loadClothingToCharacterSelection', cData.citizenid, charPed)
# ESX in esx_multicharacter/client/main.lua
# in function `` after the first two
# TriggerEvent("skinchanger:loadSkin", skin)
TriggerServerEvent('core_inventory:server:loadClothingToCharacterSelection', Config.Prefix or 'char', index)