Skip to content

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.lua is the np_admin lib, byte-identical to np_admin/lib/np_admin.lua. shared/np_admin_settings.lua registers the settings and the five permission nodes; every config file is also listed with np_admin_config in fxmanifest.lua so np_admin shows the settings while np_metal-scanner is stopped.
  • Audit log. Every decision goes to scanner_log and, with np_admin, to its audit log under np_metal-scanner. Placement actions are logged through npAdmin.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) asks hasValidDocument for the document type of the class (Config.Permits.types): firearm needs a weapon_license of category B or C, blade category A, detecting a detecting_permit, security a security_license. Config.Permits.categories changes the categories. The venue's permitDoc rule 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.fallbackAllowed is true.

np_payments and np_banking in detail ​

  • Locker fee. Charge(src, account, fee, { merchant, payee = { type = 'none' }, silent = true }) with the account of Config.Siblings.payments.account (bank). A deposit that fails after the charge is refunded (Refund with 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.seizureFine above 0 a seizure invoices the visitor (Invoice, payee society police, due in invoiceDays days).
  • Wages. Shift pay comes from the security society 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 (ids checkpoint and checkpoint_wallet, ui = 'web/dist/phone.html') and their RPCs with registerAppRpc, at start and again when np_phone restarts. They only use registerAppRpc, so they cannot reach other apps.
  • Banners use notify, the badge setBadge, the Dynamic Island setIsland and clearIsland, live refreshes sendAppMessage. 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 NPC npms_guard_<hash> (s_m_m_security_01) next to every gate (Config.Siblings.npc) and enables it with setNpcEnabled while the venue is open and no operator is on duty. Every buyer of Config.Ground.buyers is an NPC npms_buyer_<id> with an interact option that opens its sale list. registerNpc / updateNpc / removeNpc, checked every 10 s and again on np_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 client np_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, key held) 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. GetSubstances lists organic drug items so they stay non-metallic on the X-ray (add more names to Config.Siblings.drugs.organic); a gate hold or a seizure forwards a witness dispatch (Config.Siblings.dispatch).
  • np_clothing. Pieces listed in Config.Siblings.clothing.pieces that 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.boards maps a venue id to an existing np_screens content id, shown as a Screened tonight board.
  • np_environmental. Ground finds are multiplier times likelier within 40 m of a live storm-debris scene; the optional template npms_storm_debris can be registered.
  • np_crouch-crawl-shoot. BlockStance while scanning, wanding or standing at a tray.