Skip to main content
Grid Inventory

Server items

Read registered item definitions and register new items from server-side resources.

API reference

Item exports

Access or extend the server item registry.

3 exports
GetRegisteredItem(itemName)

Returns one registered item definition.

itemNamestring
ServerItem
GetRegisteredItems()

Returns every registered item definition.

None
ServerItem[]
RegisterItem(name, data)

Registers an item for server-side use.

namestringdataServerItem

Item definition

widthnumber

Item width in the inventory grid.

heightnumber

Item height in the inventory grid.

isStackable?boolean

Allows multiple items to share a stack.

tradable?boolean

Controls whether the item can be traded.

deletable?boolean

Controls whether the item can be deleted.

weight?number

Weight of one item.

formatName?string

Display name of the item.

bagSize?{ x: number; y: number }

Grid size provided when the item is a bag.

propId?number

Associated prop identifier.

clothingId?number

Associated clothing identifier.

droppedModel?string

World model used when the item is dropped.

rarity?string

Item rarity name.

rarityColor?number[]

Color assigned to the rarity.

description?string

Item description.

isBodyArmour?boolean

Marks the item as body armour.

weaponHash?number

Associated weapon hash.

generateSerial?boolean

Enables serial number generation.

isAmmo?boolean

Marks the item as ammunition.

isUsable?boolean

Marks the item as usable. Automatically enabled when onUse is defined.

canPutOnSlotGUID?SlotGuids[]

Lists the compatible equipment slots.

canPutOnSlot?boolean

Allows the item to be placed in a slot.

onUse?function

Runs when the item is used.

onUseDeleteAmount?number

Amount removed when the item is used.

defaultMetaItemMetaData

Default metadata assigned to new entries.

Configuration

Register an item

Register a small backpack with clothing, storage and world-model settings.

exports["avp_grid_inventory"]:RegisterItem("small_backpack", {
height = 2,
width = 2,
weight = 5.0,
bagSize = {
x = 6,
y = 3
},
clothingId = 5,
defaultMeta = {
drawable = 31,
texture = 0
},
formatName = "Small Backpack",
droppedModel = "prop_cs_heist_bag_02",
canPutOnSlotGUID = { "BACKPACK_SLOT" }
})