Skip to content

CODE3RESPONSE

Configuration

c3r's settings live in plain Lua files in c3r/config/, read by both the server and every player's game. Edit a file and restart c3r, or change values live in game with /c3rconfig (admins). Every option is listed below with its default.

FileWhat's in it
main.luaDebug, duty, keys, the officer's voice
stops.luaPicking the car, how it pulls over, the U modes, tests, running, felony stops
people.luaHidden truths, demeanours and records
patrol.luaStaged violators, booking and police stations
backup.luaAI backup units and the tow truck
medical.luaFirst aid
callouts.luaCallouts

The basics

main.lua

Config.Debug boolean (default: false)
Extra logging in the server console and F8. Leave it off on a live server.

Config.DutyCommand string (default: 'duty')
The chat command that toggles your shift.

Config.DutyKey string (default: 'F11')
Opens the service screen.

Config.DutyAce string | nil (default: nil)
nil lets anyone go on duty. Set an ace (e.g. 'c3r.police') and grant it to restrict it:

add_ace group.police c3r.police allow

Config.TargetKey string (default: 'LSHIFT')
In a police vehicle: the red circle ahead. Press again to cancel.

Config.ModeKey string (default: 'U')
During a stop: what the driver does.

Config.InteractKey string (default: 'E')
The contact wheel.

Config.RadialKey string (default: 'G')
Held: the vehicle wheel at a car, the dispatch wheel elsewhere.

Config.RespondKey string (default: 'Y')
Respond to a callout offer.

Config.ObjectiveKey string (default: 'BACK')
On a callout: hide or show the objective card.

Config.LeaveCallKey string (default: 'X')
Decline a callout offer; on a call, leave it.

Config.WeaponWheelHold number (default: 500)
Milliseconds Tab must be held to open the weapon wheel while an ID is showing. A shorter tap hides or shows the ID.

Config.Voice table (default: { range = 20.0, volume = 1.0 })
The officer's spoken lines (asking for ID, Miranda rights, a search, the breathalyzer). range in metres, quieter further off; volume 0-1, 0 turns them off.

Picking the car and pulling over

stops.lua

Config.Target table

FieldDefaultWhat it does
distance9.0Metres ahead of the patrol car the circle sits
radius2.6Metres: a car whose centre is this close to the circle is picked
lose_distance60.0Metres: let the picked car get this far away and it's let go
color{ 200, 72, 66 }The circle's colour (RGB)

Config.Pullover table
Tuning knobs for how the AI pulls over. GTA's driving AI behaves differently on different roads; adjust these if drivers stop too far, too short, or in the lane.

FieldDefaultWhat it does
ahead30.0Metres ahead of where they were that they aim to stop
kerb_gap0.35Metres between the car's right side and the kerb once stopped
kerb_inset1.4Roads with no kerb: how far in from the road edge they stop
straighten7.0Metres of slow glide along the kerb onto the final spot
glide1.0How far out from the kerb they aim before that glide (stops nose-in parking)
speed7.0m/s while pulling over (about 15 mph)
driving_style16777259GTA driving flags: stop for cars and people, steer round parked cars, straight lines, no waiting at lights
bend_style786475On a bend: normal road-following driving
timeout_ms15000Give up steering for the kerb after this long and just stop

Config.CancelDistance number (default: 150.0)
Drive this many metres from the stop and it's cancelled.

Config.Modes table
The U menu's driving modes.

FieldDefaultWhat it does
speed12.0m/s top speed while following in front or behind (about 27 mph)
gap4.0Metres they keep from your car while following
steer_speed8.0m/s top speed while you steer them (about 18 mph)

Stops, orders and running

stops.lua

Config.Tests table (default: { bac_limit = 0.08 })
The breathalyzer's legal limit.

Config.Flee table
Not everyone goes quietly. Chances are 0-1, per hidden truth; a truth that isn't listed never does it.

FieldDefaultWhat it does
carwarrant 0.3, stolen 0.4, drugs 0.1, drunk 0.08, suspended 0.08, unlicensed 0.05Runs instead of pulling over
footwarrant 0.25, stolen 0.25, drugs 0.1Runs when ordered out, or when you go to cuff them
bail0.5A car chase ends: they run on foot instead of giving up
refuse0.35Rude, or with something to hide: refuses the first order to get out
lose_distance250.0Metres: further than this for 10 s and they got away
catch_distance2.5Metres: on foot, this close and they give up

Config.PaRange number (default: 40.0)
Metres shouted orders reach (the PA, a felony stop). Talking still needs you beside them.

Config.Felony table
Felony stop chances (0-1).

FieldDefaultWhat it does
freeze0.2Doesn't move the first time they're told (asked again, they do)
runwarrant 0.3, stolen 0.3, drugs 0.15Bolts on foot instead (once)
drivestolen 0.2, warrant 0.15The driver floors it when the felony stop starts

Who you stop

people.lua

Config.Secrets table
How often each hidden truth comes up, as relative weights (any numbers; 0 turns one off).

TruthDefault weight
clean40
nervous10
unlicensed8
suspended8
expired8
drunk8
drugs7
warrant6
stolen5

Config.Demeanors table (default: polite 50, nervous 20, rude 15, chatty 15)
How people come across, as relative weights.

Config.PassengerSecrets table (default: clean 55, nervous 15, warrant 10, drugs 10, drunk 10)
Passengers' own truths. They aren't driving, so no licence or papers truths.

Config.FlagChance number (default: 0.06)
Chance anyone has a record flag (PROBATION, GANG AFFILIATION...).

Config.BorrowedChance number (default: 0.15)
Chance the car belongs to a relative.

Config.OwnerDrivesChance number (default: 0.8)
A car you've stopped before: chance its owner is at the wheel again.

Patrol and booking

patrol.lua

Config.Staged table
Staged violators: a car near you starts driving to match its story.

FieldDefaultWhat it does
enabledtrueTurn staged violators on or off
every{ 180, 300 }Seconds between violators (random in range)
lasts90Seconds it keeps it up
secretsdrunk 4, stolen 2, drugs 2, warrant 2, suspended 2, unlicensed 1, expired 1, clean 1Which truths get staged, as weights

Config.BookingRadius number (default: 5.0)
Metres: stop this close to a station with someone in custody and they're booked.

Config.Stations table
Where you can book prisoners. Each entry is { name, x, y, z }. Defaults: Mission Row, Vespucci, Davis, La Mesa, Vinewood, Rockford Hills, Sandy Shores, Paleto Bay, Bolingbroke. Positions are approximate: move them to match your MLOs.

{ name = 'Mission Row', x = 441.0, y = -985.0, z = 30.7 },

Backup and the tow truck

backup.lua

Config.Backup table

FieldDefaultWhat it does
spawn{ 150.0, 210.0 }Metres from the scene a unit appears, out of sight
speed25.0m/s on lights and siren (others drive at 15)
timeout120Seconds to get there; stuck in traffic, it turns up anyway
job_timeout90Seconds the work at the scene may take before they pack up
cover_minutes5A cover unit stands by this long at most
pursuit{ light = 1, medium = 2, heavy = 3, max = 6 }Cars per pursuit request, and at most in one chase
spikes0.5In a chase, how often a request's first car lays a Stop Stick up ahead (needs lwk_stopstick)

Config.Backup.units table
One entry per unit: car (spawn name), crew (ped models), and optionally lights and muted. Model names are from FiveM's game references.

UnitDefault carDefault crew
police (transport)policet2 × s_m_y_cop_01
ambulanceambulance2 × s_m_m_paramedic_01
firefiretruk2 × s_m_y_fireman_01
coronerspeedos_m_m_doctor_01, s_m_m_scientist_01
mechanicburrito3s_m_y_xmech_01
roadserviceutillitruck3s_m_y_xmech_02
animalrescueprangers_m_y_ranger_01
taxitaxia_m_y_stlat_01
coverpolice3s_m_y_cop_01
pursuitpolice, police2, police3 (cars = { })2 × s_m_y_cop_01
airpolmavs_m_y_pilot_01

Any unit (and the tow truck) can also set how it looks:

Config.Backup.units.cover.livery = 2                 -- the vehicle's livery
Config.Backup.units.cover.colours = { 111, 0 }       -- primary, secondary paint (GTA colour ids)
Config.Backup.units.cover.extras = { [1] = true }    -- vehicle extras on / off
Config.Backup.units.cover.outfit = { [11] = { 0, 0 } } -- crew clothing: component = { drawable, texture }
Config.Backup.units.cover.props = { [0] = { 1, 0 } } -- hats (0) and glasses (1)

Outfit components: 3 arms, 4 legs, 6 shoes, 8 undershirt, 9 vest, 11 jacket.

Config.Tow table

FieldDefaultWhat it does
truck'flatbed'The tow truck
driver's_m_m_trucker_01'Its driver
distance120.0Metres behind the car it comes up the road from
timeout_ms90000Stuck this long, it turns up anyway
tries3Failed tows of the same car before it's just removed

First aid

medical.lua

Config.Medical table

FieldDefaultWhat it does
cpr_chance0.35Chance a CPR attempt brings someone back
cpr_window300Seconds after dying that CPR can still work
cpr_seconds15How long CPR takes
paramedic_revive0.4Paramedics bring back anyone they find dead, this often

Callouts

callouts.lua. The calls themselves are files in c3r/callouts/ (see the Callouts SDK).

Config.Callouts table

FieldDefaultWhat it does
enabledtrueTurn callouts on or off
every{ 240, 480 }Seconds between new calls while anyone is on duty
max_open2Calls open at once
min_distance400.0A new call is at least this far (m) from the officer it's made near...
max_distance2500.0...and no further than this
expire300Seconds a call nobody responds to stays open
offer_window30Seconds the offer card stays up
arrive40.0Metres from the call that count as on scene
build300.0Each person, car and prop is made when a unit gets this close (m)
max_minutes30A call still open after this long is cancelled