Inventories
On this page10
Config.InventorySystem = 'auto'The inventory carries the five items and, where it can, their metadata — the device serial, the battery level, the report id. Where it cannot, the script keeps that identity in its own table and the item is just a token.
Item definitions to paste: Items.
Support and auto order
| System | Support | Auto order | Metadata | Usable-item registration |
|---|---|---|---|---|
| ox_inventory | Supported | 1 | yes | framework, or server.export on ox_core / standalone |
| qs-inventory | Supported | 2 | yes | its own CreateUsableItem |
| jaksam_inventory | Supported | 3 | yes | its own registerUsableItem |
| tgiann-inventory | Supported | 4 | yes | framework |
| ak47_qb_inventory | Supported | 5 | yes | framework |
| ak47_inventory | Supported | 6 | yes | framework |
| origen_inventory | Supported | 7 | yes | framework |
| codem-inventory | Supported | 8 | yes | framework |
| core_inventory | Supported | 9 | yes | framework |
| ps-inventory | Stub | 10 | through qb-core | QBCore.Functions.CreateUseableItem |
| lj-inventory | Stub | 11 | through qb-core | QBCore.Functions.CreateUseableItem |
| qb-inventory v2 | Supported | 12 | yes | QBCore.Functions.CreateUseableItem |
| ESX default | Supported | 13 | no → our database fallback | ESX.RegisterUsableItem |
| standalone (none) | Supported | 14 | virtual items | /recognition:use |
qb-inventory is only picked on qb-core, never on Qbox — Qbox runs ox_inventory.
ox_inventory
The most complete integration. Devices carry their serial, battery and preset; papers carry their report id; the battery shows as a durability bar.
Which "use" path
ox calls your framework's usable-item callback only for items with no consume
value of their own. Giving an item a server.export switches it to the export path
and the framework callback is never called again. Pick one:
| Your setup | What to do |
|---|---|
| ESX, QBCore, Qbox | Nothing. We register the items through the framework. |
| ox_core, standalone, custom framework | Add consume = 0 and server = { export = '5code-recognition.useItem' } to each of the five items. |
The durability bar
Config.Battery.ShowAsDurability = true (the default) draws the battery as ox's
durability bar. ox then refuses to use an item at 0 % and shows no_durability —
which is intended: a flat device is recharged with a separate battery item, not by
using the dead device. Set it to false to drop both.
Our useItem export
5code-recognition.useItem is not open to everyone. Only ox_inventory itself and the
resources listed in ServerConfig.Api.TrustedResources are accepted. Anything else
is refused, with a warning in the server console naming the resource.
qb-inventory v2, ps-inventory, lj-inventory
Metadata lives in the item's info table. The bridge writes it with
SetItemData(source, itemName, 'info', info, slot), and it sets info.display = false
on every write.
Register usable items once. We do it ourselves; if your server also registers them, the second registration wins and ours is lost. Pick one side.
qs-inventory
Metadata through SetItemMetadata(src, slot, md), usable items through its own
CreateUsableItem.
jaksam, tgiann, ak47, origen, codem, core_inventory
All support metadata, each with its own call:
| Inventory | Metadata write |
|---|---|
| jaksam_inventory | setItemMetadataInSlot(src, slot, md) |
| tgiann-inventory | UpdateItemMetadata(src, item, slot, md) |
| ak47_inventory / ak47_qb_inventory | SetItemInfo(src, slot, info) |
| origen_inventory | setMetadata(src, slot, md) |
| codem-inventory | SetItemMetadata(src, slot, md) |
| core_inventory | updateMetadata(inv, slot, md) |
ESX default inventory
No item metadata at all. The script falls back to its own tables:
- Device identity lives in
recognition_devices(serial, owner, battery, preset). - Paper identity lives in
recognition_reports.
The item in the inventory is a plain token. To move a device or a paper to another player, use:
/recognition:handover <item>within Config.Report.GiveDistance (2.5 m by default) of the person in front of you.
Standalone — no inventory
With Config.InventorySystem = 'standalone', or no inventory resource at all, the
script keeps the items itself in recognition_items:
[5code-recognition] standalone: items are kept by the script (use /recognition:use).| Command | What it does |
|---|---|
/recognition:items | List what your character carries. |
/recognition:use <item> | Use one. |
/recognition:handover <item> | Hand a device to the person in front of you. |
/recognition:giveitem <id> <item> [count] | Admin (edit level): hand one out. |
Two server exports do the same from your own code, for trusted resources:
GiveItem and TriggerItemUse.
Missing item definitions
[5code-recognition] Missing item definitions: voice_changer, hidden_camera. See docs: Getting Started > Items.The rest of the script keeps working. Only those devices cannot be handed out.
Renaming an item
Change it in both places — your inventory's item list and Config.Items —
and rename the image to match.
Config.Items = {
VoiceChanger = 'voice_changer',
HiddenCamera = 'hidden_camera',
MagneticScanner = 'magnetic_scanner',
Battery = 'recognition_battery',
Report = 'recognition_report',
}Custom
Set Config.InventorySystem = 'custom' and fill the 'custom' branch in
bridge/inventory.lua. The core needs: does the player have this item, add one,
remove one, read and write metadata for a slot, and register a usable item.