Requirements
| Requirement | Notes |
|---|---|
| OneSync | Required (dependency '/onesync') |
| oxmysql | Must start before LJ_ANPR |
| MySQL / MariaDB | Same database as your server oxmysql connection |
| Framework | Qbox, 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
- Stop the server (or at least stop
LJ_ANPR). - Copy the
LJ_ANPRresource into your resources folder. - Import **
sql/install.sqlonce into your existing server database (do not** create a separate database just for ANPR). - Add
ensure oxmysqlandensure LJ_ANPRtoserver.cfg(framework and oxmysql before LJ_ANPR). - Edit configuration (see below), especially jobs in
config/framework.luaand branding inconfig/terminal.lua. - Grant yourself the admin ACE:
add_ace group.admin lj_anpr.admin allow(or your admin group). - Start the server. Look for persistence / intelligence ready messages in the console.
- 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:
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
- Copy the
anpr_cameraentry frominstall/ox_inventory_item.luaintoox_inventory/data/items.lua. - Keep
consume = 0. LJ_ANPR removes the item only after a successful placement. - Start ox_inventory before LJ_ANPR.
qs-inventory
- Copy the
anpr_cameraentry frominstall/qs_inventory_item.luainto your qs-inventory shared items file. - Keep
unique = trueanduseable = true. LJ_ANPR registersCreateUsableItemitself — do not add a consuming item export. - Add an
anpr_camera.pngimage under the qs-inventory images folder (or changeimageto an existing icon). - 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 schema | Run once |
|---|---|
| Fresh | sql/install.sql |
| Pre-intelligence | sql/002_intelligence.sql |
| Pre-management | sql/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
| File | Purpose |
|---|---|
config/config.lua | Props, mobile, commands, ox_target, blips, scanning, history search, database, deployments, inventory |
config/framework.lua | Framework, jobs, grades, duty, ACE, MDT/dispatch integrations |
config/terminal.lua | Branding, F7 key, timezone, VOI lists, alerts |
config/vehicle_profiles.lua | Which vehicle models have mobile ANPR + defaults |
config/cameras.lua | Optional 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:
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:
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)
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:
| Grade | Access |
|---|---|
| 0 | Terminal, live reads, basic search, VOI view, alerts, acknowledge, camera/deployment view, deploy, pack own |
| 2 | Read history, precise locations, VOI create/edit/history, camera toggle |
| 3 | VOI 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.debuglj_anpr.camera.place/.edit/.archivelj_anpr.vehicle_profile.*lj_anpr.audit.view/.searchlj_anpr.read.export/lj_anpr.admin.retention
Grant admin with ACE, for example:
add_ace group.admin lj_anpr.admin allowlj_anpr.admin grants all ANPR permissions for that player.
Permission evaluation order
- Unknown / disconnected / explicit deny
CustomCheck(if set)- Admin ACE
- Permission ACE (+ aliases)
- 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
| Input | Action | Typical permission |
|---|---|---|
F7 / /anpr (configurable) | Open / close police terminal | lj_anpr.use + UI nodes |
| Escape | Close drawer, then terminal | — |
F6 / /anprack | Acknowledge highest new live alert | lj_anpr.alert.acknowledge |
/anprclose | Force-close terminal focus | — |
/anpr (mobile power) | Toggle mobile scanning in equipped vehicle | lj_anpr.use |
F9 / /anprpos | Mini HUD drag / edit mode | — |
/anprprops | Toggle mobile visual props | lj_anpr.vehicle_profile.calibrate |
/anprfeed | Debug feed of saved reads (F8) | lj_anpr.admin.debug |
/anprdebug | Draw scan volumes | lj_anpr.admin.debug |
/anprdb | Database / 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
| Fixed | Logical | |
|---|---|---|
| Prop | Spawns the ANPR camera model | No prop |
| Use | New visible roadside unit | Scan over existing map scenery |
| Status | SPAWNED / AWAITING PROP | LOGICAL |
Both save scans, alerts and history the same way. Disable a fixed camera (toggle permission) to stop it scanning without deleting it.
Deployments (item)
- Use
anpr_cameraon foot → placement mode. - Confirm → item consumed, camera saved.
- Cancel / timeout → item kept.
- Pack → camera archived, item returned (or queued if inventory full).
- 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
- Add the vehicle spawn name to
config/vehicle_profiles.lua(or save a calibrated profile). - Enter the vehicle, open Live, toggle power (
/anpr). - 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:
permissionornone(alsojob/dispatch_exportvia integrations config) - Deployable:
permission,ownerornone
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.
- Sit stationary in the vehicle → F7 → Calibration → Load current vehicle.
- Select Front / Rear (or other channels).
- Drag coloured axes to move; drag rings to rotate. Shift = fine snap. Right-click drag = orbit.
- 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:
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
- Import SQL · start oxmysql · start LJ_ANPR · confirm ready in console.
- Set
Config.Permissions.Jobsand grantlj_anpr.adminto your admin. - Place a fixed camera · drive a plate through · confirm a Live / Search read.
- Create a VOI · confirm hit + acknowledge.
- Add a vehicle profile · toggle
/anpr· check mini HUD. - (Optional) Add
anpr_cameraitem · deploy · pack · recover. - 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.