π§¬API
Integrate this awsome inventory with more of your scripts
π EXPORTS
Use these exports in server side from other scripts :
Open primary or secondary holder
Return :
open the UI with the holder or preload the holder data if open = false
Parameters :
Name | Type | Description |
---|---|---|
source | number | server id of the player |
inventoryname | string | inventory name like |
inventorytype | string | inventory type like |
x | number | position in pixel on the screen horizontally |
y | number | position in pixel on the screen vertically |
open | boolean | define if the holder should be open (display) or just preopen (load) |
content | table | the default content of the holder (return the content of the holder if it already exist) |
Open inventory
Return :
Open the UI with the inventory or preload the inventory data if open = false
Parameters :
Name | Type | Description |
---|---|---|
source | number | server id of the player |
inventoryname | string | inventory name like :
|
inventorytype | string | inventory type like |
x | number | position in pixel on the screen horizontally |
y | number | position in pixel on the screen vertically |
open | boolean | define if the inventory should be open (display) or just preopen (load) |
content | table | the default content of the inventory (return the content of the inventory if it already exist) |
Get inventory data
Return :
The inventory data in a table
Parameters :
Name | Type | Description |
---|---|---|
inventory | string | inventory name like :
|
Add item
If you want to add an item in an inventory never open / load, add the inventory type as last parameter, so the inventory will be load and the item will be add in the inventory.
Return :
A table with all the items add with their values
Parameters :
Name | Type | Description |
---|---|---|
inventory | string | inventory name like :
|
item | string | the item name you want to add |
amount | number | the amount of item to remove |
metadata | table | metadata of the item modify |
inventoryType | string | inventory type like |
Remove item
Parameters :
Name | Type | Description |
---|---|---|
inventory | string | inventory name like :
|
itemId | string | The item id, not the item name like |
amount | number | the amount of item to remove |
Remove item durability
Parameters :
Name | Type | Description |
---|---|---|
inventory | string | inventory name where item is located like :
|
itemId | string | The item id, not the item name like |
amount | number | The durability to remove from the item. make sure that you the amount is not greater than the remaining durability |
Set item durability
Parameters :
Name | Type | Description |
---|---|---|
inventory | string | inventory name where item is located like :
|
itemId | string | The item id, not the item name like |
amount | number | The durability set to the item. Can't be greater than 100 |
Update item metadata
Parameters :
Name | Type | Description |
---|---|---|
inventory | string | inventory name where item is located like :
|
itemId | number | The item id, not the item name like |
metadata | table | metadata of the item modify |
Open a "Loot inventory" with change of getting item in it
Loot inventory is a temporary inventory that can be triggered to reward the player with an item.
Return :
open the UI with the generated loot inventory with the item in it
Parameters :
Name | Type | Description |
---|---|---|
source | number | server id of the player |
inventorytype | string | any inventory type you have in your core inventory config file like :
|
loottable | table | a table like :
|
minItems | number | minimum item add in the inventory if the player have chance to earn it |
maxItems | number | maximum item add to the inventory if the player have chance to earn it |
Get item in a specific inventory (minimal)
Return :
Returns item quantity and general information but only returns one items metadata
Parameters :
Name | Type | Description |
---|---|---|
inventory | string | inventory name where item is located like :
|
itemName | string | name of the item you want to retrieve |
Get Item in a specific inventory (full)
Return :
Retuns every item (or stack) with their own specific metadata in a tablehea
Parameters :
Name | Type | Description |
---|---|---|
inventory | string | inventory name where item is located like :
|
itemName | string | name of the item you want to retrieve |
πGET INVENTORY CLIENT SIDE
Use callback in client side from other scripts
π GETTING CLOTHING
To know each value for clothing / props refer to https://wiki.rage.mp/index.php?title=Clothes
For now there are 2 ways of getting clothing to your inventory. The first one is using Core Clothing script. Another is to use a command or export to add item with example metadata shown below.
𧬠DYNAMIC ITEMS
Items that are not registered in items.lua or in items table. They can be added with a trigger where you define label, category, x, y, description... in itemData field
βΎοΈ OPEN ANY INVENTORY
Opening an inventory is super easy and can be done for anything.
Make sure inventory type exists in config
To open private inventory no one can access with same trigger add identifier/citizenid to inventory name "cupboard-" .. Player.PlayerData.citizenid
Parameters :
Name | Type | Description |
---|---|---|
inventoryname | string | inventory name like
|
inventorytype | string | any inventory type you have in your core inventory config file like :
|
π₯ OPEN PLAYER INVENTORY
Can be added to your radial menu or any other script you use works by default with qb-core
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 |
Last updated