Skip to main content
Every alert in the MDT is a dispatch call: it shows up as a toast, in the call list, on the map, and as a blip in game. Calls come from three places:
  • The MDT itself: automatic alerts (shooting, speeding, deaths…), the panic and backup buttons, radar plate hits and CCTV cameras.
  • Your own scripts, through the CreateDispatchCall export.
  • A third-party dispatch script, whose calls are synced into the MDT.

Pick your dispatch

Config.Dispatch.Script in config/config.lua decides who handles alerts.
Use one dispatch only. Picking a third-party one turns the built-in dispatch off, so officers never get the same alert twice.

Built-in dispatch

The MDT raises every alert itself: automatic detection, panic and backup, radar hits, cameras and the calls your scripts send. The included robbery add-ons (qb-robberies, rainmad, wasabi, 0r-heistpack in server/custom/dispatch/default/) also turn their alerts into calls.

Third-party dispatch

The third-party dispatch raises every alert, the MDT’s own ones too:
  • Panic, backup, radar plate hits, camera alerts and calls from the CreateDispatchCall export are sent to that dispatch, so its popup shows them.
  • Every call that dispatch handles is synced into the MDT: the call list, the map and blips. Officers can respond to it in the MDT like any other call.
  • The MDT’s automatic detection and the robbery add-ons are off, that dispatch has its own.
Config.Dispatch.ExternalNotifications only decides whether the MDT also shows its own toast for those calls:
When a dispatch can’t raise panic and backup, the MDT hides those buttons and their keybinds, so an officer never presses a panic button that nobody sees. Alerts that can’t be sent, such as a camera destroyed by an NPC with cd_dispatch, still appear in the MDT.
The blip of each alert sent to cd_dispatch, ps-dispatch and rcore_dispatch is set in the BLIPS table of its file in client/custom/dispatch/ or server/custom/dispatch/.
When a call from your dispatch can’t be added to the MDT, the server console warns [dispatch] call from ... not added to the MDT with the reason. Calls for jobs left out of Config.Dispatch.Alerts are skipped without a warning.

Mini dispatch panel

The mini dispatch panel (F6 by default) works with every dispatch. If your server doesn’t use it, remove it:
You can also turn it off in Admin > Interface > In-game menus. It closes right away for everyone, and turning it back on brings its key back on each player’s next join.

Send a call from your script

CreateDispatchCall is a server export. It works with every dispatch: with the built-in one it creates the call, with a third-party one it sends the alert to that dispatch and syncs it into the MDT. You never have to change your script when you switch dispatch.
Passing the robber’s source is all it takes: the call is placed where they stand, and the street is filled in for you.

From a client script

Most robbery scripts call the police from the client. Exports are per side, so send a server event from your client script and create the call there:
Players can trigger any server event themselves. Check on the server that the player really is robbing that store before you create the call, for example with your robbery’s own state.

A call with no player

Pass coords and leave out source, for alarms, NPC reports or timed events:

Payload

details takes any of these fields:

Return

The same player can create one call every 1.5 seconds. Cooldowns per alert type are up to your script.

Style a new alert type

Give your type an entry in Config.Dispatch.Alerts to set its blip and behavior:

React to calls

To follow calls in another script, such as a tablet or an EMS resource, listen to the dispatch events, such as redutzu-mdt:dispatch-call:created. To manage calls, use the other dispatch exports: AttachUnitToDispatchCall, ResolveDispatchCall, AddDispatchCallNote…

Connect another dispatch

For a dispatch script that isn’t in the table above, set Script = 'custom' and fill in server/custom/dispatch/custom.lua. An integration does two things:
  1. Sync its calls into the MDT: listen to the event it fires for every new call.
  2. Send the MDT’s own alerts to it: panic, backup, radar hits and cameras. Without this, panic and backup are hidden.
The supported integrations in server/custom/dispatch/ are complete working examples: rcore_dispatch.lua for a dispatch with a server API, ps-dispatch.lua with client/custom/dispatch/ps-dispatch.lua for one with a client API.
1

Select it

In config/config.lua:
2

Sync its calls into the MDT

Find the event your dispatch fires for every new alert, usually the one other scripts trigger to send an alert, and pass each call to DispatchCalls.mirror:
server/custom/dispatch/custom.lua
The payload is the same as CreateDispatchCall. Always pass { from = source }: when the MDT sends one of its own alerts to your dispatch (next step), that’s how the copy coming back is matched to the existing call instead of being added twice.RegisterServerEvent adds a handler next to your dispatch’s own, it doesn’t replace it.
3

Send the MDT's alerts to it

Register a sender. It receives every alert the MDT raises and calls your dispatch’s API. Return false when it couldn’t send it.
For a dispatch with a server export or event:
server/custom/dispatch/custom.lua
If your dispatch has its own panic or backup feature, use it for officer_panic and request_backup like above, its popup and sound fit it best.
4

Sync responders (optional)

If your dispatch fires an event when an officer responds, attach their unit to the MDT call. Keep the id DispatchCalls.mirror returned:
5

Test it

Restart the server and check, on duty:
  • An alert from your dispatch shows up once in the MDT call list and on the map.
  • The MDT’s panic and backup buttons show your dispatch’s popup, and the call appears once in the MDT.
  • With ExternalNotifications = false, no MDT toast shows up.
The server console warns Bridge.Dispatch (custom): not implemented until you remove that line at the bottom of custom.lua.

The alert your sender receives