🖥️Client
EXPORTS
openInventory
Open the player inventory
Usage :
Example :
closeInventory
Close the player inventory
Usage :
Example :
isInventoryOpen
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 or getPlayerItems
Return all items from player content inventory
Usage :
Example :
Return :
search or searchInventory
Return full
/ count
/ slot
/ ids
of the item in the player inventory
Usage :
Example :
Return :
Parameters:
Name | Type | Description |
---|---|---|
searchtype | string |
|
itemsName | string or table | the or all items you want to know the information in player inventory |
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 :
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 :
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 :
Get inventory (callback)
Return all items present in the player inventory (content inventory only)
Usage :
Open inventory
Open the inventory in the ui
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
|
inventorytype | string | any inventory type you have in your core inventory config file like :
|
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 |
GETTING CLOTHING
To know each value for clothing / props refer to https://wiki.rage.mp/index.php?title=Clothes
For now there are 5 ways of getting clothing to your inventory.
Use the events Load cloth items from cloth holder from CHARACTER SELECTION screen in your character selection script when the character is selected and after skin load or use Load cloth items from cloth holder to load the cloth from player character inventory if the character is already selected
Using Core Clothing script.
Modify your clothing store / character creator to give cloth as item with the required metadata explaine in the inventory clothing section of core inventory config file (Use the export addClothingItemFromPedSkinInInventory or addClothingItemFromPedSkinInClothHolder)
Another is to use a command or export to add item with example metadata shown below.
Load cloth items from cloth holder
Will load the cloth from the holder cloth inventory of the player that are actually played
Usage :
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
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 |
charSlot | number | slot of the player actually selected |
identifierType | string | type of identifier use for player identifier (most of the time license or steam) |
ped | number | ped id to apply the cloth skin |
Last updated