Server
Items
exports['ak47_inventory']:Items()exports['ak47_inventory']:Items('water')AddItem
exports['ak47_inventory']:AddItem(inv, item, amount, slot, info, weight, expiretime)inv:
stringornumberplayer id or unique inventory identifier
item:
stringitem name
amount:
numberamount 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:
stringornumberplayer id or unique inventory identifier
item:
stringitem name
amount:
numberamount of the item
slot:
number(optional)slot value
GetItem
inv:
stringornumberitem:
stringitem name
info?:
table(optional)strict?:
boolean(optional)full match or partial match
Return: table
item table with total item amount & properties
GetFirstItem
inv:
stringornumberitem:
stringitem name
Return: table
first item table with total item amount & properties
CanAddItem
identifier:
stringornumberplayer id or inventory identifier
item
stringitem name
amount:
numberskipWeight?:
boolean(optional)if true then it will not check weight. Only check if there is any slot available
Return: boolean
CanCarryAmount
identifier:
stringornumberplayer id or inventory identifier
item
stringitem name
Return: number
CanCarryWeight
identifier:
stringornumberplayer id or inventory identifier
weight:
number
Return: boolean, number
canHold
availableWeight
SetMaxWeight
identifier:
stringornumberplayer id or inventory identifier
newWeight:
number
CanSwapItem
Returns true if the item swap is possible based on inventory weight.
inv:
stringornumberfirstItem:
stringfirstItemAmount:
numbertestItem:
stringtestItemAmount:
number
Return: boolean
GetAmount
identifier:
stringornumberitem:
stringitem name
info?:
table(optional)strict?:
boolean(optional)full match or partial match
Return: number
GetSlot
identifier:
stringornumberslot:
number
Return: table
item table of that slot
GetSlotForItem
identifier:
stringornumberitemName:
stringinfo:
table?
Return: number
slotId
GetSlotIdWithItem
identifier:
stringornumberitemName:
stringinfo?:
tablestrict?:
booleanstrictly match info properties, otherwise use partial matching.
Return: number
slotId
GetSlotIdsWithItem
identifier:
stringornumberitemName:
stringinfo?:
tablestrict?:
booleanStrictly match info properties, otherwise use partial matching.
Return: table
slotIds:
GetSlotsWithItem
identifier:
stringornumberitemName:
stringinfo?:
tablestrict?:
booleanStrictly match info properties, otherwise use partial matching.
Return: table
slotsData
GetEmptySlot
identifier:
stringornumber
Return: number
slotId
GetContainerFromSlot
identifier:
stringornumberslotId:
number
Return: table
containerData
SetSlotCount
identifier:
stringornumberslots:
number
GetInventory
identifier:
stringornumber
Return: table
inventoryTable
GetInventoryItems
identifier:
stringornumber
Return: table
inventoryItemsTable
SetInvItems
identifier:
stringornumberitems:
table
ConfiscateInventory
identifier:
stringornumber
ReturnInventory
identifier:
stringornumber
ClearInventory
identifier:
stringornumber
ClearClothing
identifier:
stringornumber
Search
identifier:
stringornumbersearch:
stringitem:
tableorstringinfo?:
tableorstring
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:
stringdata:
tablelabel:
stringmaxWeight:
numberslots:
numbertype:
stringbackpack, stash, player, shop, trunk, glovebox
type2:
stringornilsmallBackpack, largeBackpack (only use for backpack)
temp:
booleanornilis this a temporary inventory?
whitelist:
tableornillist of whitelisted items or nil
blacklist:
tableornillist of blacklisted items or nil
Example:
LoadInventory
load an existing inventory from databse
Return: boolean
Example:
UnloadInventory
identifier:
stringornumber
SetWhitelistedItemsForContainer
identifier:
stringornumberitems:
table
Example:
SetBlacklistedItemsForContainer
identifier:
stringornumberitems:
table
Example:
GetCurrentWeapon
identifier:
stringornumber
Return: table
currentWeapon
SetQuality
identifier:
stringornumberslot:
numberquality:
number
SetItemInfo
identifier:
stringornumberslot:
numberinfo:
table
RemoveQuality
identifier:
stringornumberslot:
numbervalue:
number
SaveInventory
identifier:
stringornumber
DeleteInventory
identifier:
stringornumber
SaveAllInventory
OnChangeVehiclePlate
oldPlate:
stringnewPlate:
string
Last updated