> For the complete documentation index, see [llms.txt](https://docs.lostdev.store/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lostdev.store/races/integrations/dispatch.md).

# Dispatch

Illegal races can alert your dispatch resource so police get a call, the same way any other crime would page them.

## Auto-detected resources

`Config.Dispatch.resource = nil` (default) auto-detects and ships best-effort adapters for:

* `cd_dispatch`
* `ps-dispatch`
* `lb-tablet`
* `tk_dispatch`

{% hint style="warning" %}
These community resources have multiple forks/versions with slightly different event names — **verify alerts actually fire** against your installed version after setup. If they don't, or you use a dispatch resource not in this list, use a custom adapter instead.
{% endhint %}

## Custom adapter

Set `Config.Dispatch.resource = 'custom'` and provide your own function:

```lua
Config.Dispatch = {
    enabled = true,
    resource = 'custom',
    custom = function(alertData)
        -- alertData contains title, message, coords, sprite, color, jobTable, etc.
        -- Call your dispatch resource's own alert function here.
    end,
}
```

## Relevant settings

| Key                                 | Description                                                                                                                       |
| ----------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `Config.Dispatch.enabled`           | Master switch for dispatch alerts.                                                                                                |
| `Config.Dispatch.defaultChance`     | Fallback % chance an illegal race alerts dispatch, used when a route doesn't set its own (`/race_setdispatch` sets it per-route). |
| `Config.Dispatch.jobTable`          | Which jobs receive the alert (default `police`, `sheriff`).                                                                       |
| `Config.Dispatch.title` / `message` | Alert text; `message` supports `%s` for the location.                                                                             |
| `Config.Dispatch.sprite` / `color`  | Blip appearance for the alert on police MDTs/maps.                                                                                |
| `Config.Illegal.dispatch.radius`    | How far (game units) the alert broadcasts from the race location.                                                                 |

Per-route settings — whether a route is illegal at all, its own dispatch chance, and its wanted-crime label — are set through the route creator (`/race_setillegal`, `/race_setdispatch`, `/race_setwantedcrime`), not in `config/config.lua`.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.lostdev.store/races/integrations/dispatch.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
