addDispatchToMDT

Server side -- Example code: (Needs your own edits to get coords, street etc.)

    TriggerEvent('redutzu-mdt:server:addDispatchToMDT', {
        code = '10-14',
        title = 'Carjacking',
        street = 'Street name',
        weapon = 'Assault Rifle (AK47)',
        gender = 'Male',
        vehicle = {
            data.name = 'Infernus',
            data.plate = 'ABC123',
            data.doors = 'four door',
            data.color = 'Dark Blue (Metalic)',
            data.class = 'Sports'
        },
        duration = Config.Dispatch.DefaultAlertDuration, -- in miliseconds
        coords = {
            x = 0.0,
            y = 0.0,
            z = 0.0
        }
    })

Client side -- -- Example code: (Needs your own edits to get coords, street etc.)

function onDriveBy(ped)
    local coords = GetEntityCoords(ped)
    local street = GetStreetNameFromCoords(coords)
    local weapon = GetWeaponName()
    local gender = Framework.GetPlayerGender()
    local vehicle = GetVehiclePedIsIn(ped, false)
    local data = GetVehicleInfo(vehicle)

    TriggerServerEvent('redutzu-mdt:server:sendDispatchMessage', {
        code = 'driveby',
        coords = coords,
        street = street,
        weapon = weapon,
        gender = gender,
        vehicle = data
    })
end

Last updated