Server
Items
AddItem
inv:
string
ornumber
player id or unique inventory identifier
item:
string
item name
amount:
number
amount of the item
slot:
number
(optional)slot value
info:
table
(optional)item metadata table
weight:
number
(optional)change the weight of this item
expiretime:
number
(optional)change expire time of this item
RemoveItem
inv:
string
ornumber
player id or unique inventory identifier
item:
string
item name
amount:
number
amount of the item
slot:
number
(optional)slot value
GetItem
inv:
string
ornumber
item:
string
item name
info?:
table
(optional)strict?:
boolean
(optional)full match or partial match
Return: table
item table with total item amount & properties
CanAddItem
identifier:
string
ornumber
player id or inventory identifier
item
string
item name
amount:
number
skipWeight?:
boolean
(optional)if true then it will not check weight. Only check if there is any slot available
Return: boolean
CanCarryAmount
identifier:
string
ornumber
player id or inventory identifier
item
string
item name
Return: number
CanCarryWeight
identifier:
string
ornumber
player id or inventory identifier
weight:
number
Return: number
SetMaxWeight
identifier:
string
ornumber
player id or inventory identifier
newWeight:
number
CanSwapItem
Returns true if the item swap is possible based on inventory weight.
inv:
string
ornumber
firstItem:
string
firstItemAmount:
number
testItem:
string
testItemAmount:
number
Return: boolean
GetAmount
identifier:
string
ornumber
item:
string
item name
info?:
table
(optional)strict?:
boolean
(optional)full match or partial match
Return: number
GetSlot
identifier:
string
ornumber
slot:
number
Return: table
item table of that slot
GetSlotForItem
identifier:
string
ornumber
itemName:
string
info:
table?
Return: number
slotId
GetSlotIdWithItem
identifier:
string
ornumber
itemName:
string
info?:
table
strict?:
boolean
strictly match info properties, otherwise use partial matching.
Return: number
slotId
GetSlotIdsWithItem
identifier:
string
ornumber
itemName:
string
info?:
table
strict?:
boolean
Strictly match info properties, otherwise use partial matching.
Return: table
slotIds:
GetSlotsWithItem
identifier:
string
ornumber
itemName:
string
info?:
table
strict?:
boolean
Strictly match info properties, otherwise use partial matching.
Return: table
slotsData
GetEmptySlot
identifier:
string
ornumber
Return: number
slotId
GetContainerFromSlot
identifier:
string
ornumber
slotId:
number
Return: table
containerData
SetSlotCount
identifier:
string
ornumber
slots:
number
GetInventory
identifier:
string
ornumber
Return: table
inventoryTable
GetInventoryItems
identifier:
string
ornumber
Return: table
inventoryItemsTable
SetInvItems
identifier:
string
ornumber
items:
table
ConfiscateInventory
identifier:
string
ornumber
ReturnInventory
identifier:
string
ornumber
ClearInventory
identifier:
string
ornumber
ClearClothing
identifier:
string
ornumber
Search
identifier:
string
ornumber
search:
string
item:
table
orstring
info?:
table
orstring
search
can be either 'slots'
or 'count'
, where slots will return a table of data and count will return the found amount of the specified item.
CreateInventory
identifier:
string
data:
table
label:
string
maxWeight:
number
slots:
number
type:
string
backpack, stash, player, shop, trunk, glovebox
type2:
string
ornil
smallBackpack, largeBackpack (only use for backpack)
temp:
boolean
ornil
is this a temporary inventory?
whitelist:
table
ornil
list of whitelisted items or nil
blacklist:
table
ornil
list of blacklisted items or nil
Example:
LoadInventory
load an existing inventory from databse
Return: boolean
Example:
UnloadInventory
identifier:
string
ornumber
SetWhitelistedItemsForContainer
identifier:
string
ornumber
items:
table
Example:
SetBlacklistedItemsForContainer
identifier:
string
ornumber
items:
table
Example:
GetCurrentWeapon
identifier:
string
ornumber
Return: table
currentWeapon
SetQuality
identifier:
string
ornumber
slot:
number
quality:
number
SetItemInfo
identifier:
string
ornumber
slot:
number
info:
table
RemoveQuality
identifier:
string
ornumber
slot:
number
value:
number
SaveInventory
identifier:
string
ornumber
DeleteInventory
identifier:
string
ornumber
SaveAllInventory
Last updated