- Documentation
- 06Game
Weapon registryGame
Every weapon bought or given in game with a serial number creates its record in SuperMDT: supported inventories, limits and custom scripts.
With the automatic weapon registry, every weapon that lands in a character’s inventory in game with a serial number creates or updates its record in the Weapons module: serial, model, owner. Your officers find the owner of a seized weapon without anyone typing anything.
Turn it on
Section titled “Turn it on”- Check that your inventory is in the compatibility table.
- In Settings › Game › Integrations, turn on Automatic weapon registry.
- Under the switch, SuperMDT shows what the bridge detected (“Uses ox_inventory”, for
example). If nothing shows, type
supermdt helloin the server console.
Reserved for organization administrators and ranks with Delegated administration › Set up
the game. Server side, the integration can still be turned
off in config.lua (Config.Integrations.weapons.enabled = false).
What arrives in SuperMDT
Section titled “What arrives in SuperMDT”- One record per serial number, never a duplicate, with the Game badge.
- The model and owner follow the game, read-only in the MDT. The status (stolen, seized…), photo, notes and custom fields stay the MDT’s.
- A record already entered in the MDT with the same serial is completed (model, owner); its other fields don’t move.
- An archived record is never recreated.
- Every creation or update is written to the audit log (“imported from the game the weapon”, “updated from the game the weapon”).
- A serial is sent only once: the bridge remembers it (resource storage). A weapon given back then taken again, or a serial copied by a script, never changes a record’s owner.
Weapons that existed before the integration was turned on aren’t imported with a real-time inventory (ox_inventory, qb-inventory 2.2 and later); they are with inventories read by rescan (see the “Mode” column).
If the game integration is later turned off, a rank with Weapons › Detach from the game (command by default) or an administrator can Detach from the game a record: it becomes fully editable (see Vehicles and weapons).
Compatibility
Section titled “Compatibility”- Tested in game tried in game on a real server.
- Verified in code written from the script’s source code or native API, and covered by the bridge’s tests, but not tried in game yet.
- Experimental written from the publisher’s public documentation,
never tried. Check it before relying on it; SuperMDT and
supermdt statusflag it. - Not supported detected and reported, but nothing is imported.
Real time: the weapon arrives a few seconds after it’s bought. Rescan: the bridge re-reads connected players’ inventories, when the character joins then every 15 minutes; the weapon is tied to the first character it is seen on.
| Framework | Inventory | Status | Mode | Good to know |
|---|---|---|---|---|
| ESX, QBCore, Qbox | ox_inventory | Verified in code | Real time | Serial metadata.serial. Purchase, gift (AddItem, /giveitem), crafting. The weapon is checked in the inventory 3 s later (refused purchase: nothing). |
| QBCore | qb-inventory 2.2 and later | Tested in game | Real time | Serial info.serie, given by qb-inventory to every weapon. |
| QBCore | qb-inventory before 2.2 | Tested in game | Rescan | No add listener in these versions. |
| QBCore | ps-inventory | Experimental | Rescan | Serial info.serie; based on the code of version 1.1.0 (archived repository). |
| ESX, QBCore, Qbox | qs-inventory (Quasar) | Experimental | Rescan | Serial info.serie; adding a weapon brings the player’s rescan forward. |
| ESX, QBCore | codem-inventory | Experimental | Rescan | Serial metadata.serial; a weapon without it isn’t registered. |
| ESX, QBCore | tgiann-inventory | Experimental | Rescan | Serial serie. |
| ESX, QBCore, Qbox | core_inventory (C8RE) | Experimental | Rescan | Serial metadata.serial. |
| ESX | Base ESX inventory (loadout) | Not supported | — | ESX weapons have no serial number. ox_inventory is required. SuperMDT says so under the switch. |
If several inventories are started, the bridge uses only one, and Settings › Game says which.
What doesn’t work
Section titled “What doesn’t work”- Weapons without a serial number: items without ammo, weapons created without a serial
(
registered = falsein ox_inventory…). Nothing is created. - Transfers between players: the owner stays the first one (the buyer). An ownership change is made in the MDT.
- Weapons created in a stash or vehicle, and internal moves (stash, ground, search): not followed.
- Service weapons: to skip them, list their serial prefix in
Config.Integrations.weapons.skipSerialPrefixes(for example{ 'POL' }for ox_inventory’s police armory). A text of 3 characters or fewer is also recognized in the middle of the serial, where ox_inventory puts it (482913POL105377).
Is your script custom?
Section titled “Is your script custom?”The registry reads the inventory, not the shop. A custom gun store or crafting script therefore works if it creates the weapon through the supported inventory:
| Your script… | Result |
|---|---|
calls exports.ox_inventory:AddItem (or qb-inventory’s AddItem) |
The weapon is registered, with the serial given by the inventory. |
| creates the weapon in a rescanned inventory, with the expected serial field | It’s registered at the next rescan. |
| writes straight to the database, or uses an inventory outside the table | Nothing is registered. |
| gives weapons without a serial number | Nothing is registered. |
Bridge settings
Section titled “Bridge settings”In config.lua, Config.Integrations.weapons:
| Setting | Role | Default |
|---|---|---|
enabled |
The integration on the game server side (false: off, whatever SuperMDT says) | on |
skipSerialPrefixes |
Serial prefixes to ignore | none |
verifyDelayMs |
Delay before checking the weapon in the inventory | 3,000 ms |
scanMinutes |
Inventory rescan (rescanned inventories) | 15 min |
scanIntervalMs |
One player read at most every… | 2,000 ms |
Troubleshooting
Section titled “Troubleshooting”A bought weapon doesn’t show? Type supermdt status (“Weapons” line) and supermdt log.
The usual causes: integration off, weapon without a serial, ignored prefix, refused
purchase, unsupported inventory, or rescanned inventory (wait for the next rescan, or
supermdt resync to rescan connected players’ inventories right away). The “Weapons” line of
supermdt status counts weapons seen, sent and skipped, and says whether the inventory is
read by rescan.