> For the complete documentation index, see [llms.txt](https://rayn-scripts.gitbook.io/rayn-scripts-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://rayn-scripts.gitbook.io/rayn-scripts-docs/customizing-and-extending.md).

# Customizing & Extending

Add your own dispatch, framework, targeting or notification integration.

Because `config.lua`, `locales/*.lua`, `server/bridge.lua`, and `client/bridge.lua` are left open, you can extend the script's compatibility layer yourself without needing access to the protected gameplay logic.

## Adding a custom dispatch system

All dispatch logic lives in `server/bridge.lua` — nothing else in the script touches dispatch. There are two ways to add your own:

**Option 1 — generic event hook (no code editing required in this resource at all).** Every alert also fires a plain event:

```lua
TriggerEvent('rayn_boosting:policeAlert', coords, extra)
```

You can add `AddEventHandler('rayn_boosting:policeAlert', function(coords, extra) ... end)` in a completely separate resource of your own and call your dispatch system's API there. This works even if the rest of `rayn_boosting` were encrypted.

**Option 2 — full built-in integration (like the systems already supported).** Add detection and a new branch directly in `server/bridge.lua`:

```lua
-- in detectDispatch():
if GetResourceState('your_dispatch') == 'started' then return 'your_dispatch' end

-- in Dispatch.Alert(coords, extra), alongside the existing elseif branches:
elseif Dispatch.Name == 'your_dispatch' then
    pcall(function()
        exports['your_dispatch']:YourAlertFunction({
            title = alertTitle,
            code  = Config.DispatchAlert.code,
            coords = coords,
            jobs  = Config.DispatchAlert.jobs or { 'police' },
        })
    end)
```

`alertTitle`/`alertText` are already resolved from `Config.DispatchAlert.title`/`.text` earlier in the same function — reuse them rather than re-reading the config.

## Adding a custom framework, targeting system, or notification method

The client-side equivalent lives in `client/bridge.lua`. It exposes three extension points, each following the same pattern as the dispatch example above:

* `detectFramework()` / the `Framework.*` functions — add your framework the same way ESX/QBCore/QBox are detected.
* `Target.AddCircleZone` / `Target.AddEntityZone` / `Target.AddGlobalVehicleZone` — add a branch for your targeting system alongside the existing ox\_target/qb-target ones.
* `Notify()` — add a branch for your notification system alongside the existing ox\_lib/framework/chat fallback chain.

{% hint style="success" %}
None of this requires touching the encrypted files — `client/bridge.lua` is the only place any of this logic lives.
{% endhint %}


---

# 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://rayn-scripts.gitbook.io/rayn-scripts-docs/customizing-and-extending.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.
