LJ Scripts / DOCS
RESOURCE DOCUMENTATION Version 1.0.0

LJ ANPR.

From your first camera to a connected intelligence network.

LJ_ANPROneSync · oxmysql · Schema 4
↳

Start with the requirements and install steps. Upgrading an existing server? Read the database migration instructions before importing SQL.

Requirements

RequirementNotes
OneSyncRequired (dependency '/onesync')
oxmysqlMust start before LJ_ANPR
MySQL / MariaDBSame database as your server oxmysql connection
FrameworkQbox, QBCore, ESX, or standalone (ACE)
Inventory (optional)ox_inventory or qs-inventory — only required for portable deployable cameras

No npm install or frontend build is required. The terminal NUI ships ready to run.

Fresh installation

  1. Stop the server (or at least stop LJ_ANPR).
  2. Copy the LJ_ANPR resource into your resources folder.
  3. Import **sql/install.sql once into your existing server database (do not** create a separate database just for ANPR).
  4. Add ensure oxmysql and ensure LJ_ANPR to server.cfg (framework and oxmysql before LJ_ANPR).
  5. Edit configuration (see below), especially jobs in config/framework.lua and branding in config/terminal.lua.
  6. Grant yourself the admin ACE: add_ace group.admin lj_anpr.admin allow (or your admin group).
  7. Start the server. Look for persistence / intelligence ready messages in the console.
  8. Press F7 in game to open the terminal.

Portable cameras (inventory)

Portable deployments need either ox_inventory or qs-inventory. Fixed and mobile ANPR work without an inventory.

In config/config.lua:

lua
Config.Inventory.Resource = 'auto' -- or 'ox_inventory' / 'qs-inventory'
Config.Inventory.Item = 'anpr_camera'

auto uses ox_inventory if it is started, otherwise qs-inventory. Set the name explicitly if both can be present.

ox_inventory

  1. Copy the anpr_camera entry from install/ox_inventory_item.lua into ox_inventory/data/items.lua.
  2. Keep consume = 0. LJ_ANPR removes the item only after a successful placement.
  3. Start ox_inventory before LJ_ANPR.

qs-inventory

  1. Copy the anpr_camera entry from install/qs_inventory_item.lua into your qs-inventory shared items file.
  2. Keep unique = true and useable = true. LJ_ANPR registers CreateUsableItem itself — do not add a consuming item export.
  3. Add an anpr_camera.png image under the qs-inventory images folder (or change image to an existing icon).
  4. Start qs-inventory before LJ_ANPR.

Give officers the anpr_camera item with your usual admin/inventory tools.

Upgrading an older LJ_ANPR database

Do not re-run install.sql on an existing install. Run only the migration you still need, in order, then replace the resource:

From schemaRun once
Freshsql/install.sql
Pre-intelligencesql/002_intelligence.sql
Pre-managementsql/003_management.sql
Pre-equipment (pre-0.10.0)sql/004_equipment.sql

Back up the database before migrating. Current required schema version is 4.

Configuration map

FilePurpose
config/config.luaProps, mobile, commands, ox_target, blips, scanning, history search, database, deployments, inventory
config/framework.luaFramework, jobs, grades, duty, ACE, MDT/dispatch integrations
config/terminal.luaBranding, F7 key, timezone, VOI lists, alerts
config/vehicle_profiles.luaWhich vehicle models have mobile ANPR + defaults
config/cameras.luaOptional one-time seed for fixed cameras

config/cameras.lua seeds each unique ID once. After import, the database row is authoritative — editing the config entry will not move or delete an already-saved camera.

Example seed:

lua
Config.Cameras = {
    {
        id = 'training_01',
        coords = { x = 123.0, y = 456.0, z = 20.0 },
        heading = 90.0,
        bucket = 0,
        enabled = true,
        propEnabled = false -- logical (no prop)
    }
}

Frameworks and permissions

Framework selection

In config/framework.lua set:

lua
Config.Framework = 'auto' -- or 'qbox', 'qbcore', 'esx', 'standalone'
  • Auto prefers native Qbox when available.
  • Only the character’s primary job is checked.
  • Job, grade and duty come from the server framework object — never from the client.
  • Standalone uses the configured FiveM identifier (default license) plus ACE / custom rules. It does not invent a police job.

Duty: Config.Permissions.RequireDuty = true by default. ESX builds without a duty field use Config.Bridge.ESXDefaultDuty (default false).

Jobs (easiest place to edit)

lua
Config.Permissions.Jobs = {
    'police',
    'sheriff',
    -- add your exact job.name values here
}

Use the framework job name, not the display label.

Grades

Numbers in the grades table are minimum primary-job grades applied to every job in Config.Permissions.Jobs.

Typical defaults:

GradeAccess
0Terminal, live reads, basic search, VOI view, alerts, acknowledge, camera/deployment view, deploy, pack own
2Read history, precise locations, VOI create/edit/history, camera toggle
3VOI close/reopen, pack other officers’ deployments

ACE-only by default

These are not granted by job grade unless you add rules yourself:

  • lj_anpr.admin / lj_anpr.admin.debug
  • lj_anpr.camera.place / .edit / .archive
  • lj_anpr.vehicle_profile.*
  • lj_anpr.audit.view / .search
  • lj_anpr.read.export / lj_anpr.admin.retention

Grant admin with ACE, for example:

text
add_ace group.admin lj_anpr.admin allow

lj_anpr.admin grants all ANPR permissions for that player.

Permission evaluation order

  1. Unknown / disconnected / explicit deny
  2. CustomCheck (if set)
  3. Admin ACE
  4. Permission ACE (+ aliases)
  5. Primary job + minimum grade + duty

Diagnostics

/anpraccess — shows framework, job, grade, duty and whether lj_anpr.use is allowed (F8 + notify). Does not print your license identifier.

Commands and keys

InputActionTypical permission
F7 / /anpr (configurable)Open / close police terminallj_anpr.use + UI nodes
EscapeClose drawer, then terminal—
F6 / /anprackAcknowledge highest new live alertlj_anpr.alert.acknowledge
/anprcloseForce-close terminal focus—
/anpr (mobile power)Toggle mobile scanning in equipped vehiclelj_anpr.use
F9 / /anprposMini HUD drag / edit mode—
/anprpropsToggle mobile visual propslj_anpr.vehicle_profile.calibrate
/anprfeedDebug feed of saved reads (F8)lj_anpr.admin.debug
/anprdebugDraw scan volumeslj_anpr.admin.debug
/anprdbDatabase / write counters (also server console)lj_anpr.admin.debug

Legacy chat history commands (/anprsearch, /anprhistory, /anprread, …) still exist for diagnostics; day-to-day use is through the F7 Search screen.

Placement controls (fixed / deployable / move)

  • Aim to move · left/right rotate · Shift fine · up/down height · Enter confirm · Backspace cancel

Police terminal (F7)

Sessions require lj_anpr.use, lj_anpr.ui.open and lj_anpr.ui.workstation. Inactivity locks the session after 15 minutes by default. Changing character, job/duty, routing bucket or disconnecting invalidates the session.

While driving above the configured speed, the UI reduces to live / alert use; detailed mutations are rejected server-side. Passengers keep the full interface when permitted.

Configure branding, timezone, VOI priorities/actions/reasons and alert sound in config/terminal.lua.

Screens

Live ANPR — Front/rear reads, recent observations, power toggle, optional mini display, live hit alert + acknowledge.

Search — Plate summaries and observation history with filters (date, source, camera, area, direction). Precise coordinates need lj_anpr.read.location and an explicit location request.

Vehicles of interest — Create / edit / close / reopen markers with priority, action, reason, intelligence, warnings, tags, department, linked reference, review/expiry (UTC). Revision checks prevent stale overwrites. References look like VI-2026-000001.

Hit register — Persistent matches with acknowledge. Multiple active VOIs on one plate can create multiple hits; the highest configured priority drives the immediate alert.

Cameras — Fixed camera list with search, waypoint, enable/disable (permission), move/edit (admin), place fixed or logical camera, archive nearby.

Deployments — Portable units: status, waypoint, move/edit/pack when authorised and nearby, recover pending inventory returns.

Calibration — Per-model mobile camera profiles (admin / calibrate permissions).

Audit — Search attributed equipment and intelligence actions (audit permissions).

Fixed vs logical cameras

FixedLogical
PropSpawns the ANPR camera modelNo prop
UseNew visible roadside unitScan over existing map scenery
StatusSPAWNED / AWAITING PROPLOGICAL

Both save scans, alerts and history the same way. Disable a fixed camera (toggle permission) to stop it scanning without deleting it.

Deployments (item)

  1. Use anpr_camera on foot → placement mode.
  2. Confirm → item consumed, camera saved.
  3. Cancel / timeout → item kept.
  4. Pack → camera archived, item returned (or queued if inventory full).
  5. Recover equipment on the Deployments screen clears pending returns.

Only the driver-side ownership rules and pack permissions apply as configured. Moving keeps identity and read history.

Mobile ANPR

  1. Add the vehicle spawn name to config/vehicle_profiles.lua (or save a calibrated profile).
  2. Enter the vehicle, open Live, toggle power (/anpr).
  3. Optional mini front/rear HUD; F9 to reposition boxes (saved in local storage).

Mobile alerts go to the authorised driver and (by default) front passenger in the same routing bucket.

Alert routing

Set in config/terminal.lua / integrations:

  • Fixed: permission or none (also job / dispatch_export via integrations config)
  • Deployable: permission, owner or none

Hits are still stored when live routing is none.

Vehicle calibration

Requires lj_anpr.vehicle_profile.view + .calibrate (save also needs .edit), usually via admin ACE.

  1. Sit stationary in the vehicle → F7 → Calibration → Load current vehicle.
  2. Select Front / Rear (or other channels).
  3. Drag coloured axes to move; drag rings to rotate. Shift = fine snap. Right-click drag = orbit.
  4. Save with a reason (all channels for that model). Restore config default clears the DB override.

Drafts do not change live scanning until saved.

Persistence behaviour

  • Cameras, deployments, reads, VOIs, hits, profiles and audits are stored via oxmysql.
  • Mutations use revisions / transactions where applicable; refresh after an uncertain result instead of blind retry.
  • World props recreate on resource start; network IDs are not persistent identity.
  • Config.Deployments.PersistAcrossRestart (when false) closes deployments on start and can queue item returns.
  • Routing buckets are respected for cameras and alerts.

There is no automatic long-term retention purge in this build unless you configure / run separate retention tooling.

Integration API (exports)

Other resources are denied by default. Allowlist the exact resource name in config/framework.lua under Config.Integrations:

lua
Config.Integrations.ResourcePermissions['my_mdt'] = {
    serviceActor = false,
    permissions = {
        ['lj_anpr.use'] = true,
        ['lj_anpr.voi.view'] = true,
        ['lj_anpr.voi.create'] = true,
        ['lj_anpr.read.search'] = true,
        ['lj_anpr.read.view_basic'] = true,
        ['lj_anpr.read.history'] = true,
    }
}

Actor is a connected player source (or { source = id }). Identity/job/grade are resolved by the server. Results are { success = true, data = ... } or { success = false, error = '...', message = '...' } (HasPermission is the boolean exception).

Useful server exports

  • HasPermission(source, permissionName)
  • GetFrameworkContext(source)
  • VOI: GetVehicleOfInterest, GetActiveVehicleInterestsByPlate, SearchVehicleInterests, AddVehicleOfInterest, UpdateVehicleOfInterest, CloseVehicleOfInterest, ReopenVehicleOfInterest
  • Reads: SearchReads, GetVehicleReads, GetLastVehicleRead, GetRead
  • Hits: GetHit, GetRecentHits, AcknowledgeHit

Client exports

  • OpenWorkstation(), CloseANPR(), IsANPROpen(), ToggleMobileANPR(), GetMobileANPRState()

Local server events (not client-callable)

LJ_ANPR:server:readCreated, hitCreated, hitAcknowledged, voiChanged / voiCreated / voiUpdated / voiClosed / voiReopened.

Optional Config.Integrations.OnHit and dispatch export routing are configured in config/framework.lua.

ox_target

When ox_target is started and Config.Target.Enabled is true, fixed/deployable props can offer Edit, Move, Show scan zone, and (fixed) Enable/Disable. Server permissions still apply.

Map blips

Fixed cameras only (Config.Blips.Fixed). Disabled cameras can be hidden. Deployables and mobile units are not blipped.

Suggested first-time checklist

  1. Import SQL · start oxmysql · start LJ_ANPR · confirm ready in console.
  2. Set Config.Permissions.Jobs and grant lj_anpr.admin to your admin.
  3. Place a fixed camera · drive a plate through · confirm a Live / Search read.
  4. Create a VOI · confirm hit + acknowledge.
  5. Add a vehicle profile · toggle /anpr · check mini HUD.
  6. (Optional) Add anpr_camera item · deploy · pack · recover.
  7. Test a non-admin grade 0 officer vs grade 2 for history / toggle.

Support notes

  • Escaped intelligence text only — no HTML injection in the terminal.
  • Precise coordinates are omitted from ordinary DTOs.
  • This resource is for roleplay simulation. It is not a claim of real-world ANPR legal compliance.

For product support, contact LJ Scripts through your usual support channel after purchase.

NEED A HAND?

We’re a message away.

Share the resource name, your setup and any console errors.

Get support ↗