GenZeeDocs

Inventories

Supported inventories, the phone item for each, and the item keys.

Each phone is bound to the item that spawned it: the item metadata carries the phone number, so a stolen phone keeps its data. Config.Inventory = 'auto' picks the adapter from the started resources; the adapters live in ifold/bridge/inventory/<name>/ and are open.

InventoryConfig.InventoryUnique phonesMetadata
Universal Inventory, Universal Storageuniversalyesmetadata
ox_inventoryoxyesmetadata
qb-inventory, ps-inventory, lj-inventoryqbyesinfo
qs-inventory (Quasar)qsyesinfo
codem-inventory (CodeM)codemyesinfo
core_inventory (C8RE)coreyesmetadata
tgiann-inventorytgiannyesinfo
origen_inventoryorigenyes (best effort)info
mf-inventorymfno: one phone per character
ESX default inventoryesxno: one phone per character
nonenoneno: everyone has a phone

Detection order is Universal Inventory / Storage (they win over an ox_inventory that Qbox servers keep installed after switching), then ox, qs, codem, core, tgiann, origen, mf, then qb-inventory and its forks, then the framework's default. lb-phone's names work in Config.Inventory too ('qs-inventory', 'codem-inventory', 'core_inventory', …), so an lb-phone value can be copied across.

The adapters for the paid inventories are written from each one's public exports documentation and have not run against the inventories themselves: try a phone on a test server first. Each is guarded, so a missing export or a stopped inventory never raises.

Item definitions

The item is called phone by default (Config.Item.name). It must not stack, so every phone keeps its own metadata.

ox_inventory, in ox_inventory/data/items.lua:

['phone'] = {
    label = 'Phone',
    weight = 190,
    stack = false,
    consume = 0,
    client = { export = 'ifold.usePhone' },
},

Universal Inventory / Universal Storage: both ship a phone item already. Keep it non-consumable and open (consume = false, close = false); add any Config.Item.additional names the same way. Ensure the inventory before ifold so auto picks it. It wins over ox_inventory, which Qbox servers keep installed after switching.

phone = { label = 'Phone', weight = 190, stack = false, icon = 'mobile-screen', consume = false, close = false },

qb-inventory, ps-inventory, lj-inventory / Qbox, in qb-core/shared/items.lua (or the qbx_core items file):

phone = { name = 'phone', label = 'Phone', weight = 190, type = 'item', image = 'phone.png', unique = true, useable = true, shouldClose = true, description = 'iFold' },

qs-inventory, in qs-inventory/shared/items.lua. The item is used through qs-inventory's CreateUsableItem:

['phone'] = { name = 'phone', label = 'Phone', weight = 190, type = 'item', image = 'phone.png', unique = true, useable = true, shouldClose = true, description = 'iFold' },

codem-inventory: add the item to codem-inventory's item list or your framework's shared items (codem reads both). It is used through the framework's usable items:

phone = { name = 'phone', label = 'Phone', weight = 190, type = 'item', image = 'phone.png', unique = true, useable = true, shouldClose = true, description = 'iFold' },

core_inventory: in your framework's items (QBCore shared/items.lua, the ESX items table, or C8RE Tools). core_inventory is a grid, so give the item its size and category:

['phone'] = { name = 'phone', label = 'Phone', weight = 190, x = 1, y = 1, category = 'misc', unique = true, useable = true, description = 'iFold' },

tgiann-inventory, in tgiann-inventory's item list:

phone = { name = 'phone', label = 'Phone', weight = 190, unique = true, useable = true, shouldClose = true, description = 'iFold' },

origen_inventory: the qb-inventory item above, in your framework's shared items.

mf-inventory and the ESX default inventory: add a phone item to the items table. Neither has item metadata the phone can use, so iFold runs in non-unique mode (one phone per character).

Item keys

config/config.item.lua defaults to lb-phone's metadata keys, so existing phone items keep working after a switch:

KeyDefaultMeaning
name'phone'The usable item
metadataKey'lbPhoneNumber'Metadata key holding the phone number (the binding)
formattedKey, nameKey'lbFormattedNumber', 'lbPhoneName'Display metadata written when a phone is set up
idKey'ifoldId'Optional metadata key for the iFold phone id
uniquetruefalse: one phone per character identifier regardless of the item (inventories without metadata)
requiretruefalse: no item needed at all
additional{}Extra usable items mapped to a colour variant, e.g. { name = 'phone_white', color = 'star-white' }

Unique and non-unique mode

With metadata every item is its own phone: using a second phone item opens that phone, and losing the item closes it. The server re-verifies ownership periodically and on inventory hooks. Without metadata (SupportsMetadata() returns false, or unique = false) the phone is keyed by the character identifier and any phone item opens it.

Adapter contract

Server Inventory: RegisterUsable(item, fn), HasPhoneItem(src, phoneId, number), GetPhoneItems(src), SupportsMetadata(), BindPhoneItem(src, slot, metadata, matchNumber); optional AddPhoneItem(src, metadata), RemoveItem(src, item, count, slot), OnItemMoved(fn). Client Inventory: HasPhoneItem(), optional OpenInventory(). bridge/inventory/_util/ has the helpers the metadata adapters share (listing phone items from any inventory table, matching by number or id, picking the blank item to stamp, the framework's usable items). Copy bridge/inventory/qs/ to add another inventory and set Config.Inventory to its folder name.

On this page