# Resource Integration

## ESX Resources

{% tabs %}
{% tab title="client-side" %}

> The links below will take you to resources from the official ESX GitHub. The highlighted line you will see is the default dispatch alert. All you need to do is replace that line with the code snippet we have provided below. Be sure to customise the [variables ](https://docs.codesign.pro/paid-scripts/dispatch#a-detailed-guide-for-all-variables-used-in-the-dispatch-code-snippet-.)in the event to suit your server's needs.

{% hint style="warning" %}

### Step 1 - Find the default dispatch alert

Click any of the links below and find the highlighted line; this will be the default dispatch alert for that resource - [EXAMPLE](https://i.imgur.com/gmVOi5i.png).
{% endhint %}

* [esx\_ambulancejob](https://github.com/esx-framework/esx_ambulancejob/blob/ef7fdbb44c466079d553df940db5c9874c7bec08/client/main.lua#L187)

{% hint style="warning" %}

### Step 2 - Replace the default dispatch alert

Find the same line in that resource on your server and replace that line with the code snippet provided below.
{% endhint %}

{% code title="Copy and paste this code snippet over the existing police alert." lineNumbers="true" %}

```lua
local data = exports['cd_dispatch']:GetPlayerInfo()
TriggerServerEvent('cd_dispatch:AddNotification', {
    job_table = {'police', }, 
    coords = data.coords,
    title = '10-15 - Store Robbery',
    message = 'A '..data.sex..' robbing a store at '..data.street, 
    flash = 0,
    unique_id = data.unique_id,
    sound = 1,
    blip = {
        sprite = 431, 
        scale = 1.2, 
        colour = 3,
        flashes = false, 
        text = '911 - Store Robbery',
        time = 5,
        radius = 0,
    }
})
```

{% endcode %}

<div data-full-width="false"><figure><img src="/files/AugV78nyflDVncFWmBLL" alt="" width="563"><figcaption><p>Before and after example from a random resource.</p></figcaption></figure></div>

{% hint style="warning" %}

### Step 3 - Customise the variables

Be sure to customise the [variables ](https://docs.codesign.pro/paid-scripts/dispatch#a-detailed-guide-for-all-variables-used-in-the-dispatch-code-snippet-.)in the event to suit your server's needs.
{% endhint %}
{% endtab %}
{% endtabs %}

##

## QBCore Resources

{% tabs %}
{% tab title="client-side" %}

> The links below will take you to resources from the official QBCore GitHub. The highlighted line you will see is the default dispatch alert. All you need to do is replace that line with the code snippet we have provided below. Be sure to customise the [variables ](https://docs.codesign.pro/paid-scripts/dispatch#a-detailed-guide-for-all-variables-used-in-the-dispatch-code-snippet-.)in the event to suit your server's needs.

{% hint style="warning" %}

### Step 1 - Find the default dispatch alert

Click any of the links below and find the highlighted line; this will be the default dispatch alert for that resource - [EXAMPLE](https://i.imgur.com/0qDM9LQ.png).
{% endhint %}

* [qb-drugs](https://github.com/qbcore-framework/qb-drugs/blob/7568f7eb396254b9132b39674634949660fa030e/client/cornerselling.lua#L30)
* [qb-police (anpr)](https://github.com/qbcore-framework/qb-policejob/blob/c9a2ae70015c6eb3d18d38e46ce085d2b8d89d37/client/anpr.lua#L36)
* [qb-ambulancejob (1)](https://github.com/qbcore-framework/qb-ambulancejob/blob/2ff1e377446d238bd1494e019b03c55ab2f4c964/client/dead.lua#L54)
* [qb-ambulancejob (2)](https://github.com/qbcore-framework/qb-ambulancejob/blob/2ff1e377446d238bd1494e019b03c55ab2f4c964/client/dead.lua#L189)
* [qb-ambulancejob (3)](https://github.com/qbcore-framework/qb-ambulancejob/blob/fc17631680ffe423a0710f76dc19ecb3482c0a51/client/laststand.lua#L70)
* [qb-bakrobbery (fleeca)](https://github.com/qbcore-framework/qb-bankrobbery/blob/ee8f8a1b06dd771bf23b1fcd2d54dab0a07613a5/client/fleeca.lua#L273)
* [qb-bankrobbery (pacific 1)](https://github.com/qbcore-framework/qb-bankrobbery/blob/ee8f8a1b06dd771bf23b1fcd2d54dab0a07613a5/client/pacific.lua#L51)
* [qb-bankrobbery (pacific 2)](https://github.com/qbcore-framework/qb-bankrobbery/blob/ee8f8a1b06dd771bf23b1fcd2d54dab0a07613a5/client/pacific.lua#L93)
* [qb-bankrobbery (paleto)](https://github.com/qbcore-framework/qb-bankrobbery/blob/ee8f8a1b06dd771bf23b1fcd2d54dab0a07613a5/client/paleto.lua#L42)
* [qb-storerobbery (1)](https://github.com/qbcore-framework/qb-storerobbery/blob/d75de7624ff30ccb109dcd2b9c7901e887055b4e/client/main.lua#L90)
* [qb-storerobbery (2)](https://github.com/qbcore-framework/qb-storerobbery/blob/d75de7624ff30ccb109dcd2b9c7901e887055b4e/client/main.lua#L151)
* [qb-storerobbery (3)](https://github.com/qbcore-framework/qb-storerobbery/blob/d75de7624ff30ccb109dcd2b9c7901e887055b4e/client/main.lua#L168)
* [qb-truckrobbery](https://github.com/qbcore-framework/qb-truckrobbery/blob/4c4e2584cf517ec55858d89217877e097be749c6/client/main.lua#L156)
* [qb-jewelery](https://github.com/qbcore-framework/qb-jewelery/blob/b9089a14df852ddaca14773561362f4aa8c77d56/client/main.lua#L80)
* [qb-houserobbery](https://github.com/qbcore-framework/qb-houserobbery/blob/19ba35dac2047d1a6941f82d466033ea5b9891d3/client/main.lua#L90)

{% hint style="warning" %}

### Step 2 - Replace the default dispatch alert

Find the same line in that resource on your server and replace that line with the code snippet provided below.
{% endhint %}

{% code title="Copy and paste this code snippet over the existing police alert." lineNumbers="true" %}

```lua
local data = exports['cd_dispatch']:GetPlayerInfo()
TriggerServerEvent('cd_dispatch:AddNotification', {
    job_table = {'police', }, 
    coords = data.coords,
    title = '10-15 - Store Robbery',
    message = 'A '..data.sex..' robbing a store at '..data.street, 
    flash = 0,
    unique_id = data.unique_id,
    sound = 1,
    blip = {
        sprite = 431, 
        scale = 1.2, 
        colour = 3,
        flashes = false, 
        text = '911 - Store Robbery',
        time = 5,
        radius = 0,
    }
})
```

{% endcode %}

<div data-full-width="false"><figure><img src="/files/lglINYMGyogJhYDsTOCz" alt="" width="563"><figcaption><p>Before and after example from a random resource.</p></figcaption></figure></div>

{% hint style="warning" %}

### Step 3 - Customise the variables

Be sure to customise the [variables ](https://docs.codesign.pro/paid-scripts/dispatch#a-detailed-guide-for-all-variables-used-in-the-dispatch-code-snippet-.)in the event to suit your server's needs.
{% endhint %}
{% endtab %}
{% endtabs %}

##

## Paid Resources

{% hint style="info" %}
Our goal is to get as many resources pre-configured to be compatible with our dispatch, or at the very least; we will try to add them here for you to do yourself.
{% endhint %}

{% tabs %}
{% tab title="Jaksam Robbery Creator" %}
You can find this event in `[robberies_creator/integrations/sv_integrations.lua]`.

{% code title="Fully replace the existing event with this new edited one." %}

```lua
RegisterNetEvent("robberies_creator:alertedPolice", function(coords, message)
    TriggerClientEvent('cd_dispatch:AddNotification', -1, {
        job_table = {'police', },
        coords = coords,
        title = '10-15 - Robbery',
        message = message,
        flash = 0,
        unique_id = tostring(math.random(0000000,9999999)),
        sound = 1,
        blip = {
            sprite = 431,
            scale = 1.2,
            colour = 3,
            flashes = false,
            text = '911 - Robbery',
            time = 5,
            radius = 0,
        }
    })
  end)
```

{% endcode %}

*Be sure to customise the* [*variables* ](https://docs.codesign.pro/paid-scripts/dispatch#a-detailed-guide-for-all-variables-used-in-the-dispatch-code-snippet-.)*in the event to suit your server's needs.*
{% endtab %}

{% tab title="Jaksam Drugs Creator" %}
You can find this event in `[drugs_creator/integrations/sv_integrations.lua]`.

{% code title="Fully replace the existing event with this new edited one." %}

```lua
RegisterNetEvent("drugs_creator:alertedPolice", function(coords, message)
    TriggerClientEvent('cd_dispatch:AddNotification', -1, {
        job_table = {'police', },
        coords = coords,
        title = '10-15 - Drugs',
        message = message,
        flash = 0,
        unique_id = tostring(math.random(0000000,9999999)),
        sound = 1,
        blip = {
            sprite = 431,
            scale = 1.2,
            colour = 3,
            flashes = false,
            text = '911 - Drugs',
            time = 5,
            radius = 0,
        }
    })
  end)
```

{% endcode %}

*Be sure to customise the* [*variables* ](https://docs.codesign.pro/paid-scripts/dispatch#a-detailed-guide-for-all-variables-used-in-the-dispatch-code-snippet-.)*in the event to suit your server's needs.*
{% endtab %}
{% endtabs %}


---

# 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.codesign.pro/paid-scripts/dispatch/resource-integration.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.
