Dispatch alerts

Job alerts with details, blips and a waypoint key.

Dispatch alerts are larger cards for police, EMS, fire or any other job. They show in Config.Alerts.Position (top-left by default), apart from notifications.

An alert can have:

  • A code like 10-71, a title and a message
  • A priority: high (Critical), medium (Urgent) or low
  • Up to 6 details, like the suspect or vehicle
  • The street name, found from the coordinates, and a postal
  • A blip on the map
  • A waypoint key
lua
exports.mayo_notify:Dispatch('police', {
    type = 'police',
    code = '10-71',
    title = 'Shots fired',
    message = 'Multiple shots reported near the Vinewood Bowl.',
    priority = 'high',
    coords = coords,
    postal = '7032',
    fields = {
        { label = 'Suspect', value = 'Male, black hoodie' },
        { label = 'Vehicle', value = 'Gray Sultan RS' },
    },
})

Every option is in Server exports.

Who gets an alert

From the server, send an alert to:

  • One player, by server id
  • Everyone, with -1
  • A job, like 'police'
  • A list of jobs, like { 'police', 'sheriff' }

On Qbox and QBCore, job alerts only reach players who are on duty. Set Config.Alerts.OnDutyOnly = false to send them to everyone with the job. On ESX, everyone with the job gets them.

Without a framework, jobs come from ACE. See Permissions.

Setting a waypoint

Alerts with coords show a key at the bottom, G by default. Pressing it sets a waypoint to the latest alert, and the card changes to Waypoint Set. The key works until the alert's time is up.

Players can change the key in Settings > Key Bindings > FiveM, under Set waypoint to the latest alert, and the card shows the key they picked.

Blips

Alerts with coords add a blip, in the type's blip color. It flashes (Config.Alerts.Blip.Flash) and is removed after Config.Alerts.Blip.Time seconds. A single alert can change the sprite, color, scale, label and time, or turn the blip off with blip = false. Turn blips off for every alert with Config.Alerts.Blip.Enabled = false.