Koja Scripts

Dispatcher

911 dispatcher job for FiveM with an RTS-style CAD, live 2D and 3D map, AI and player units, voiced callers, pursuits, admin menu and koja-mdt integration.

koja-dispatcher

koja-dispatcher is a 911 dispatcher job for FiveM. A player clocks in at a dispatch station, takes emergency calls, questions the callers and commands police, EMS and fire units on a live tactical map, the way you would in an RTS game. It is built on koja-lib, so it runs on ESX, QBCore and Qbox without changes.

Calls can come from generated AI callers with voiced conversations, from real players (/911, phones, other scripts) or both. Units can be an AI fleet that drives the road network, real on-duty players, or both. Everything is set up in game with /dispatchadmin and saved in the database, so most servers never need to touch the config file.

Features

CAD and voiced calls

A full CAD with 911 lines, incidents, units and radio traffic. More than 150 call scenarios with caller conversations, hidden needs, pre-arrival instructions, prank calls and 20 recorded caller voices.

Live 2D and 3D map

Satellite map of San Andreas with every unit, incident and call. A 3D tactical view with terrain, buildings and planned routes.

RTS controls

Box select, shift-click, right-click to send units or stage them, Ctrl+1-9 control groups, follow camera, WASD pan, Tab to cycle incidents.

AI fleet with road routing

Patrol, K9, SWAT, helicopter, ambulances, air ambulance, engines and ladders drive the real road network from their stations, work the scene, transport patients and return to base.

Real players in the loop

/911 text calls with the caller's live position, field units with toasts, GPS, staging points, scenes, 10-codes, backup and panic.

Stations and shift intro

Dispatch stations with an in-world screen, placed in game with a 3D gizmo. A cinematic camera fly-in and boot screen when a shift starts.

Admin menu and modes

Modes, stations, jobs, limits, pay, features, integrations, modules, scenario editor and fleet editor. Saved in the database and applied live.

Pursuits and patrol zones

Live pursuits with a moving suspect, spike strips and roadblocks. Patrol zones that idle AI units patrol.

Incidents that change

Call escalation, multi-stage incidents, weather and time of day weighting, unit fatigue and damage, mass casualty triage and hospital bed capacity.

Voice calls and phones

Private pma-voice or mumble-voip call between the caller and the dispatcher. 911 from lb-phone, npwd and other phones.

koja-mdt integration

Two-way sync of calls, incidents, units and status, field 10-codes, BOLOs and an MDT workspace inside the CAD.

Compatibility and logs

Alerts from ps-dispatch, cd_dispatch, core_dispatch, rcore_dispatch, qs-dispatch and linden_outlawalert. Discord webhook logs.

Ranks, stats and training

Dispatcher ranks with XP and unlocks, statistics with a heatmap and leaderboard, a guided training mode with practice calls.

Developer API

Server and client exports, before and after hooks and events for calls, incidents, units, modes and settings.

Feature list

FeatureWhat it does
CAD and calls911 lines, call console with questions, instructions, classification, priority and planned response. Calls are locked to the dispatcher who answers.
Voiced callers20 caller voices (10 female, 10 male), pre-rendered audio. Optional live AI callers with OpenAI and ElevenLabs.
Live 2D and 3D mapSatellite tiles, unit and incident markers, routes with ETA, civilian and NPC layers, 3D view with terrain and buildings.
RTS controlsSelection, orders, staging, control groups, follow camera, keyboard pan and zoom.
AI fleet19 units on 11 stations by default, A* routing on the game's road network, helicopters fly straight.
Real players/911 text calls, field units on the map, assignments with blip and GPS, /code4, /unitstatus.
StationsIn-world screen over the desk, sit or stand pose, blip, placed with a 3D gizmo from the admin menu.
Cinematic shift introCamera flies from the building to the monitor while the CAD boots. Skippable.
Admin menu and modesCall source, unit source and what happens when nobody is on shift. Every setting saved and applied live.
PursuitsMoving suspect vehicle, units in sight, spike strips, roadblocks, catch or lose.
Patrol zonesDraw polygon or circle zones on the map, idle AI units patrol inside.
Escalation and multi-stage incidentsCallers report new facts during the call, incidents continue with a new stage when one is done.
Weather and timeGenerated calls depend on the in-game hour and weather.
Fatigue and damageAI units tire out and can be damaged on violent calls, then rest or repair at their station.
MCIMass casualty incidents with red, yellow and green patients and a triage board.
HospitalsBed capacity per hospital, diversion, overflow waits.
Voice callsDispatcher and player caller on a private voice channel, mute, hold and transfer to a field unit.
Phones911 calls and texts from lb-phone and npwd, an adapter for qs-smartphone-pro, a generic event for other phones.
Dispatch script compatibilityEvents and export shims of other dispatch scripts become calls or incidents.
Discord logsShifts, incidents, missed calls, admin changes, pursuits and MCI. Webhooks from server convars.
RanksFive ranks with XP, simultaneous lines, pay bonus and call type unlocks.
Stats and heatmapIncident history, KPIs, charts, busiest streets, dispatcher leaderboard and a heatmap layer.
Training modeGuided walkthrough of the CAD with practice calls only the trainee sees.
Scenario and fleet editorsCreate and edit call scenarios and the AI fleet in game.
koja-mdt integrationIncidents and calls both ways, unit status and assignments, callsigns, 10-codes, BOLO, MDT workspace (key B).
Developer APIExports, hooks and events. See the API overview.

Requirements

RequirementNotes
FXServer with Lua 5.4The resource uses lua54 'yes'.
koja-libRequired. Framework bridge, notifications, target and version check.
oxmysqlRequired. Tables are created on start.
ESX, QBCore or QboxOne of them, through koja-lib. Creating a job from the admin menu works on ESX and QBCore.
A target resourceOptional. ox_target, koja-interactions or qb-target. Without one the station shows an [E] prompt.
koja-mdtOptional. See Integrations.
pma-voice or mumble-voipOptional. Needed for voice 911 calls; without it calls stay text.
A phone resourceOptional. lb-phone, npwd, qs-smartphone-pro, or any phone through the generic event.
OpenAI and ElevenLabs keysOptional. Only for live AI callers.

Where to go next

Developer reference: API overview, Server exports, Client exports, Hooks, Events, Examples.