// 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
Parameters:
addClothingItemFromPedSkinInInventory
Will add all the cloth from the skin player to his inventory.
//Full with one item{"ids": ["water_bottle-17273686944580" ],"slots": [0 ],"count":2,"amount":2}//Count with two items{"water_bottle":2,"iron":5}//Slot with one item (slot 12){ 12}//ids with two items{"iron": ["iron-172737995891080","iron-172737995899375","iron-172737995297872" ],"water_bottle": ["water_bottle-17273686944580" ]}
//Seach for 2 water_bottletrue//Seach for 2 water_bottle and 2 irontrue
Parameters:
lockInventory
Lock the inventory, it can be open or close by the player. Use unlockInventory to unlock it
Usage :
exports.core_inventory:lockInventory()
unlockInventory
Unlock player inventory (can open / close it again)
Usage :
exports.core_inventory:unlockInventory()
lockClothLock
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 :
exports.core_inventory:lockCloth()unlockCloth
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 :
exports.core_inventory:unlockCloth()
EVENTS
core_inventory:client:itemAdd
This event is send to the client every time player receive an item
Usage :
RegisterNetEvent('core_inventory:client:itemAdd', function(itemName,amountAdded)-- Your code hereend)
core_inventory:client:itemRemove
This event is send to the client every time player receive an item
Usage :
RegisterNetEvent('core_inventory:client:itemRemove', function(itemName,amountRemoved)-- Your code hereend)
core_inventory:client:handleWeapon
This event is send to the client every time player receive an item
Usage :
RegisterNetEvent('core_inventory:client:handleWeapon', function(weaponName,weaponData,weaponInventoryamountAdded)-- Your code hereend)
Get inventory (callback)
Return all items present in the player inventory (content inventory only)
Usage :
QBCore.TriggerCallback('core_inventory:server:getInventory', function(inventory)for _, v inpairs(inventory) doprint(v.id)print(v.name)print(v.metadata)endend)
Load cloth items from cloth 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