Skip to content

Installation ​

Requirements ​

  • A recent FiveM server artifact (Lua 5.4) with OneSync turned on (the server reads positions from its own ped)
  • oxmysql
  • np_prophandler 1.1.0+: the props of planted bugs, laser mics and USB implants
  • Node 18+ to build the NUI once (web/dist is the build output and isn't in the repository; a release ships it prebuilt)

oxmysql and np_prophandler are dependencies in the fxmanifest and must start before np_surveillance.

Optional, auto-detected at start (each with a fallback, see Integrations & compatibility):

Kind Resources Without it
Framework es_extended (best-tested), qbx_core, qb-core Standalone: license identifiers, no economy, no jobs. Roles come from staff only
Inventory np_inventory (best-tested), ox_inventory, qb-inventory (and the ps / lj forks) none: no items. Open the console by command, key or terminal
Staff np_admin, np_discord Framework admin groups and Config.Admins (see Access, commands & admin)
Phone np_phone Phone taps have no calls or SMS to listen to; notifications become toasts
Other np_* siblings np_hud, np_menu, np_payments, np_identification, np_screens, np_mdt, … A built-in fallback for each
Zones np_colshape Distance checks instead of colshapes for enter and exit of the interaction points. Needed on FiveM Legacy only, GTAV Enhanced has the natives built in

Steps ​

  1. Put the folder into your resources as np_surveillance. The NUI calls https://np_surveillance/rpc, item definitions call np_surveillance.useItem and other resources call exports.np_surveillance, so keep the name.
  2. Build the UI once (skip it when you installed a release):
    sh
    cd web && npm ci && npm run build
    web/dist is not committed, so a fresh clone starts with a blank console until you build it.
  3. Start order in server.cfg. The framework and the inventory are detected once, at start:
    cfg
    ensure oxmysql
    ensure es_extended          # or qbx_core / qb-core
    ensure np_inventory         # or ox_inventory / qb-inventory
    ensure np_admin             # optional: staff rights, settings, audit log
    ensure np_hud               # optional siblings, any order
    ensure np_phone
    ensure np_prophandler       # required
    ensure np_surveillance
    ensure np_cctv              # add-ons that need np_surveillance come after it
    ensure np_spy-pigeon
  4. Database: the tables (prefixed np_surveillance_) are created and migrated on every start. To create them by hand instead, import sql/install.sql.
  5. Items (below): nothing to do on np_inventory; add them to the item list on ox_inventory and qb-inventory.
  6. Roles: map your police, sheriff and court job names in Config.Access.roles (below).
  7. Console spots (optional): ops terminals and the warrants command in Config.Console and Config.Warrants.
  8. Phone taps (optional): set Config.Lines.towers to your cell towers, and keep Config.Lines.pmaCallOffset equal to np_phone's Config.VoiceCallChannelOffset (Phone lines).
  9. Start the server and read the start-up lines: one per sibling (active, fallback: …, missing export <name>), the item registration and a ready line. Players on a case job can now open the console with /surveillance.

Roles ​

Investigators are recognised by job and grade. Config.Access.roles maps a role to job names with a minimum grade:

lua
Config.Access.roles = {
  investigator = { jobs = { police = 0, sheriff = 0, fib = 0, doj = 0 } },
  lead         = { jobs = { police = 6, sheriff = 6, fib = 4 } },
  judge        = { jobs = { doj = 2, judge = 0 } },
}
Role Used for
investigator Open cases, add intel, tag subjects, plant devices, tap lines, request warrants
lead Everything an investigator does, plus close cases, add members, edit trigger rules, cast the map, revoke warrants
judge Decide warrants (approve, deny, amend, revoke) on any case, without being a member of it
staff Not a job: an np_admin node, or the fallback list. Sees every case

Three rules decide whether a player may act:

  • A job role counts only while the player is on duty (a framework that has no duty flag counts everyone as on duty).
  • Case actions (adding intel, opening a dossier, planting a device, requesting a warrant) also need the player to be a member of that case. Only opening a case and deciding a warrant need no membership.
  • A member added to a case carries a role of their own on that case, on top of the job role.

Which role may do which action is Config.Access.actions; see Configuration. Staff rights are on Access, commands & admin.

Items ​

np_surveillance builds nine items: the ops laptop, the seven field devices and the printable case file. The device items are unique (no stacking): each unit gets a serial in its metadata when first used.

Item What it is Used by
surv_laptop Opens the console (Config.Console.item; set it to false to ship no laptop) Ops console
surv_gps_tracker GPS tracker for a vehicle Field devices
surv_room_bug Room bug Field devices
surv_laser_mic Laser microphone Field devices
surv_sim_cloner SIM cloner Field devices
surv_usb_implant USB implant Field devices
surv_print_kit Print kit Field devices
surv_binoculars Binoculars Field devices
surv_case_file A printed dossier, created by Case file → Print (Config.Dossier.export.item; false = no printable item) Dossiers
Inventory What to do
np_inventory Nothing. Items are registered at runtime, with their icons, and again whenever np_inventory restarts. Usable items carry server = { export = 'np_surveillance.useItem' }
ox_inventory Add the block below to ox_inventory/data/items.lua. np_surveillance answers false to usingItem, so ox never consumes an item
qb-core / qbx_core Add the second block to qb-core/shared/items.lua (or qbx_core/shared/items.lua). np_surveillance wires the use callbacks through CreateUseableItem
None No items. The console opens by command, key or terminal; field devices need an inventory
lua
-- ox_inventory/data/items.lua
return {
  -- ... your items ...
  ['surv_laptop']       = { label = 'Ops Laptop',   weight = 1200, stack = false, close = true, server = { export = 'np_surveillance.useItem' } },
  ['surv_gps_tracker']  = { label = 'GPS Tracker',  weight = 800,  stack = false, close = true, server = { export = 'np_surveillance.useItem' } },
  ['surv_room_bug']     = { label = 'Room Bug',     weight = 800,  stack = false, close = true, server = { export = 'np_surveillance.useItem' } },
  ['surv_laser_mic']    = { label = 'Laser Mic',    weight = 800,  stack = false, close = true, server = { export = 'np_surveillance.useItem' } },
  ['surv_sim_cloner']   = { label = 'SIM Cloner',   weight = 800,  stack = false, close = true, server = { export = 'np_surveillance.useItem' } },
  ['surv_usb_implant']  = { label = 'USB Implant',  weight = 800,  stack = false, close = true, server = { export = 'np_surveillance.useItem' } },
  ['surv_print_kit']    = { label = 'Print Kit',    weight = 800,  stack = false, close = true, server = { export = 'np_surveillance.useItem' } },
  ['surv_binoculars']   = { label = 'Binoculars',   weight = 800,  stack = false, close = true, server = { export = 'np_surveillance.useItem' } },
  ['surv_case_file']    = { label = 'Case file',    weight = 150,  stack = false, close = true, server = { export = 'np_surveillance.useItem' } },
}
lua
-- qb-core/shared/items.lua
QBShared.Items = {
  -- ... your items ...
  surv_laptop      = { name = 'surv_laptop',      label = 'Ops Laptop',  weight = 1200, type = 'item', image = 'surv_laptop.png',      unique = true, useable = true, shouldClose = true, description = '' },
  surv_gps_tracker = { name = 'surv_gps_tracker', label = 'GPS Tracker', weight = 800,  type = 'item', image = 'surv_gps_tracker.png', unique = true, useable = true, shouldClose = true, description = '' },
  surv_room_bug    = { name = 'surv_room_bug',    label = 'Room Bug',    weight = 800,  type = 'item', image = 'surv_room_bug.png',    unique = true, useable = true, shouldClose = true, description = '' },
  surv_laser_mic   = { name = 'surv_laser_mic',   label = 'Laser Mic',   weight = 800,  type = 'item', image = 'surv_laser_mic.png',   unique = true, useable = true, shouldClose = true, description = '' },
  surv_sim_cloner  = { name = 'surv_sim_cloner',  label = 'SIM Cloner',  weight = 800,  type = 'item', image = 'surv_sim_cloner.png',  unique = true, useable = true, shouldClose = true, description = '' },
  surv_usb_implant = { name = 'surv_usb_implant', label = 'USB Implant', weight = 800,  type = 'item', image = 'surv_usb_implant.png', unique = true, useable = true, shouldClose = true, description = '' },
  surv_print_kit   = { name = 'surv_print_kit',   label = 'Print Kit',   weight = 800,  type = 'item', image = 'surv_print_kit.png',   unique = true, useable = true, shouldClose = true, description = '' },
  surv_binoculars  = { name = 'surv_binoculars',  label = 'Binoculars',  weight = 800,  type = 'item', image = 'surv_binoculars.png',  unique = true, useable = true, shouldClose = true, description = '' },
  surv_case_file   = { name = 'surv_case_file',   label = 'Case file',   weight = 150,  type = 'item', image = 'surv_case_file.png',   unique = true, useable = true, shouldClose = true, description = '' },
}

The start-up status lists any item the inventory does not know. The device weight is Config.Devices.itemWeight.

Next steps ​