Browse docs
Emergency Dispatch
Emergency Dispatch Events
The following events are the supported client-facing lifecycle interface for the Dispatch App. State is server-authoritative; listeners should treat received payloads as read-only.
Events emitted to the client
| Event | Payload | Description |
|---|---|---|
sky_jobs_base:dispatch:stateChanged | table | Signals that incident, unit, center, reporter, or audit state changed. |
sky_jobs_base:dispatch:unitState | table | false | Provides the local player's current dispatch unit, or false after release. |
sky_jobs_base:dispatch:alarm | table | Notifies an assigned unit about an incident and includes map target data. |
State changes
Use stateChanged as a refresh signal. Its type can be incident, unit, unitReleased,
center, reporters, or audit; additional fields depend on that type.
AddEventHandler("sky_jobs_base:dispatch:stateChanged", function(change)
print("Dispatch state changed:", change.type)
end)
Unit state
An active unit payload contains plate, callsign, job, type, statusCode, channel,
frequency, crew, incidentId, and pendingIncidentId.
AddEventHandler("sky_jobs_base:dispatch:unitState", function(unit)
if unit then
print("Current dispatch unit:", unit.callsign)
else
print("Released from dispatch unit")
end
end)
Unit alarms
An alarm payload contains id, number, title, message, callsign, coords,
mapTargetType, and mapTargetId.
AddEventHandler("sky_jobs_base:dispatch:alarm", function(alarm)
print(("%s: %s"):format(alarm.callsign, alarm.message))
end)
Event triggered by the client
sky_jobs_base:dispatch:resolveOwn
Removes all dispatches created by the calling player. Linked Dispatch App incidents are closed at the same time. A common use case is resolving a distress call after the player has been treated.
TriggerServerEvent("sky_jobs_base:dispatch:resolveOwn")