Skip to content

Installation ​

Requirements ​

  • FiveM OneSync server with oxmysql and a MySQL-compatible database.
  • np_jobs to authorize staff workflows; without it those actions fail closed.
  • np_inventory for badges and wristbands.
  • ESX is the first framework target. Character IDs are read from np_character when available, then ESX, then the FiveM license identifier.

Setup ​

  1. Copy the resource to your server resources folder and configure oxmysql.
  2. Run sql/install.sql, or keep Config.Security.AutoCreateTables = true and allow the database user to create and alter the resource tables.
  3. Ensure oxmysql, np_jobs, np_doors, np_inventory, the relevant providers, and then np_security. Optional integrations can start later; the resource registers with them when they become available.
  4. Configure job compositions in np_jobs using the feature catalogue. security.detain also requires police.cuff.
  5. Register a venue site with a stable ID, bucket, and door coordinates. For venues, use /securitydoor near the registered entrance to open the door tablet.
  6. For CIT routes, register the configured sourceStash and destinationStash in np_inventory, define load/unload stops in Config.Security.CitRoutes, and restrict the route IDs with the job's security.cit.routes config.
  7. Map housing property IDs and banking alarm locations to security site IDs in Config.Security.AlarmSites so active alarm contracts route those alarms to the security channel.

np_security does not fall back to framework job names or ACE. Its np_addon declarations are host discovery metadata, not hard dependencies. Only oxmysql is a manifest dependency.

Venue example ​

lua
exports.np_security:registerSite({
  id = 'galaxy', kind = 'venue', label = 'Galaxy', bucket = 4201,
  door = { coords = { x = 350.0, y = 200.0, z = 100.0 }, radius = 3.0, bucket = 0 },
  capacity = 250, capacityMax = 300, ageLimit = 18,
  count = 'bucket', tiers = { entry = true, vip = true, staff = true },
})

For an outdoor entrance and interior, set door.bucket to the entrance bucket and site.bucket to the interior bucket. The admission provider validates the guest's current bucket at the door; the venue resource moves them after admission succeeds.

Commands ​

  • /securitydoor opens the venue NUI after checking feature scope, routing bucket, and distance.
  • /securityhelp prints the action list.
  • /security <action> <json> calls a server-validated action, for example /security routes {"siteId":"galaxy"}.

The generic command is an operational interface, not an authorization bypass. Every action rechecks np_jobs on the server.