Custom Alert
*
CustomAlert(data)
Sends a custom dispatch alert to specified jobs with optional details like location, person, vehicle, weapon, and blip.
๐ฉ Parameters
data
Type: AlertData
Description: Contains all information required for dispatching an alert including coordinates, description, associated person/vehicle, and jobs to notify.
๐งฑ Data Structures
AlertData
| Field | Type | Required | Description |
|---|---|---|---|
coords | vector3 | โ | Coordinates of the alert. Defaults to the player's current location. |
vehicle | number/table | โ | Vehicle entity ID or a preloaded vehicle data table. |
title | string | โ | Title of the alert. |
code | string | โ | Alert code (e.g., "10-80"). |
description | string | โ | Full description of the alert. |
sound | string | โ | Sound to play. Default: "dispatch" (from the sounds/ folder). |
type | string | โ | Alert type. Default: "Alert". Options: "Alert", "Call". |
person | PersonData | โ | Information about the person involved. |
weapon | WeaponData | โ | Weapon involved in the alert. |
blip | BlipData | โ | Blip customization for the map. |
jobs | table | โ | Jobs to notify. Example: { police = true, ems = true }. |
PersonData
| Field | Type | Description |
|---|---|---|
name | string | Full name of the person. |
phone | string | Phone number. |
citizenid | string | Citizen identifier. |
WeaponData
| Field | Type | Description |
|---|---|---|
name | string | Name of the weapon. |
BlipData
| Field | Type | Default | Description |
|---|---|---|---|
radius | number | 0 | Radius of the blip area. |
sprite | number | 0 | Sprite icon ID. |
color | number | 0 | Blip color. |
scale | number | 1.0 | Size scaling factor. |
length | number | 0 | Duration (in minutes) the blip should remain on the map. |
๐ Server Event Triggered
TriggerServerEvent('kartik-mdt:server:sendDispatchNotification', dispatchData)โ Example Usage
exports['kartik-mdt']:CustomAlert({
title = "Shots Fired",
code = "10-71",
description = "Multiple gunshots heard in the area",
type = "Call",
sound = "gunshots",
coords = vector3(215.5, -810.3, 30.7),
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
},
jobs = {
police = true,
ems = true
}
})