Server Events
These events are received by the zephyr_dispatch server from other resources or clients. Use them to create calls, push auto-alerts, and manage units from external scripts.
zephyr_dispatch:server:NewDispatch (ps-dispatch compatible)
The primary integration point for third-party detection scripts. Any resource that currently uses ps-dispatch’s NewDispatch event works without modification.
The call recipients are inferred from data.jobs / data.job. If neither is set, the resource automatically routes the call to police or EMS based on the call code and content.
TriggerServerEvent('zephyr_dispatch:server:NewDispatch', {
title = '10-90 - Bank Robbery',
message = 'Alarm triggered at Fleeca Bank',
coords = vector3(150.26, -1040.45, 29.37),
street = 'Alta Street',
code = '10-90',
blip = 'bankrobbery', -- blip icon key
priority = true, -- true = P1
jobs = { 'leo' }, -- 'leo' = all police jobs, 'ems' = all EMS jobs
})Parameters
| Field | Type | Description |
|---|---|---|
title | string | Call title shown in the dispatch list. |
message | string | Situation description. Can also be built from gender, weapon, vehicle. |
coords | vector3 | World coordinates for the map blip and GPS. |
street | string | Human-readable location label (shown in the call list). |
code | string | Call code (e.g. '10-90', '10-80'). Auto-inferred if omitted. |
blip | string | Blip icon key for the map blip. |
priority | boolean | true = P1 (high priority). false / omitted = P3. |
jobs | table | Job type array: 'leo' (all police), 'ems' (all EMS), 'all', or specific job names. |
job | string/table | Alternative to jobs. Accepts a specific job name or an array of job names. |
gender | string | Appended to message (e.g. 'Male'). |
weapon | string | Appended to message (e.g. 'WEAPON_PISTOL'). |
vehicle | table | { name, plate, color } — appended to message. |
speed | string | Speed text, appended to message. |
Examples
Shots fired with weapon and suspect description:
TriggerServerEvent('zephyr_dispatch:server:NewDispatch', {
title = 'Shots Fired',
coords = GetEntityCoords(GetPlayerPed(source)),
street = 'Olympic Freeway',
code = '10-71',
blip = 'shooting',
priority = false,
jobs = { 'leo' },
gender = 'Male, black hoodie',
weapon = 'WEAPON_ASSAULTRIFLE',
})Suspicious vehicle with plate:
TriggerServerEvent('zephyr_dispatch:server:NewDispatch', {
title = 'Suspicious Vehicle',
coords = vector3(300.0, -900.0, 30.0),
street = 'Strawberry Avenue',
code = '10-34',
blip = 'suspicious',
jobs = { 'leo' },
vehicle = {
name = 'Sultan',
plate = 'XYZ 1234',
color = 'Black',
},
})EMS-only medical call:
TriggerServerEvent('zephyr_dispatch:server:NewDispatch', {
title = 'Person Down',
message = 'Unconscious male near the clothing store',
coords = vector3(-700.0, -150.0, 37.0),
street = 'Hawick Avenue',
code = '10-52',
blip = 'civdown',
priority = true,
jobs = { 'ems' },
})zephyr_dispatch:createCall (client → server)
Sent by the dispatch client when an officer manually creates a call from the tablet. Can also be triggered from a client script to create a call on behalf of a player.
-- Client-side
TriggerServerEvent('zephyr_dispatch:createCall', {
title = '10-80 - Vehicle Pursuit',
message = 'White Sentinel — Plate: ABC 123 — Heading north on the freeway',
coords = GetEntityCoords(cache.ped),
location = 'Olympic Freeway',
code = '10-80',
codeName = 'pursuitstarted',
priority = 'P2',
job = { 'police', 'sheriff', 'bcso' },
followPrimary = true,
showCallerIdentity = true,
autoAttachSource = true,
})| Field | Type | Description |
|---|---|---|
title | string | Call title. |
message | string | Situation description. |
coords | vector3 | World coordinates. Falls back to the triggering player’s position. |
location | string | Location label for the call list. |
code | string | Call code. |
codeName | string | Blip icon key. |
priority | string | 'P1', 'P2', or 'P3'. |
job | table/string | Job(s) to target. |
followPrimary | boolean | Call blip follows the primary unit (auto-set for pursuit calls). |
showCallerIdentity | boolean | Attach the calling officer’s name/callsign to the call. |
autoAttachSource | boolean | Automatically attach the source player to the call as a responding unit. |
suppressNotify | boolean | Create the call without sending alert toasts. |
zephyr_dispatch:resolveCall
Closes an active call. Only officers whose job is targeted by the call can resolve it.
-- Client-side
TriggerServerEvent('zephyr_dispatch:resolveCall', callId)| Parameter | Type | Description |
|---|---|---|
callId | number | ID of the call to close. |
zephyr_dispatch:registerUnit
Registers a player as an on-duty unit in the dispatch system. Normally called automatically on duty-toggle events. Use this if you have a custom duty system that does not fire QBCore:ToggleDuty.
-- Client-side (fires from the on-duty player's client)
TriggerServerEvent('zephyr_dispatch:registerUnit', {
callsign = '2-A-07',
status = 'Available',
unitType = 'car',
})| Field | Type | Description |
|---|---|---|
callsign | string | Unit callsign to display in the unit tracker. |
status | string | Initial availability ('Available', 'Busy', etc). |
unitType | string | Unit type for the map icon ('car', 'foot', etc). |
zephyr_dispatch:unregisterUnit
Removes the triggering player from the active unit list. Call this when a player goes off duty.
-- Client-side
TriggerServerEvent('zephyr_dispatch:unregisterUnit')zephyr_dispatch:setCallsign
Sets (and persists) a callsign for the triggering player. Sanitised server-side to alphanumeric + dashes, max 20 characters.
-- Client-side
TriggerServerEvent('zephyr_dispatch:setCallsign', '2-A-07')zephyr_dispatch:setAvailability
Changes the availability status for the triggering officer. Valid values: 'Available', 'Busy', 'Unavailable', 'On Break' (also accepts 10-8, 10-7, 10-6 codes).
-- Client-side
TriggerServerEvent('zephyr_dispatch:setAvailability', '10-6')
-- Sets status to 'Busy'zephyr_dispatch:attachUnit
Attaches the triggering officer to a call. Automatically sets a GPS waypoint and, for vehicle pursuits, attaches any other officers in the same vehicle.
-- Client-side
TriggerServerEvent('zephyr_dispatch:attachUnit', callId)zephyr_dispatch:detachUnit
Removes the triggering officer from a responding call. If the officer was the primary unit on a pursuit, primary is re-assigned to the next longest-attached unit.
-- Client-side
TriggerServerEvent('zephyr_dispatch:detachUnit', callId)