Any script on your server can send an alert to the dispatch: a store robbery, a drug sale, a bank alarm, a tow request. There are two ways to do it — call one of the 35 ready-made alerts with a single export, or build your own call with the qs-dispatch:server:CreateDispatchCall event.
Ready-Made Alerts#
Each alert is a client export with no arguments. It sends a police call at the player's current position, with the right code, message, blip and icon. Call it from the client of the player committing the crime:
-- client side, in your robbery script
exports['qs-dispatch']:StoreRobbery()Export | Code | Alert |
|---|---|---|
| 10-13 | Hunting |
| 10-15 | Vending Drugs |
| 10-16 | Vehicle Shooting |
| 10-17 | Shooting |
| 10-18 | Officer Down |
| 10-20 | Speeding Vehicle |
| 10-21 | Fight |
| 10-22 | Injured Person |
| 10-23 | Deceased Person |
| 10-24 | Store Robbery |
| 10-25 | Fleeca Bank Robbery |
| 10-26 | Paleto Bank Robbery |
| 10-27 | Pacific Bank Robbery |
| 10-28 | Prison Break |
| 10-29 | Vangelico Robbery |
| 10-30 | House Robbery |
| 10-31 | Drug Sale |
| 10-32 | Art Gallery Robbery |
| 10-33 | Humane Labs Robbery |
| 10-34 | Train Robbery |
| 10-35 | Van Robbery |
| 10-36 | Underground Robbery |
| 10-37 | Drug Boat Robbery |
| 10-38 | Union Depository Robbery |
| 10-39 | Yacht Heist |
| 10-40 | Car Boosting |
| 10-41 | Car Jacking |
| 10-42 | Vehicle Theft |
| 10-43 | Suspicious Activity |
| 10-44 | Illegal Racing |
| 10-45 | Kidnapping |
| 10-46 | Cyber Attack |
| 10-47 | Illegal Fishing |
| 10-48 | Arms Deal |
| 10-49 | Sign Robbery |
Every one of them is written in client/custom/exports/exports_1.lua, which you can edit: change a message, send it to the sheriff as well, or copy one to make a new export of your own.
Sending Your Own Call#
For anything not in the list, trigger the server event qs-dispatch:server:CreateDispatchCall with a table describing the call. The usual pattern runs on the client: read the player's position and vehicle with GetPlayerInfo, optionally take a photo with getSSURL, then send the call.
local playerData = exports['qs-dispatch']:GetPlayerInfo()
exports['qs-dispatch']:getSSURL(function(image)
TriggerServerEvent('qs-dispatch:server:CreateDispatchCall', {
job = { 'police', 'sheriff' },
callLocation = playerData.coords,
callCode = { code = '10-90', snippet = 'ATM Robbery' },
message = 'A ' .. playerData.sex .. ' is breaking into an ATM on ' .. playerData.street_1,
flashes = true,
image = image,
blip = {
sprite = 108,
scale = 1.2,
colour = 1,
flashes = true,
text = 'ATM Robbery',
time = (5 * 60 * 1000), -- 5 minutes
},
otherData = {
{ text = 'Armed suspect', icon = 'fas fa-gun' },
}
})
end)local playerData = exports['qs-dispatch']:GetPlayerInfo()
TriggerServerEvent('qs-dispatch:server:CreateDispatchCall', {
job = 'mechanic',
callLocation = playerData.coords,
callCode = { code = 'Tow', snippet = 'Breakdown' },
message = 'A ' .. playerData.vehicle_label .. ' (' .. playerData.vehicle_plate .. ') has broken down',
flashes = false,
blip = {
sprite = 68,
scale = 1.0,
colour = 5,
flashes = false,
text = 'Tow request',
time = (3 * 60 * 1000),
}
})From a server script, use TriggerEvent. The server exports read the player's data from their client, so call them inside a thread:
CreateThread(function()
exports['qs-dispatch']:GetPlayerInfo(source, function(playerData)
TriggerEvent('qs-dispatch:server:CreateDispatchCall', {
job = { 'police' },
callLocation = playerData.coords,
callCode = { code = '10-31', snippet = 'Alarm' },
message = 'Silent alarm triggered at the warehouse',
flashes = true,
blip = {
sprite = 161, scale = 1.5, colour = 1, flashes = true,
text = 'Silent alarm', time = (2 * 60 * 1000),
}
})
end)
end)The Call Fields#
Field | Type | Description |
|---|---|---|
| string or table | Required. Who receives it: |
| vector3 | Required. Where it happened. Must be a |
| table |
|
| string | The description officers read. |
| boolean | Highlights the call card as urgent. |
| string or nil | A picture URL shown on the call — usually the result of |
| table | The map blip — see below. Leave it out for a call with no blip. |
| table | Extra lines on the card, each |
The blip#
Field | Description |
|---|---|
| The blip icon id from the FiveM blip list. |
| Its size — 1.0 is normal. |
| The blip colour id (1 is red). |
| Makes the blip blink. |
| The name shown on the map legend. |
| How long it stays, in milliseconds. It fades out gradually over that time. |
What GetPlayerInfo Returns#
exports['qs-dispatch']:GetPlayerInfo() describes the player who calls it, ready to drop into a message:
Field | Contains |
|---|---|
| The player's position, as a vector3. |
| The street name, and the zone name from |
| "Male" or "Female" from the active locale, or "person" when it cannot be told. |
| The vehicle entity, or nil on foot. |
| The model name, colour and plate — or |
| The vehicle's speed in km/h. |
| The number of doors. |
| The player's ped, and the vehicle's network id (0 on foot). |
Photos need a webhook.
getSSURLreturnsnilwhenConfig.AllowImagesis off orConfig.DiscordWebHookis empty — the call is still sent, just without a picture.
Reacting to Every Call#
Every call created — by a command, an export, the DLC or your own script — passes through OnCallEvent in server/custom/events/onCallEvent.lua. It already posts police and EMS calls to Discord; add anything else there — a phone notification, a log, a counter.
function OnCallEvent(job, callLocation, callCode, message, flashes, image, callId)
if Contains(job, 'police') then
-- your code: SMS to every officer, a log, ...
end
end


