Bridges & integrations ​
np_metal-scanner talks to the framework and the inventory through bridges in bridge/, and to every np_* sibling
through one adapter file each in integrations/{server,client}/. Each call into another resource is wrapped (pcall),
so a missing resource or export degrades a feature instead of breaking a handler, and a sibling that fails never breaks
scanning. A payment that was debited and then errored is never retried through a second provider.
Framework ​
| Bridge | Resource | Identifier | Admin groups (Config.AdminGroups) |
Weapons |
|---|---|---|---|---|
esx |
es_extended | xPlayer.identifier |
xPlayer.getGroup(): admin, superadmin |
The ESX loadout (getLoadout, removeWeapon, addWeapon, addWeaponComponent), read server-side, so a holstered loadout pistol cannot be hidden by the client |
qbx |
qbx_core | citizenid | HasPermission: admin, god |
The ped (RemoveWeaponFromPed, GiveWeaponToPed) and the client report |
qb |
qb-core | citizenid | HasPermission: admin, god |
The same as qbx |
standalone |
none | license, or a character id from the npCharacter state bag |
none (Config.Admins only) |
The ped |
Auto-detection order (Config.Framework = 'auto'): es_extended → qbx_core → qb-core → standalone. es_extended is the
first target. Standalone has no economy: locker fees are free and shift pay is not paid. Jobs come from
Config.StandaloneJobs (identifier or character id) or from a job player state bag. On ESX duty is job.onDuty
(ESX 1.10 and newer; older versions count as always on duty).
A job spec in the config is a Config.Jobs group name, a job name, a list of either, { { job, grade } },
{ { group, grade } } or { job = minGrade }.
Inventory ​
| Bridge | Resource | Metadata | Stashes | Notes |
|---|---|---|---|---|
np |
np_inventory | yes | yes (and temporary stashes) | Items registered at runtime, evidence inventories, the divest tray in a temporary stash, the drawn weapon item de-duplicated against the ped's weapon |
ox |
ox_inventory | yes | yes (and temporary stashes) | Add the items; evidence is a stash |
qb |
qb-inventory (and ps / lj) | yes | no temporary stashes | Add the items; the drawn weapon is read from the ped |
esx |
the ESX inventory | no | no | Lockers and evidence keep a list; no serials or carry spots |
none |
none | – | – | Only GTA weapons and body metal are read |
Auto-detection order (Config.Inventory = 'auto'): np_inventory → ox_inventory → qb-inventory → ESX → none. All code uses
one API (NpScanner.Inv) on top of the bridge. See Items.
np_* siblings ​
Every sibling is optional and auto-detected, except np_npchandler and np_prophandler, which are required
and called directly (no adapter, no fallback). Each adapter declares the exports it uses. At start, and whenever a
sibling starts or stops, the console prints one line per sibling: active, fallback (…) or missing export <name>.
Config.Integrations.<resource> = false forces the fallback. A test (tests/test_integrations.lua) reads the sibling
repositories next to np_metal-scanner and fails when a declared export no longer exists in their source.
| Sibling | Used for | Exports | Without it |
|---|---|---|---|
| np_admin | Permission nodes, Resource settings, the audit log, the server theme, staff actions | the vendored lib | Console, np_admin_fallback, ESX admin groups, Config.AdminGroups, Config.Admins; the Discord webhook for the log |
| np_inventory | Items, metadata, stashes, evidence, runtime item registration; client: busy flag and metadata labels | AddItem, RemoveItem, CanCarryItem, GetItemCount, GetSlot, SetMetadata, GetInventoryItems, Items, RegisterItem; optional OpenInventory, CloseInventory, RegisterStash, CreateTemporaryStash, GetCurrentWeapon; client setBusy, displayMetadata |
The ox / qb / ESX bridge |
| np_hud | Toasts (with the consent call toast), prompts, progress | server Notify, NotifyAll; client Notify, Progress, CancelProgress, ShowPrompt, HidePrompt; optional Announce, ClaimZones, IsProgressActive |
Own NUI toasts, prompts and progress bars |
| ox_target / qb-target | Zones, player and prop options | addSphereZone, addGlobalPlayer, addModel… / AddCircleZone… |
The built-in key prompt (E) |
| np_identification | Permits, ID cards, license points | hasValidDocument; optional getDocuments, addPoints |
Permits denied unless Config.Permits.fallbackAllowed |
| np_phone | The Checkpoint and Permits apps, Dynamic Island, banners, badge | registerStoreApp, registerAppRpc, sendAppMessage, notify; optional setIsland, clearIsland, setBadge, openApp, unregisterStoreApp |
The game NUI and toasts |
| np_discord | The metalscanner log channel |
Log |
The webhook of Config.Log.webhookConvar |
| np_payments | Locker fees, fines | Charge, Invoice; optional Refund |
Framework money; no invoices |
| np_banking | Shift wages, the masked card list | GetSocietyAccount, GetPersonalAccount, Transfer; optional CreditCitizen, GetCards |
Framework bank money |
| np_prison | Closing sessions of jailed players, visitation gating | IsJailed, GetAlertLevel |
No gate veto |
| np_passwords | Hackable gates and poles | RegisterLock, RemoveLock, IsUnlocked |
Gates cannot be hacked |
| np_menu | Context options and the radial Security | addContextOption, removeContextOption; optional addRadial, removeRadial, setRadialContext |
Target resources or key prompts |
| np_shops | The Security Supply shop | RegisterShop, RemoveShop |
Paste the inventory shop snippet yourself |
| np_drugs | Organic items stay non-metallic; witness dispatch | GetSubstances; optional Dispatch |
The gate toasts on-duty police itself |
| np_clothing | Worn pieces as body metal | getOutfit |
No clothing metal |
| np_gangs | Police attention for the turf of a seizure | GetTurfAt, AddPoliceAttention |
Nothing |
| np_tattoos | Distinguishing marks in the watchlist | getDistinguishingMarks |
Nothing |
| np_character | The active character and its real name | getActiveCharacter, getCharacter |
Framework name and identifier |
| np_crouch-crawl-shoot | Blocks stances while scanning | client BlockStance, UnblockStance |
Normal stances |
| np_screens | A Screened tonight board per venue | SetBoardContent |
No board |
| np_environmental | More ground finds near a storm-debris scene | GetScenes; optional RegisterTemplate |
Normal weights |
Not used, and why. np_net is a network metrics resource, not a hacking tool (gate hacking uses np_passwords).
np_manufacturing is vehicle liveries, not crafting (recipes are np_inventory's Config.Crafting, see install/).
np_helicam has a BOLO facade (Siblings.helicam.enabled) that nothing calls: watchlist entries carry people, not
plates, and a plate BOLO stays an explicit staff decision. cd_dispatch, ps-dispatch and qs-dispatch are not called
directly; listen to np_metal-scanner:alarm.
np_admin in detail ​
- Nodes and settings.
bridge/np_admin.luais the np_admin lib, byte-identical tonp_admin/lib/np_admin.lua.shared/np_admin_settings.luaregisters the settings and the five permission nodes; every config file is also listed withnp_admin_configinfxmanifest.luaso np_admin shows the settings while np_metal-scanner is stopped. - Audit log. Every decision goes to
scanner_logand, with np_admin, to its audit log undernp_metal-scanner. Placement actions are logged throughnpAdmin.log. - Staff actions. Place scanners and Configure venues (both open placement mode).
- Theme. The server theme of np_admin (brand colour, tile strength, Liquid Glass) is sent to the NUI at start, on every change and again when the NUI is ready.
np_identification in detail ​
- Permits.
NpScanner.Ident.permit(src, class)askshasValidDocumentfor the document type of the class (Config.Permits.types): firearm needs aweapon_licenseof category B or C, blade category A, detecting adetecting_permit, security asecurity_license.Config.Permits.categorieschanges the categories. The venue'spermitDocrule names the document that counts as a weapon permit. - Documents. The findings sheet's Request ID uses the card's name; the Permits app lists
getDocuments. - Points. On a seizure
addPoints(serial, 1, reason)adds a license point to the visitor's weapon license (Config.Permits.seizurePoints). - Types. Import the three types of
install/np_identification_typedefs.json, see Items. - Without it every permit is invalid unless
Config.Permits.fallbackAllowedistrue.
np_payments and np_banking in detail ​
- Locker fee.
Charge(src, account, fee, { merchant, payee = { type = 'none' }, silent = true })with the account ofConfig.Siblings.payments.account(bank). A deposit that fails after the charge is refunded (Refundwith the payment reference, else a credit to the bank). Without np_payments the fee is taken from cash, then bank (Config.Lockers.feeAccounts). - Fines. With
Config.Siblings.payments.seizureFineabove 0 a seizure invoices the visitor (Invoice, payee societypolice, due ininvoiceDaysdays). - Wages. Shift pay comes from the
securitysociety account (GetSocietyAccount,Transfer) to the guard's checking account (GetPersonalAccount). The Permits app lists the player's masked bank cards (GetCards). Without np_banking the framework account is credited. See Console, shifts & watchlist.
np_phone in detail ​
- The apps are registered with
registerStoreApp(idscheckpointandcheckpoint_wallet,ui = 'web/dist/phone.html') and their RPCs withregisterAppRpc, at start and again when np_phone restarts. They only useregisterAppRpc, so they cannot reach other apps. - Banners use
notify, the badgesetBadge, the Dynamic IslandsetIslandandclearIsland, live refreshessendAppMessage. See Checkpoint & Permits apps.
np_hud in detail ​
Toasts (including the consent call toast with Comply, Refuse and Run), key prompts, progress bars and zone
claims. Without np_hud the NUI draws its own toasts, prompts (prompt layer) and progress bars (progress layer) in
the same look. X cancels a progress bar.
np_prison in detail ​
np_prison:jailed closes the open sessions of that player. With Config.Siblings.prison.gateOnAlert on, the
visitation venue (Config.Siblings.prison.venue) vetoes passes through beforeScan while the facility's alert level is
in blockedLevels (siren, manhunt).
np_passwords in detail ​
Each gate and pole registers one lock (RegisterLock, a 6-digit PIN, owner job security). A successful crack
takes the scanner offline with the reason hacked for Siblings.passwords.minutes, then back to idle. It reacts to
np_passwords:unlocked for a cracker standing within distance of the gate and confirms it with IsUnlocked. A
tamper log entry with the method is written, the tamper event fires (scanner_hack) and the console shows the post
as offline.
np_npchandler, np_menu and np_prophandler in detail ​
Both handlers are required (np_prophandler 1.1.0+). np_metal-scanner creates no ped or object itself.
- np_npchandler. The server (
server/modules/npcs) registers a guard NPCnpms_guard_<hash>(s_m_m_security_01) next to every gate (Config.Siblings.npc) and enables it withsetNpcEnabledwhile the venue is open and no operator is on duty. Every buyer ofConfig.Ground.buyersis an NPCnpms_buyer_<id>with an interact option that opens its sale list.registerNpc/updateNpc/removeNpc, checked every 10 s and again onnp_npchandler:ready. - np_menu. The context options Wand this person and Request pat-down on players, Open console on gate and pole
props, and a radial Security entry; it is also a provider for the interaction layer (
Config.Siblings.menu). - np_prophandler. Each enabled scanner is a client-only streamed prop
np_metal-scanner:scanner:<id>(addLocalProp,spawnDistance = Config.Props.streamDistance), added again on the clientnp_prophandler:ready. The placement ghost is a local object (createLocal, alpha 130, no collision). The wand, the ground detector and progress bar props in hand are synced attachments (attach, keyheld) that everyone near sees.
np_shops in detail ​
RegisterShop creates Security Supply (npms_security_supply) at Config.Siblings.shops.coords (default 441.8, -981.1, 30.7) for the groups
security, police and sheriff: metal_wand $250, pinpointer $300, ground_detector $850, trowel $60.
Disable it with Config.Siblings.shops.enabled = false.
np_drugs, np_clothing, np_gangs, np_tattoos, np_character, np_screens, np_environmental ​
- np_drugs.
GetSubstanceslists organic drug items so they stay non-metallic on the X-ray (add more names toConfig.Siblings.drugs.organic); a gate hold or a seizure forwards a witness dispatch (Config.Siblings.dispatch). - np_clothing. Pieces listed in
Config.Siblings.clothing.piecesthat are worn become body metal. - np_gangs. A seizure on a gang's turf adds
seizureAttention(5) police attention. - np_tattoos. Distinguishing marks are appended to watchlist rows in the phone.
- np_character. The active character id and real name replace the framework name for unverified IDs.
- np_screens.
Config.Siblings.screens.boardsmaps a venue id to an existing np_screens content id, shown as a Screened tonight board. - np_environmental. Ground finds are
multipliertimes likelier within 40 m of a live storm-debris scene; the optional templatenpms_storm_debriscan be registered. - np_crouch-crawl-shoot.
BlockStancewhile scanning, wanding or standing at a tray.