Server
You don't need to change functions like AddItem, RemoveItem, GetItemByName or etc in your other scripts, you can use qb's and esx's functions
LoadInventory
Return :
value | type |
---|---|
items | table |
Parameters :
Name | Type | Description |
---|---|---|
src | int | Player source id |
Example
SaveInventory
Parameters :
Name | Type | Description |
---|---|---|
src | int | Player source id |
SetInventory
Parameters :
Name | Type | Description |
---|---|---|
src | int | Player source id |
items | table | Player New Items |
GetItemList
Return :
value | type |
---|---|
Item list | table |
Example
GetItemLabel
Return :
value | type |
---|---|
İtem label | string |
Parameters :
Name | Type | Description |
---|---|---|
item | string | Item spawn name |
Example
GetPlayerItems
Return :
value | type |
---|---|
player items | table |
Parameters :
Name | Type | Description |
---|---|---|
src* | int | Player Source |
Example
GetPlayerClotheItems
Return :
value | type |
---|---|
Player clothe items | table |
Parameters :
Name | Type | Description |
---|---|---|
src* | int | Player Source |
Example
GetTotalWeight
Return :
value | type |
---|---|
weight | int |
Parameters :
Name | Type | Description |
---|---|---|
items* | table | İtem list with amount |
Example
GetFreeWeight
Return :
value | type |
---|---|
Free weight | int |
Parameters :
Name | Type | Description |
---|---|---|
src | int | Player source id |
Example
GetSlotsByItem
A table containing the slots where the item was found.
Return :
value | type |
---|---|
slotsByItems | table |
Parameters :
Name | Type | Description |
---|---|---|
items | table | Table The table containing the items. |
itemName | string | string The name of the item to search for. |
GetFirstSlotByItem
The slot number of the first matching item, or nil if no match is found.
Return :
value | type |
---|---|
SlotNumber | int or nil |
Parameters :
Name | Type | Description |
---|---|---|
items | table | The table of items to search through. |
itemName | string | The name of the item to search for. |
AddItem
Return :
value | type |
---|---|
success | boolen |
Parameters :
Name | Type | Description |
---|---|---|
source* | table | Player source |
item* | string | item spawn name |
amount* | int | the amount of item to add |
slot | int | slot number |
metadata | table | metadata of the item modify |
isClotheSlot | boolen | adds item to clothe slots |
Example
RemoveItem
Return :
value | type |
---|---|
success | boolen |
Parameters :
Name | Type | Description |
---|---|---|
source* | table | Player source |
item* | string | item spawn name |
amount* | int | the amount of item to add |
slot | iny | slot number |
metadata | table | item metadata value |
Example
CloseInventory
CloseInventory function closes the player inventory
Name | Type | Description |
---|---|---|
source | int | Player source |
CanCarryItem / CanAddItem
Return :
value | type |
---|---|
success | boolen |
Parameters :
Name | Type | Description |
---|---|---|
source | int | Player source |
item* | string | item spawn name |
amount* | int | the amount of item to check |
Example
CanCarryItems
Return :
value | type |
---|---|
success | boolen |
Parameters :
Name | Type | Description |
---|---|---|
source | int | Player source |
items* | table | items table |
amount* | int | the amount of item to check |
Example
ClearInventory
Name | Type | Description |
---|---|---|
source | int | Player source |
GetItemByName
Return :
value | type |
---|---|
Player Item | table |
Parameters :
Name | Type | Description |
---|---|---|
source | int | Player source |
item | string | Item spawn name |
metadata | table | Item metadata value |
Example
GetItemsByName
Return :
value | type | |
---|---|---|
Player Items | Table |
Parameters :
Name | Type | Description |
---|---|---|
source | int | Player source |
name | string | Item name |
metadata | table | Item metadata value |
Example
GetItemBySlot
Return :
value | type | |
---|---|---|
Player Items | Table |
Parameters :
Name | Type | Description |
---|---|---|
source | int | Player source |
slot | int | Slot number |
metadata | table | Item metadata value |
Example
GetItemCount
The total count of the specified items.
Return :
value | type | Description |
---|---|---|
count | int | nil | The total count of the specified items. |
Parameters :
Name | Type | Description |
---|---|---|
source | int | The player's source ID. |
items | table | string | The items to count. Can be either a table of item names or a single item name. |
HasItem
Return :
value | type |
---|---|
Player has the item | boolen |
Parameters :
Name | Type | Description |
---|---|---|
src* | int | Player source |
items* | table or string | The items to check, either a string, array of strings or a key-value table of a string and number with the string representing the name of the item and the number representing the amount |
amount | int | The amount of the item to check for, this will only have effect when items is a string or an array of strings |
Example
RepairWeapon
Return :
value | type |
---|---|
Is success | boolen |
Parameters :
Name | Type | Description |
---|---|---|
src* | int | Player source |
slot* | int | Slot number |
value | int | Repair values. Mix: 0, Max 100 |
Example
CreateCustomStashWithItem
Custom creates stash inventory
Return :
value | type |
---|---|
stashUniqId | string |
items | item list |
Parameters :
Name | Type | Description |
---|---|---|
stashUniqId | string | Stash name |
items | table | item list |
Example
GetItemByNameFromSecondInventory
Returns the data of the item in the stash
Return :
value | type |
---|---|
Items | table |
Parameters :
Name | Type | Description |
---|---|---|
invType | string | stash, trunk or glovebox |
invName | string | Inventory name, id or plate |
item | string | Item spawn name |
Example
RemoveItemFromSecondInventory
Delete items from stash
Return :
value | type |
---|---|
success | boolen |
Parameters :
Name | Type | Description |
---|---|---|
invType | string | stash, trunk or glovebox |
invName | string | Inventory name, id or plate |
item | string | item spawn name |
amount | int | the amount of item to add |
slot | int | Slot number |
Example
AddItemFromSecondInventory
Add items from stash
Return :
value | type |
---|---|
success | boolen |
Parameters :
Name | Type | Description |
---|---|---|
invType | string | stash, trunk or glovebox |
invName | string | Inventory name, id or plate |
item | string | item spawn name |
amount | int | the amount of item to add |
slot | int | Slot number |
Example
UpdateItemMetadata / SetItemData
Updates the item's info data
Return : None
Parameters :
Name | Type | Description |
---|---|---|
src* | string | Stash uniq name |
item* | string | item spawn name |
slot* | string | Slot number |
metadata* | table | Item new metadata |
Example
DeleteInventory
deletes all data of the inventory
Return : None
Parameters :
Name | Type | Description |
---|---|---|
invType* | string | trunk, glovebox, stash |
invId* | string | Inventory uniq name or plate |
Example
GiveClotheItem
Return : None
Parameters :
Name | Type | Description |
---|---|---|
src* | int | Player source |
model* | int | Player model (joaat("mp_f_freemode_01") or joaat("mp_m_freemode_01") ) |
itemName* | string | Clothe items |
data* | table | Clothes data |
isClotheSlot | bool | Add the item to the clothing slot |
Example
RegisterShop
Return : None
Parameters :
Name | Type | Description |
---|---|---|
shopName* | string | Uniq shop name |
items* | table | item list |
Example
RegisterCraft
Return : None
Parameters :
Name | Type | Description |
---|---|---|
category* | string | Uniq crafting category |
label* | string | Crafting menu label |
items* | table | item list |
Example
RegisterJobCraft
Return : None
Parameters :
Name | Type | Description |
---|---|---|
jobName* | string | Job name |
label* | string | Crafting menu label |
items* | table | item list |
Example
OpenInventoryById
Opens the inventory of a player by their ID
Parameters :
Name | Type | Description |
---|---|---|
src | int | The player's server ID. |
targetSrc | int | The ID of the player whose inventory will be opened. |
OpenShop
Parameters :
Name | Type | Description |
---|---|---|
src | int | The player's server ID. |
shopName | string | The name of the shop to open. |
s
Last updated