# Custom Dispatches

### Integrating with a Different Dispatch System

If you are using a **different dispatch system** instead of the default one, you need to modify the template actions.

> **Answer:**\
> You should check **line 778** in the `templates.lua` file.\
> There is an example of how to integrate with a dispatch system.\
> You can adapt it to your own system as shown below:

```lua
Templates.Action["Fake Gunshot decoy"] = function()
    if GetResourceState("kibra-dispatch") == "started" then
        exports["kibra-dispatch"]:SendAlert("Gunshot", "10-60", "fa-vehicle", {"police"}, 3)
    end
end

Templates.Action["Fake EMS decoy"] = function()
    if GetResourceState("kibra-dispatch") == "started" then
        exports["kibra-dispatch"]:SendAlert("Injured civilian", "10-60", "fa-vehicle", {"ambulance"}, 3)
    end
end
```

📌 **Tip:** Replace `kibra-dispatch` with the name of your own dispatch resource, and adjust the `SendAlert` parameters to match your API.

***

### Notes

* Always restart the resource after making changes in `templates.lua`.
* Ensure your dispatch script is running (`started`) before triggering these events.


---

# Agent Instructions: 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:

```
GET https://docs.0resmon.org/0resmon/s4-resources/s4-flipper-hack-tool/custom-dispatches.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
