CameraTech is a resource for FiveM by Albo1125 that provides for an indepth Automatic Number Plate Recognition (ANPR/ALPR) system simulation.
- Download the latest Release.
- Unzip the CameraTech folder into your resources folder on your FiveM server.
- Create a file called
fixedanprcameras.json
in the CameraTech folder. You can usually simply rename thefixedanprcameras.default.json
to do so. Optionally, add or remove fixed ANPR cameras on the map, following the format of the provided default file. - Add the following to your server.cfg file:
start CameraTech
- Install the InteractSound resource. Add sound files of your choice to InteractSound called
FixedANPR.ogg
andVehicleANPR.ogg
. Examples have been included in this release. - Optionally, create a new file called
anprvehicles.json
in the CameraTech folder. SeeCustomising your ANPR vehicles
below for further guidance. - Optionally, enable the ANPR whitelist in
vars.lua
and add identifiers. This only affects commands for use of police. - Optionally, in
sv_CameraTech.lua
, uncomment lines 5 to 7 and 16 to 18 and infxmanifest.lua
uncomment line 14. This will make the script insert a new row into a MySQL database whenever a fixed ANPR hit comes in (e.g. for web-based control purposes). - Optionally, in
fxmanifest.lua
, change theForceFocusedAnpr
setting totrue
. This means users will not be able to receive fixed ANPR alerts unless they have a plate focused. This is useful if you want your control room to initially circulate ANPR hits to units before the units see the hits themselves.
You have two options for customising your ANPR vehicles.
- Firstly, you can add a
anprvehicles.json
file to the CameraTech folder. If this file is present, it will always be used. Seeanprvehicles.default.json
for an example. - Secondly, you can load your
anprvehicles.json
contents dynamically. If noanprvehicles.json
file is present in the resource folder, the client will trigger a server eventCameraTech:GetANPRModelsJsonString()
when they use the /anpr command for the first time. The client will listen for aCameraTech:ANPRModelsJsonString(jsonString, runAnprCommandEnable)
event from the server.jsonString
should be a valid JSON string in theanprvehicles.json
format,runAnprCommandEnable
should be true if the event was triggered by a specific player using the ANPR command, false otherwise. TheCameraTech:ANPRModelsJsonString(jsonString, runAnprCommandEnable)
event can also be triggered periodically by the server to update the ANPR vehicle models for all players (-1), make surerunAnprCommandEnable
is set to false in that case.
You can add as many entries to the root array as you like. If a vehicle model appears in the file multiple times, all ANPR Access Types will be added on top of the others. JSON reference is as follows.
- "ModelName" string indicating the ingame Model Name of the vehicle.
- "ANPRAccessType" which should be one of: "full", "fixed only", "vehicle only".
- /anpr - Toggles the ANPR interface if you are in a vehicle that has access to ANPR (Whitelisted).
- /fixedanpr - Toggles ANPR alerts from fixed ANPR cameras on the map (Whitelisted).
- /vehicleanpr (alias /vehanpr) - Toggles ANPR alerts from vehicle ANPR cameras (Whitelisted).
- /readplate (alias /rp) - Reads the plate of the vehicle in front of you and puts it in chat.
- /checkplate PLATE - Returns the ANPR markers currently active for the specified plate.
- /focusanpr PLATE - Only displays fixed ANPR alerts for the specified PLATE and automatically draws a route if any hit comes in. Leave PLATE blank to unfocus or to focus the plate that last triggered a fixed ANPR alert.
- /setplateinfo PLATE;INFO - Adds ANPR markers (INFO) for the specified plate. Leave INFO blank to remove markers. Example: /setplateinfo AB12CDE;STOLEN
- /setvehinfo INFO - Adds ANPR markers (INFO) for the plate of the vehicle you're currently in. Leave INFO blank to remove markers. Example: /setvehinfo STOLEN
Please view the license. Improvements and new feature additions are very welcome, please feel free to create a pull request. As a guideline, please do not release separate versions with minor modifications, but contribute to this repository directly. However, if you really do wish to release modified versions of my work, permission & proper credit is always required and you should always link back to this original source and respect the licence.
Click here (please note setup instructions have changed slightly)