Custom Alert
To trigger a dispatch alert directly from a client-side script, call the export named CustomAlert on the kartik-mdt resource.
๐งฑ Example Usage (Client-Side)
exports['kartik-mdt']:CustomAlert({
title = "Shots Fired",
code = "10-71",
description = "Multiple gunshots heard in the area",
type = "Call", -- "Call" or "Alert"
sound = "gunshots", -- sound file name inside sounds/ directory
coords = vector3(215.5, -810.3, 30.7), -- alert coordinates
person = {
name = "John Doe",
phone = "555-1234",
citizenid = "CIT12345"
},
weapon = {
name = "WEAPON_PISTOL"
},
blip = {
radius = 100.0,
sprite = 161,
color = 1,
scale = 1.2,
length = 5 -- duration in minutes the blip remains on map
},
jobs = {
police = true,
ems = true
}
})๐งฑ Data Structures
AlertData
| Field | Type | Required | Description |
|---|---|---|---|
title | string | โ Yes | The title shown in the dispatch alert header. |
code | string | โ Yes | The alert code (e.g. 10-71, 10-50, 10-90). |
description | string | โ Yes | Short textual details of the incident. |
coords | vector3 | โ No | Coordinates of the incident. |
sound | string | โ No | Filename of the audio from the custom sounds directory. |
type | string | โ No | Display style: "Alert" or "Call". Default: "Alert". |
person | PersonData | โ No | Associated citizen profile. |
weapon | WeaponData | โ No | Weapon information (if applicable). |
blip | BlipData | โ No | Radius and icon configuration for the map blip. |
jobs | table | โ No | Specific jobs allowed to receive this alert. |
PersonData
| Field | Type | Description |
|---|---|---|
name | string | Full name of the subject. |
phone | string | Contact phone number. |
citizenid | string | Citizen identifier. |
WeaponData
| Field | Type | Description |
|---|---|---|
name | string | Weapon technical name (e.g. WEAPON_CARBINERIFLE). |
BlipData
| Field | Type | Default | Description |
|---|---|---|---|
radius | number | 0.0 | Radius of the search/alert area on the map. |
sprite | number | 161 | Minimap sprite ID. |
color | number | 1 | Color ID for the blip. |
scale | number | 1.0 | Size scale of the blip. |
length | number | 5 | Time (in minutes) after which the blip will automatically disappear. |
๐ Setting up Custom Sounds
MDT Dispatch V2 supports playing custom alert sounds through sound scripts such as interact-sound or xsound. If a sound bridge is detected, passing a sound parameter will trigger that sound script.
How to Add Sound Files:
-
Place the Audio File: Copy your custom audio file (e.g.,
gunshots.oggorpanic.ogg,.oggor.mp3format depending on your sound script) into the custom sounds directory of your sound resource:- For
interact-sound: Place the file ininteract-sound/client/html/sounds/. - For
xsound: Place the file in the appropriate directory or use a URL if configured.
- For
-
Register the Sound File: Open the
fxmanifest.luaof your sound resource (e.g.,interact-sound) and make sure the file is registered under thefilesarray so it is sent to the client:files { 'client/html/sounds/gunshots.ogg', 'client/html/sounds/panic.ogg', } -
Trigger the Sound in Custom Alerts: In the
soundparameter of your custom alert payload, pass the filename without the file extension:sound = "gunshots" -- triggers gunshots.ogg
(Note: If no custom sound bridge is active, or if the sound parameter is omitted, the script safely falls back to playing the default GTA frontend beep.)