Items
On this page6
Five items. Paste-ready definitions ship in the install/items/ folder of the zip,
and the images in install/images/.
| Item name | Label | What it does | Stacks |
|---|---|---|---|
voice_changer | Voice Changer | Disguises the wearer's voice so a scan records a fake one. Runs on a battery. | no |
hidden_camera | Hidden Camera | Records a scan: faster, longer-lasting memory. The recording can be printed as a paper from the F3 menu (Camera recordings). | no |
magnetic_scanner | Magnetic Scanner | Hand wand that beeps near hidden electronics on people around you. | no |
recognition_battery | Device Battery | Recharges a voice changer or a hidden camera. | yes |
recognition_report | Report | A printed camera report, witness statement or description. | no |
Renamed one? Change it in both places: the item definition and
Config.Items in config.lua.
Config.Items = {
VoiceChanger = 'voice_changer',
HiddenCamera = 'hidden_camera',
MagneticScanner = 'magnetic_scanner',
Battery = 'recognition_battery',
Report = 'recognition_report',
}ox_inventory
Paste into ox_inventory/data/items.lua, then copy install/images/*.png into
ox_inventory/web/images/.
['voice_changer'] = {
label = 'Voice Changer',
weight = 150,
stack = false,
close = true,
description = 'Small throat device that disguises your voice. Use it to switch it on or off. Runs on a battery.',
},
['hidden_camera'] = {
label = 'Hidden Camera',
weight = 50,
stack = false,
close = true,
description = 'Button-sized camera worn on your clothes. Use it to switch it on or off.',
},
['magnetic_scanner'] = {
label = 'Magnetic Scanner',
weight = 400,
stack = false,
close = true,
description = 'Hand-held wand that beeps near hidden electronics. Use it close to a person.',
},
['recognition_battery'] = {
label = 'Device Battery',
weight = 50,
stack = true,
close = true,
description = 'Recharges a voice changer or a hidden camera.',
},
['recognition_report'] = {
label = 'Report',
weight = 10,
stack = false,
close = true,
description = 'A printed report. Use it to read it.',
},Which "use" path?
ox_inventory calls your framework's usable-item callback only for items that have no consume value of their own. Pick exactly one path — doing both silently loses one of them.
ESX / QBCore / Qbox
The entries above are complete. Add nothing. The script registers all five items through your framework itself.
Add the server.export lines anyway and the boot warns you:
ox_inventory item 'voice_changer' carries server.export = ... while esx is running.
ox then never calls the framework callback, so the framework registration is SKIPPED.ox_core / standalone / custom
There is no framework callback, so the item has to call us. Add these two lines to each of the five entries:
consume = 0, -- we remove batteries ourselves
server = { export = '5code-recognition.useItem' },consume = 0 matters: without it ox removes one of the item on every use, so a
voice changer disappears the first time it is switched on. The boot warns when it is
missing.
qb-core (qb-inventory v2, ps-inventory, lj-inventory)
Paste inside QBShared.Items in qb-core/shared/items.lua, then copy
install/images/*.png into your inventory's image folder.
['voice_changer'] = {
name = 'voice_changer', label = 'Voice Changer', weight = 150, type = 'item',
image = 'voice_changer.png', unique = true, useable = true, shouldClose = true,
combinable = nil,
description = 'Small throat device that disguises your voice. Use it to switch it on or off. Runs on a battery.',
},
['hidden_camera'] = {
name = 'hidden_camera', label = 'Hidden Camera', weight = 50, type = 'item',
image = 'hidden_camera.png', unique = true, useable = true, shouldClose = true,
combinable = nil,
description = 'Button-sized camera worn on your clothes. Use it to switch it on or off.',
},
['magnetic_scanner'] = {
name = 'magnetic_scanner', label = 'Magnetic Scanner', weight = 400, type = 'item',
image = 'magnetic_scanner.png', unique = true, useable = true, shouldClose = true,
combinable = nil,
description = 'Hand-held wand that beeps near hidden electronics. Use it close to a person.',
},
['recognition_battery'] = {
name = 'recognition_battery', label = 'Device Battery', weight = 50, type = 'item',
image = 'recognition_battery.png', unique = false, useable = true, shouldClose = true,
combinable = nil,
description = 'Recharges a voice changer or a hidden camera.',
},
['recognition_report'] = {
name = 'recognition_report', label = 'Report', weight = 10, type = 'item',
image = 'recognition_report.png', unique = true, useable = true, shouldClose = true,
combinable = nil,
description = 'A printed report. Use it to read it.',
},unique = true matters on the three devices and the paper: each one carries its own
serial or report id and must never stack. Nothing else is needed — the script
registers all five as usable items itself.
qs-inventory, ESX, other inventories
install/items/qs-inventory.md— Quasar.install/items/esx.sql— the ESX default inventory (itemstable).install/items/other-inventories.md— jaksam, tgiann, ak47 (+ QB build), origen, codem, core_inventory, and what to check on each.
The shape is always the same: five items, four of them unique, one stackable, plus the five PNGs.
Standalone — no inventory at all
With Config.InventorySystem = 'standalone' (or no inventory resource running) the
script keeps the items itself and says so at boot:
[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. |
Admins hand items out with /recognition:giveitem <id> <item> [count].
Metadata the script writes
Never pre-fill any of this in your item definition — the script owns it.
| Key | On | Meaning |
|---|---|---|
serial | the three devices | VC- / HC- / MS- plus 9 characters: the device row behind this item. |
battery | voice changer, hidden camera | 0–100 %, a display copy only. The script keeps the real value itself. |
preset | voice changer | Which audible preset the device uses. |
report_id | recognition_report | RC- / WS- / DS- plus 9 characters: the report row behind this paper. |
kind | recognition_report | camera, statement or description. |
title, description | all | The tooltip lines the script keeps current. |
durability | ox only | The battery %, drawn as a bar. |
info.display = false | qb only | Hides the raw keys in qb-inventory v2's tooltip. |
recognition_battery carries no metadata at all — that is why it is the only one
that stacks.
Using items from your own resource
If your server registers usable items itself, register each item only once
(registering twice means the second one wins and ours is lost), put the code in
your resource, and add your resource name to
ServerConfig.Api.TrustedResources in config_server.lua. Otherwise the call is
refused and logged.
local RECOG_ITEMS = {
'voice_changer', 'hidden_camera', 'magnetic_scanner',
'recognition_battery', 'recognition_report',
}
CreateThread(function()
local QBCore = exports['qb-core']:GetCoreObject()
for i = 1, #RECOG_ITEMS do
local item = RECOG_ITEMS[i]
QBCore.Functions.CreateUseableItem(item, function(source, itemData)
exports['5code-recognition']:TriggerItemUse(source, item, itemData)
end)
end
end)