Skip to content

Installation ​

Requirements ​

  • A recent FiveM server artifact (Lua 5.4)
  • oxmysql
  • np_npchandler: gate guard and ground buyer NPCs
  • np_prophandler 1.1.0+: scanner props, the placement ghost, the wand and ground detector in hand

np_npchandler and np_prophandler must start before np_metal-scanner. It creates no ped or object itself.

  • Node 18+ to build the NUI once

Optional, auto-detected at start:

Kind Resources Used for
Framework es_extended, qbx_core, qb-core Identifiers, names, jobs and duty, money for locker fees and wages, the ESX loadout. Without one, np_metal-scanner runs standalone: jobs from Config.StandaloneJobs, no economy
Inventory np_inventory, ox_inventory, qb-inventory (ps / lj), the ESX inventory Metal items, the wand, claim tickets, evidence and locker stashes, the divest tray. Without one, only GTA weapons and body metal are read (see Items)
Staff np_admin, np_discord Permission nodes, Resource settings, the audit log, the server theme and the Discord log channel. Without them, a fallback decides who is staff
Phone np_phone The Checkpoint and Permits apps, the Dynamic Island on a gate alarm, banners
Documents and money np_identification, np_payments, np_banking Weapon, detecting and security permits; locker fees and fines; shift wages and masked card list
World ox_target / qb-target, np_hud, np_menu Interaction zones, toasts and prompts, context options. Each has a built-in fallback
Other np_* siblings np_shops, np_passwords, np_prison, np_drugs, np_clothing, np_gangs, np_tattoos, np_character, np_crouch-crawl-shoot, np_screens, np_environmental See Bridges & integrations. Each is optional, with a fallback

Steps ​

  1. Put the folder into your resources as np_metal-scanner. The NUI calls https://np_metal-scanner/rpc, np_phone loads web/dist/phone.html from it and other resources call exports['np_metal-scanner'], so keep the name.
  2. Build the UI once:
    sh
    cd web && npm ci && npm run build
    This creates web/dist/index.html (the game NUI) and web/dist/phone.html (the np_phone app). web/dist is not committed, so a fresh clone starts with a blank UI until you build it.
  3. Database: the tables (all prefixed scanner_) are created on start (Config.AutoCreateTables). To create them by hand, run sql/install.sql and the module files sql/<module>.sql.
  4. Start order in server.cfg. The framework and the inventory are detected once, at start, so start them first. The order among the optional np_* siblings doesn't matter: they are picked up at start and whenever they start later. np_npchandler and np_prophandler are required and start before np_metal-scanner.
    cfg
    ensure oxmysql
    ensure es_extended        # or qbx_core / qb-core
    ensure np_inventory       # or ox_inventory / qb-inventory
    ensure np_prophandler
    ensure np_npchandler
    ensure np_hud             # optional siblings, any order
    ensure np_phone
    ensure np_identification
    ensure np_payments
    ensure np_admin           # optional; may also start later
    ensure np_metal-scanner
  5. Items: with np_inventory nothing to do, they are registered at start when missing. With ox_inventory or qb-inventory add them from the snippets in install/, see Items.
  6. Permits: import the three np_identification types of install/np_identification_typedefs.json (security_license, detecting_permit, implant_card), see Items.
  7. Staff: nothing goes into server.cfg. See Permissions.
  8. Check the defaults. The five default venues are written into the database on the first start only (Config.SeedVenues); their coordinates are starting points. Edit venues and scanners in game with placement mode, or set Config.SeedVenues = false to start with an empty map.

At start the console prints one line per sibling (active, fallback (…), missing export <name>), the item registration, the np_admin state and a ready line with the number of venues, scanners, modules and RPC methods.

Permissions ​

np_metal-scanner never uses ACE. Every staff check is one call, npAdmin.can(src, node), of the np_admin lib that ships in bridge/np_admin.lua (np_admin stays optional: no dependency, no @np_admin include). Roleplay rights are framework jobs plus duty, set in Config.Jobs, in each venue's rules and in the module configs:

Group Default jobs May
security security Operate venues whose operatorJobs list it: gates, wands, X-ray, console, shifts
police police, sheriff Operate, bypass gates (logged), full search, read every case, receive case and alarm notices
ems ambulance Defined for rules to name; no feature uses it by default

Operators must be on duty (Config.RequireDuty). The shifts module can make a clock-in the duty for the listed jobs (Console, shifts & watchlist). Wand jobs and the phone staff jobs have their own lists (Config.Wand.jobs, Config.Phone.staffJobs).

Staff nodes. With np_admin running, grant these nodes to an np_admin group or a single player (or np_metal-scanner.*). They show up under the category Metal scanner:

Node Grants
np_metal-scanner.admin Every staff tool; passes every other node
np_metal-scanner.place Placement mode: add, move and remove gates, poles, X-ray belts, wand kits and lockers
np_metal-scanner.configure Venue rules, staff lists and scanner settings; permanent bans and console rules
np_metal-scanner.logs Read venue logs, cases and incident replays
np_metal-scanner.override Operate any venue, wave through and release seized items. Always logged

Without np_admin, a player is staff when np_admin's lib fallback says so (the server console, the np_admin_fallback convar, ESX admin groups), or when one of these does:

  1. the framework's admin groups in Config.AdminGroups (admin, superadmin, god): ESX getGroup(), qb-core / qbx_core HasPermission;
  2. one of their identifiers is in Config.Admins ('license:…', 'discord:…', 'fivem:…').

In the fallback every staff member passes every node. See Concepts → Permissions.

Tables ​

Table Holds
scanner_migrations Applied migration ids
scanner_kv Small key-value store: daily console counters, calibration times
scanner_log The screening log (alarm, clear, seized, locker, case, shift pay, …), pruned after Config.Log.keepDays
scanner_venues Venues: label, rules, staff list, data (coords, radius, icon, blip)
scanner_scanners Scanners: venue, type, label, coords, heading, trigger box, model, settings, enabled
scanner_gate_passes Passes per visitor, venue and day ("1st pass today")
scanner_wand_runs One row per ended wand run: consent, coverage, reason
scanner_lockers Venue lockers: owner, stash, items, fee, status, expiry
scanner_cases Seizure cases: findings, decisions, items, status, evidence
scanner_trays Open divest trays, so a tray survives a reconnect
scanner_shifts Shifts: post, started, ended, paid, pending, visitors
scanner_watchlist Bans and BOLOs per venue
scanner_finds Ground detector finds per character (the journal)

Check it works ​

  1. Run /scannerplace as staff (or from np_admin's staff tools). The placement panel lists the venues and scanners within 80 m.
  2. Stand at a default gate, for example the courthouse's courthouse_gate_1, and walk through it with a pistol in the loadout. The lamp turns red and an on-duty operator in range gets the operator panel. Outside the venue's schedule nothing happens (the courthouse screens Monday to Friday, 08:00 to 18:00).
  3. As a security or police player on duty, use a metal_wand item next to someone: the target gets a consent prompt.
  4. /securityconsole inside a venue opens the console.

Troubleshooting ​

Problem Fix
Blank screen, nothing visible Build the NUI (web/dist missing)
Gates never react The venue is closed by its schedule, the scanner is disabled or offline, or you are a bypass job on duty (logged, never alarms). Check the console list of posts
The operator panel does not appear The operator is not on duty, not in the venue's operatorJobs, or farther than Config.Gate.operatorRange (25 m) from the gate. F6 opens the newest undecided alarm in range
Items are unknown or cannot be used (ox / qb) Add the items to the inventory's item list
Weapon permit: none on file for everyone Import the np_identification types, or set Config.Permits.fallbackAllowed = true while you test
Locker fee is not charged, shift pay is not paid Standalone has no economy. Start the framework before np_metal-scanner
/scannerplace says Staff only Grant np_metal-scanner.place (or .admin) in np_admin. Without np_admin: Config.AdminGroups or Config.Admins
A sibling line says missing export <name> That sibling's version lacks an export np_metal-scanner uses; the fallback runs. Update the sibling