Koja Scripts

Settings keys

Reference of every koja-dispatcher settings key for GetSetting and SetSetting: type, range or values, default, admin group and effect.

Settings keys

Every key below can be read with GetSetting(key) and changed with SetSetting(key, value). Admins change the same keys in game with /dispatchadmin (groups in Config.Admin.groups or the ACE koja-dispatcher.admin). Changes are saved in the koja_dispatch_settings table and survive restarts; until something is saved, the defaults come from the config files.

server.lua
local dispatch = exports['koja-dispatcher']
print(dispatch:GetSetting('calls.patience'))            -- 45
local ok, err = dispatch:SetSetting('calls.patience', 60)

Value rules

TypeSetSetting acceptsNotes
booltrue or falseStrings like 'true' are rejected with invalid.
intany numberRounded, then clamped to the range.
numberany numberClamped to the range. The step is only used by the admin slider.
enumone of the listed stringsExact match, otherwise invalid.

Every change fires the settingChanged hook and event. GetSetting returns nil for an unknown key.

Core

The core keys are shown on the Modes, Calls, Units, Pay, Features and Integration pages of the admin menu.

KeyTypeRange or valuesDefaultEffect
mode.callsenumgenerated, real, mixedmixed (Config.Modes.calls)Where calls come from. generated: only AI callers; player and API calls skip the console. real: only players, sensors, API and MDT; no generated calls.
mode.unitsenumai, players, mixedmixedWhich units exist. ai: no player units. players: AI units go offline.
mode.noDispatcherenumreject, auto, mdtrejectWhat the call router does when nobody is on shift.
access.maxDispatchersint0 to 320Dispatchers on shift at once. 0 = no limit.
access.remoteboolfalse (Config.Dispatcher.remote)Allowed jobs can open the CAD anywhere with /cad.
calls.intervalMinint10 to 600 s35Shortest gap between generated calls.
calls.intervalMaxint10 to 900 s80Longest gap between generated calls.
calls.maxRingingint1 to 124No new generated call while this many ring.
calls.maxActiveIncidentsint1 to 5010No new generated call while this many incidents are active.
calls.patienceint15 to 300 s45How long a generated caller waits before hanging up (missed call).
calls.playerReplyWindowint30 to 900 s180How long a player's 911 line stays open for follow-up messages.
calls.perDispatcherSpeedupnumber0 to 1, step 0.050.15Calls come this much faster for every extra dispatcher.
units.disableWhenPlayersint0 to 323AI units of a department go off duty when this many players of it are on duty. 0 = never.
pay.enabledbooltruePay dispatchers when a shift ends.
pay.perMinuteint0 to 10006Money per minute on shift.
pay.perPointint0 to 1002Bonus per score point.
pay.minimumMinutesint0 to 1203Shorter shifts are not paid.
pay.maximumint0 to 1 000 00015000Cap per shift. 0 = no cap.
features.cinematicbooltrueCamera fly-in when a dispatcher clocks in.
features.aiCallersboolfalse (Config.AI.enabled)Live AI voice callers (needs the OpenAI / ElevenLabs keys).
features.sensorDownedbooltrueA call when a player stays down.
features.sensorShotsbooltrueA call when someone shoots in the city.
features.sensorCrashbooltrueA call after a heavy vehicle crash.
features.showCiviliansbooltruePlayers without a service job appear on the map.
features.showNpcPedsboolfalseNPC peds on the map (costs performance).
features.fieldScenesbooltrueField units see props and peds at the scene.
features.fieldWaypointbooltrueGPS waypoint for assigned field units.
mdt.enabledbooltrueThe koja-mdt integration as a whole.
mdt.pushIncidentsenumoff, real, allrealSend incidents to the MDT. real: from players, API, manual and MDT. all: also generated calls.
mdt.pullCallsenumoff, calls, incidentscallsMDT calls ring in the CAD (calls) or open as incidents (incidents).
mdt.syncStatusbooltrueUnit status and assignments sync both ways.
mdt.useCallsignsbooltruePlayer units use their MDT callsign.
api.clientAlertsboolfalse (Config.Api.clientAlerts)Allow the client export SendAlert.

Modules

Module keys are registered by the feature files and shown on the Modules page of the admin menu, one group each.

KeyTypeRange or valuesDefaultEffect
career.enabledbooltrueXP, ranks, simultaneous lines, call gates and supervisor powers.
career.xpMultipliernumber0.1 to 5, step 0.11.0Scales XP from score, incidents, codes and instructions.
career.xpTimeMultipliernumber0 to 5, step 0.11.0Scales XP per minute on shift.
career.xpPenaltyMultipliernumber0 to 5, step 0.11.0Scales XP lost for missed calls and failed incidents.
career.gateCallsbooltrueLow ranks cannot answer gated calls (pursuit, hostage, MCI).
career.gateOwnershipbooltrueOnly supervisors can reassign, cancel or reprioritise another dispatcher's incident.
compat.enabledbooltrueAccept alerts from other dispatch scripts.
compat.modeenumcall, incidentcallAlerts ring at the console (call) or go straight to the map (incident).
compat.autoAssignbooltrueIncidents from alerts get the nearest free units at once.
discord.enabledbooltrueDiscord logging (webhooks from server convars).
discord.shiftsbooltrueLog shift start and end.
discord.incidentsbooltrueLog ended incidents.
discord.callsbooltrueLog missed and dropped calls.
discord.adminbooltrueLog setting and admin changes.
discord.eventsbooltrueLog pursuits and mass casualty incidents.
discord.minPriorityint1 to 33Lowest incident priority to log. 3 logs all, 1 only priority 1.
dynamics.eventsbooltrueScenario events during and after calls.
dynamics.stagesbooltrueMulti-stage incidents.
dynamics.weatherbooltrueGenerated calls weighted by in-game hour and weather.
dynamics.strengthnumber0 to 2, step 0.11.0How strong the weighting is. 0 off, 2 double.
fleet.enabledbooltrueAI unit fatigue and damage.
fleet.fatigueRatenumber0 to 30, step 0.56.0Fatigue points an AI unit gains per minute on scene (travel counts about a third).
fleet.restSecondsint15 to 1800180Rest time at the station.
fleet.repairSecondsint15 to 1800240Repair time at the station.
fleet.damageChancenumber0 to 1, step 0.050.25Chance a unit on a violent call gets damaged.
hospitals.enabledbooltrueTransports fill hospital beds (Config.HospitalBeds).
hospitals.turnoverSecondsint30 to 7200600Seconds until an occupied bed frees up.
mdt_status.enabledbooltrueField status codes (keys, /tencode, quick menu). Synced to clients.
mdt_status.hudbooltrueStatus chip on the field unit's HUD. Synced to clients.
mdt_status.backupUnitsint1 to 62Extra units auto-assigned on a backup request.
mdt_status.cooldownint5 to 600 s45Per officer, for backup and the panic fallback.
mdt_status.panicFallbackbooltrueWithout koja-mdt, 10-99 creates a priority 1 incident.
mdt_tools.monitorbooltrueMDT workspace drawer in the CAD (key B).
mdt_tools.boloSourceenumauto, mdt, internalautoWhere BOLOs live (also for CreateBolo). auto: koja-mdt when running, internal otherwise. mdt: refuse new BOLOs while the MDT is down.
mdt_tools.alprbooltrueAlert dispatchers on ALPR hits (ReportPlate, koja-mdt:anpr:hit).
mdt_tools.notifyUnitsbooltrueSend internal BOLOs to on-duty police units.
patrol.enabledbooltruePatrol zones idle AI units drive in.
patrol.maxZonesint1 to 328Maximum patrol zones.
patrol.speedFactornumber0.2 to 1, step 0.050.6AI speed inside a patrol zone.
phones.enabledbooltruePhone calls and texts (PhoneCall, koja-dispatcher:phone:call, supported phones) reach the dispatcher.
phones.resourceenumauto, lb-phone, qs-smartphone-pro, gksphone, npwd, yseriesautoPhone resource; auto takes the first running one in Config.Phones.order.
phones.numberint1 to 99999911Service number players dial or text.
pursuit.enabledbooltruePursuit incidents get a moving suspect vehicle.
pursuit.maxActiveint0 to 102Live pursuits at once; more stay normal incidents.
pursuit.loseSecondsint10 to 30040Suspect is lost after this long without visual.
pursuit.spikesint0 to 103Spike strips per pursuit.
pursuit.roadblocksint0 to 102Roadblocks per pursuit.
pursuit.spikeChancenumber0 to 1, step 0.050.65Chance a spike strip slows the suspect.
pursuit.roadblockChancenumber0 to 1, step 0.050.5Chance the suspect stops at a roadblock.
pursuit.speedFactornumber0.5 to 2, step 0.051.15Suspect speed relative to a patrol car.
pursuit.escalationChancenumber0 to 1, step 0.050.3Chance a suspect flees in a vehicle when a robbery, assault or shooting escalates.
stats.enabledbooltrueStore closed incidents for the heatmap and statistics.
stats.retentionDaysint1 to 36530Older history rows are deleted.
training.enabledbooltrueGuided tutorial from the top bar. Synced to clients.
training.offerFirstShiftbooltrueOffer the tutorial to dispatchers with no finished shifts. Synced to clients.
training.practiceCallsbooltruePrivate practice calls for trainees. Synced to clients.
voice.enabledbooltrueVoice channel between dispatcher and player caller. Turning it off ends every voice call.
voice.providerenumauto, pma-voice, mumble-voipautoVoice resource; auto tries pma-voice first.
voice.channelBaseint1000 to 9 000 00091100First call channel id; the next 900 ids are used.
voice.endOnDispatchbooltrueOff: the caller stays on the line after dispatch until the dispatcher ends it.
voice.allowTransferbooltrueDispatchers can hand the voice call to a player unit.

Module defaults come from the config files in shared/config/ (career.lua, integrations.lua, dynamics.lua, fleet.lua, pursuit.lua, stats.lua, voice.lua). The mdt_status.*, mdt_tools.*, career.xp*, career.gate* and training.* defaults are fixed in code.

Side effects of a change

KeyExtra effect
mode.units, units.disableWhenPlayersPlayer and AI unit membership is re-applied at once.
mode.callsThe generated call timer restarts.
mdt.*, mdt_tools.*The koja-mdt link and BOLO list refresh.
access.remote, features.cinematic, features.fieldScenes, features.fieldWaypoint and the client module keysPushed to every client (koja-dispatcher:client:sync).
career.enabledRank state is pushed to dispatchers.
dynamics.weather, dynamics.strengthThe weather state is re-broadcast.
voice.enabled = falseEvery running voice call ends (reason = 'disabled').

Adding your own setting

Register your own keys with the RegisterSetting export from another resource, or with KOJA.Server.Settings.Register in a file in server/custom/ inside koja-dispatcher. Both appear on the Modules page and work with GetSetting / SetSetting. See Register your own admin setting for the full recipe and the difference between the two.