A lightweight, configurable, and performance‑friendly speed camera system for FiveM (QBCore/QBox).
This script adds fully functional speed cameras to your server, complete with configurable speed limits, fines, directional detection, dual‑direction support, blips, props, and clean player notifications.
- Speed Detection (MPH or KMH)
- Directional & Dual‑Direction Cameras
- Dynamic Fine System (base fine, % over limit, multipliers)
- Job Exemptions (police, EMS, etc.)
- Optional Blips for each camera
- Camera Props with ground alignment
- Flash & Sound Effects when triggered
- Debug Mode for camera placement
- Clean Notifications including the vehicle’s plate
- Fully Configurable through
config.lua
- Place the resource folder into your server’s
resourcesdirectory. - Add this to your
server.cfg:
ensure bm-speedcameras
- Configure everything in
config.lua.
All settings for the script are controlled through config.lua.
Every camera, fine, blip, and effect can be customized without touching the core code.
| Setting | Description |
|---|---|
Locale |
Language for notifications (currently only en) |
DebugMode |
Shows debug spheres for camera zones |
UseMPH |
Toggle between MPH (true) or KMH (false) |
| Setting | Description |
|---|---|
NotifyPosition |
Screen position of notifications |
NotifyDuration |
How long notifications stay visible (ms) |
| Setting | Description |
|---|---|
EnableBlips |
Enable/disable all camera blips |
DefaultBlipSprite |
Default blip icon |
DefaultBlipColour |
Default blip colour |
DefaultBlipScale |
Default blip size |
DefaultBlipLabel |
Default blip name |
DefaultShortRange |
Only show blip when nearby |
DefaultShortRangeDistance |
Distance threshold for short‑range blips |
| Setting | Description |
|---|---|
DefaultBaseFine |
Base fine amount |
DefaultFinePerPercent |
Fine per 1% over the limit |
DefaultMaxFine |
Maximum fine allowed |
DefaultPaymentType |
cash or bank |
FineMultiplier |
Global multiplier for all fines |
Each GTA vehicle class can have its own multiplier.
Example: Motorcycles cheaper, emergency vehicles more expensive.
Config.VehicleClassMultiplier = {
[0] = 1.0, -- Compacts
[1] = 1.0, -- Sedans
[2] = 1.2, -- SUVs
[8] = 0.7, -- Motorcycles
[18] = 1.5, -- Emergency
}Config.TimeOfDayMultiplier = {
day = 1.0, -- 06:00–20:00
night = 0.8 -- 20:00–06:00
}Jobs listed here will never receive fines:
Config.ExcludedJobs = {
police = true,
ambulance = true,
bcso = true,
sahp = true
}These effects play when a player triggers a speed camera.
| Setting | Description |
|---|---|
FlashEnabled |
Enables a bright screen flash when the camera triggers |
FlashIntensity |
Brightness of the flash effect |
FlashDuration |
Duration of the flash (in ms) |
SoundEnabled |
Plays a camera shutter sound when triggered |
Example:
Config.FlashEnabled = true
Config.FlashIntensity = 1.0
Config.FlashDuration = 300
Config.SoundEnabled = trueEach camera can optionally spawn a physical prop (e.g., CCTV pole).
- Props auto‑align to the ground
- Custom heading supported
- Optional Z offset for fine‑tuning
Example:
model = 'prop_cctv_pole_03',
heading = 245.0,
zOffset = -0.05,If model = nil, no prop will spawn.
Debug mode draws a visible sphere around each camera zone using ox_lib.
Config.DebugMode = trueUseful for:
- Testing camera placement
- Checking radius coverage
- Ensuring directional detection is correct
Each camera is defined inside Config.SpeedCameras.
{
coords = vec3(88.85, -1038.7, 29.46),
radius = 20.0,
speedLimit = 40,
-- Optional prop
model = 'prop_cctv_pole_03',
heading = 245.0,
zOffset = -0.05,
-- Optional directional detection
direction = 180.0,
fov = 45.0,
-- Optional dual-direction detection
dual = true,
dualFov = 45.0,
-- Fine settings
baseFine = 200,
finePerPercent = 5,
maxFine = 1000,
paymentType = 'cash',
-- Blip settings
blip = {
enabled = true,
sprite = 744,
colour = 0,
scale = 0.6,
label = "Speed Camera",
shortRange = true,
shortRangeDistance = 500.0
}
}-
Player enters a camera radius
-
Script checks:
- Speed
- Speed limit
- Direction (if enabled)
- Dual‑direction (if enabled)
-
If speeding:
- Fine is calculated
- Multipliers applied
- Money removed
- Notification shown
- Plate included in the message
-
A cooldown prevents repeated fines
You were caught speeding doing 60 in a 40 zone.
Fine: $300
Plate: EXAMPLE1
- ox_lib (notifications, debug zones)
- QBCore / QBox (player money, job data)
- Enable DebugMode = true to visualize camera zones
- Check server console for config validation errors
- Ensure ox_lib is started before this resource
- Verify camera coordinates and radius values
- Ensure your blip settings are valid
Attribution is Required. Do not redistribute or sell without explicit permission. Keep all author(s) credits intact.