Dispatch (server)

Server-side dispatch alerts that route through the configured provider (Config.Dispatch). Client scripts should not call bridge.dispatch — see client.

Access via bridge.dispatch.

Prefer on-duty players via bridge.framework.getPlayersOnDuty when the framework supports it; otherwise falls back to getPlayersByJob.

sendAlert(src, jobs, coords, data, blip, alertFlash)

Signature: sendAlert(src: number, jobs: string | string[], coords: vector3, data?: table, blip?: table, alertFlash?: boolean): boolean

ParamTypeDescription
srcnumberCaller source (for logging / provider context)
jobsstring | string[]Job names to alert (defaults to { 'police' })
coordsvector3World position for the alert
datatable?{ title?, description?, code?, length?, icon? }
bliptable?{ sprite?, colour?, scale?, flash?, radius?, length?, text? }
alertFlashboolean?Flash the blip

| Returns | booleantrue if at least one eligible player was found (internal provider); provider adapters may always return success after forwarding |

RegisterNetEvent('MyStore:Server:RobberyStarted', function(storeCoords)
    local src = source
    local ped = GetPlayerPed(src)
    if ped == 0 or not DoesEntityExist(ped) then return end
 
    bridge.dispatch.sendAlert(src, { 'police', 'sheriff' }, storeCoords, {
        title = 'Store Robbery',
        description = 'Armed robbery in progress',
        code = '10-31',
        length = 12,
        icon = 'store',
    }, {
        sprite = 161,
        colour = 1,
        scale = 1.2,
        text = 'Robbery',
    }, true)
end)

Single job string

bridge.dispatch.sendAlert(src, 'police', coords, {
    title = 'Shots Fired',
    code = '10-71',
    description = 'Gunshots reported nearby',
})