Kartik Scripts

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

FieldTypeRequiredDescription
coordsvector3โŒCoordinates of the alert. Defaults to the player's current location.
vehiclenumber/tableโŒVehicle entity ID or a preloaded vehicle data table.
titlestringโœ…Title of the alert.
codestringโœ…Alert code (e.g., "10-80").
descriptionstringโœ…Full description of the alert.
soundstringโŒSound to play. Default: "dispatch" (from the sounds/ folder).
typestringโŒAlert type. Default: "Alert". Options: "Alert", "Call".
personPersonDataโŒInformation about the person involved.
weaponWeaponDataโŒWeapon involved in the alert.
blipBlipDataโŒBlip customization for the map.
jobstableโŒJobs to notify. Example: { police = true, ems = true }.

PersonData

FieldTypeDescription
namestringFull name of the person.
phonestringPhone number.
citizenidstringCitizen identifier.

WeaponData

FieldTypeDescription
namestringName of the weapon.

BlipData

FieldTypeDefaultDescription
radiusnumber0Radius of the blip area.
spritenumber0Sprite icon ID.
colornumber0Blip color.
scalenumber1.0Size scaling factor.
lengthnumber0Duration (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
    }
})

On this page