# Dispatch

* In **client/editable/dispatch.lua you can add your own dispatch function, there's 3 different alerts based on what the player has triggered while inside the house:**
  * door: Triggered when the player fails to lockpick the entry, this will be randomly triggered when failing the minigame to avoid any spam.
  * alarm: Triggered when the player fails to hack the alarm.
  * noise: If the player makes enough noise, cops will receive a call from the neighbors.

```lua
function callCops(type,identifier)
    dbug('callCops(type)', type)
    local coords = GetEntityCoords(cache.ped)
    if type == "door" then
        -- Triggered when player fails to lockpick door

    end
    if type == "alarm" then
        -- Triggered when house alarm doesn't get hacked in time

    end
    if type == "noise" then
        -- Triggered when noise bar gets red color

    end
    -- Default dispatch notification and blip
    TriggerServerEvent('av_houserobbery:sendDispatch', coords, type, identifier or currentIdentifier)
end
```


---

# 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.av-scripts.com/guides/house-robbery/dispatch.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.
