Kartik Scripts

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

FieldTypeRequiredDescription
titlestringโœ… YesThe title shown in the dispatch alert header.
codestringโœ… YesThe alert code (e.g. 10-71, 10-50, 10-90).
descriptionstringโœ… YesShort textual details of the incident.
coordsvector3โŒ NoCoordinates of the incident.
soundstringโŒ NoFilename of the audio from the custom sounds directory.
typestringโŒ NoDisplay style: "Alert" or "Call". Default: "Alert".
personPersonDataโŒ NoAssociated citizen profile.
weaponWeaponDataโŒ NoWeapon information (if applicable).
blipBlipDataโŒ NoRadius and icon configuration for the map blip.
jobstableโŒ NoSpecific jobs allowed to receive this alert.

PersonData

FieldTypeDescription
namestringFull name of the subject.
phonestringContact phone number.
citizenidstringCitizen identifier.

WeaponData

FieldTypeDescription
namestringWeapon technical name (e.g. WEAPON_CARBINERIFLE).

BlipData

FieldTypeDefaultDescription
radiusnumber0.0Radius of the search/alert area on the map.
spritenumber161Minimap sprite ID.
colornumber1Color ID for the blip.
scalenumber1.0Size scale of the blip.
lengthnumber5Time (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:

  1. Place the Audio File: Copy your custom audio file (e.g., gunshots.ogg or panic.ogg, .ogg or .mp3 format depending on your sound script) into the custom sounds directory of your sound resource:

    • For interact-sound: Place the file in interact-sound/client/html/sounds/.
    • For xsound: Place the file in the appropriate directory or use a URL if configured.
  2. Register the Sound File: Open the fxmanifest.lua of your sound resource (e.g., interact-sound) and make sure the file is registered under the files array so it is sent to the client:

    files {
        'client/html/sounds/gunshots.ogg',
        'client/html/sounds/panic.ogg',
    }
  3. Trigger the Sound in Custom Alerts: In the sound parameter 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.)

On this page