Dispatch Alert
π MDT Alert System β Server Side Trigger
π Event: kartik-mdt:server:sendDispatchNotification
β Usage Example (Server Side)
local dispatchData = {
title = "Shots Fired",
code = "10-71",
description = "Multiple shots fired near Legion Square",
location = "Legion Square",
sound = "dispatch",
x = 215.76,
y = -810.12,
z = 30.73,
type = "Alert", -- or "Call"
person = {
name = "John Doe",
phone = "123-456-7890",
citizenid = "CIT12345"
},
weapon = {
name = "WEAPON_PISTOL"
},
blip = {
radius = 75.0,
sprite = 161,
color = 1,
scale = 1.2,
length = 5 -- in minutes
},
jobs = {
police = true,
ems = true
}
}
TriggerEvent('kartik-mdt:server:sendDispatchNotification', dispatchData)π¦ Payload Structure
AlertData (Table)
| Field | Type | Required | Description |
|---|---|---|---|
title | string | β Yes | The title shown in the dispatch alert. |
code | string | β Yes | The alert code (e.g., 10-71, 10-50). |
description | string | β Yes | A short description of whatβs happening. |
location | string | β Yes | Name of the street/location for the alert. |
x, y, z | number | β Yes | World coordinates for the alert. |
sound | string | β No | File name of the sound from sounds/ folder. Default is "dispatch". |
type | string | β No | Type of alert: "Alert" or "Call". Default is "Alert". |
person | PersonData | β No | Details of the person involved. |
weapon | WeaponData | β No | Details of the weapon involved. |
vehicle | table/number | β No | Vehicle entity or data. |
blip | BlipData | β No | Blip configuration for map. |
jobs | table | β No | Jobs to notify. Example: { police = true, ems = true } |
π§ Tips
- Use this from server-side scripts where an alert should be triggered due to an event (e.g., shooting, car theft, panic button).
- The
vehiclefield can be a numeric vehicle entity ID or a custom table with preformatted data. - Use
blip.lengthto auto-remove the blip after a set number of minutes.
π Related Export
You can also use the client-side export:
exports['kartik-mdt']:CustomAlert(alertData)But for server-side, always use:
TriggerEvent('kartik-mdt:server:sendDispatchNotification', alertData)