# Installation Guide

{% stepper %}
{% step %}

### 1. Codesign Bridge

{% hint style="success" %}

#### Framework, Database, and Integration Handling

**This resource requires `cd_bridge` to be installed and running before it can function.**

`cd_bridge` is **drag-and-drop** and requires **no configuration or file editing**.

It handles framework connections, database setup, and error handling behind the scenes. When the bridge starts, it automatically detects and initializes all compatible resources — including all Codesign scripts and any Codesign-compatible scripts you have installed.

**For installation instructions, see the** [**👉 full bridge setup guide →**](https://docs.codesign.pro/paid-scripts/bridge/installation-guide)**.**
{% endhint %}
{% endstep %}

{% step %}

### 2. Download Resource

{% hint style="success" %}

#### Download the Resource from FiveM’s Portal

1. [**👉 Download cd\_dispatch3d →**](https://portal.cfx.re/assets/granted-assets?search=cd_dispatch3d)
2. Unzip the downloaded file
3. In your server’s `resources` directory, **create a folder named `[codesign]` if it does not already exist**
4. Place **`cd_dispatch3d`** (and all other Codesign resources) inside the **`[codesign]`** folder
   {% endhint %}

<div align="left" data-with-frame="true"><figure><img src="https://789235289-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MSKsM-AnxI2icNixJI8%2Fuploads%2FfLcUCD4Ce2PQZM1lEUJ2%2Fimage.png?alt=media&#x26;token=d9db6f2f-4b00-4e74-87fc-b7d5ace2ea29" alt=""><figcaption><p>Example resources folder with a <code>[codesign]</code> directory</p></figcaption></figure></div>
{% endstep %}

{% step %}

### 3. Configure Resource

{% hint style="success" %}

#### Review and Adjust config.lua Options

You must review all configurable options in `[cd_dispatch3d/configs/config.lua]` and adjust them to suit your server’s needs.

\
Be sure to read the **commented help text** at the end of each line — it explains the purpose of each configuration option.

<img src="https://789235289-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MSKsM-AnxI2icNixJI8%2Fuploads%2FurkjRxUUUtDJpPPUP7fB%2Fimage.png?alt=media&#x26;token=6ae6966d-c853-484d-b68f-c61fcab4abba" alt="" data-size="original">

The most important config options are in the **Important** category at the top of `config.lua`.\
All other settings are optional.

<img src="https://789235289-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MSKsM-AnxI2icNixJI8%2Fuploads%2FFKtHGrG0RQZqwmFqS8Do%2Fimage.png?alt=media&#x26;token=6434e357-ea6d-493e-a1e4-7436ab6bb07a" alt="" data-size="original">
{% endhint %}
{% endstep %}

{% step %}

### 4. Configure Key Binds

{% hint style="success" %}

#### Configure Before Starting the Resource

**Before Starting the Resource**

Before launching this resource on your main or live server, we strongly recommend configuring your **key binds**, as this resource uses [**FiveM’s Key Mapping**](https://docs.codesign.pro/helpful-guides/register-key-mapping) system.

**Where Can I Configure My Key Binds?**

You can configure all key binds directly in `[cd_dispatch3d/configs/config.lua`**]**.

**Why Is This Important?**

Once a player joins your server with this resource running, you can no longer force key bind changes through the config file — players must adjust them manually through the **in-game pause menu settings**.\
However, any changes you make will still apply to new players who join afterward.

This system is more **optimized** and gives players the flexibility to customize their key binds for both **keyboard** and **controller** use.\
You can also review the [**Default Keybinds**](https://docs.codesign.pro/paid-scripts/garage/developer-api/keys) provided with this resource.
{% endhint %}

<div align="left" data-with-frame="true"><figure><img src="https://789235289-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MSKsM-AnxI2icNixJI8%2Fuploads%2FKgp27vGiug6WGuulhAvV%2Fimage.png?alt=media&#x26;token=99b11713-21a0-482b-b4df-f442ff037471" alt=""><figcaption><p>Keybind settings located in the pause menu</p></figcaption></figure></div>
{% endstep %}

{% step %}

### 5. Replace Old Dispatch Alerts

{% hint style="info" %}

#### ℹ️ Notice

Not all dispatch alerts need to be replaced.

`cd_dispatch3d` now supports the following **without any changes**:

* `cd_dispatch` (classic)
* `ps-dispatch`
* `lb-tablet`
* `redutzu-mdt`
* Default ESX police alerts
* Default QBCore police alerts

Only replace alerts if you are using a **custom or unsupported** police alert system.
{% endhint %}

{% hint style="success" %}

### Find the old alert

* <mark style="color:red;">Red</mark> → Old dispatch alert
* <mark style="color:green;">Green</mark> → Old alert replaced with `cd_dispatch3d`

> Not every resource will look the same, but the implementation concept remains identical.

<img src="https://789235289-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MSKsM-AnxI2icNixJI8%2Fuploads%2Fez8641OtzgsUCmUxRW82%2FbRxcgIt.png?alt=media&#x26;token=c9046f70-c1d9-44c7-99f4-2076959094ae" alt="" data-size="original">
{% endhint %}

{% hint style="success" %}

### Having trouble finding the old alert?

#### Trigger the Alert Where the Action Starts!

Dispatch alerts should be triggered **where the event begins**, for example:

* When the robbery starts
* When a crime is committed

❌ **Bad Practice**\
Triggering alerts inside an event that already broadcasts to all police:

* Causes duplicate notifications
* Creates duplicate blips
* Results in dispatch spam

✅ **Good Practice**\
Trigger the alert:

* At the source of the action
* Before any police broadcast or blip creation
* Let `cd_dispatch3d` handle visibility and syncing

![](https://789235289-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MSKsM-AnxI2icNixJI8%2Fuploads%2F948YxZvNXtf36IokSN3m%2FUulUyD4.png?alt=media\&token=cd952dc5-1f91-4d6f-bb5f-1ef3bc42d3d4)Once you’ve found the old dispatch alert to replace, continue with Step 6.
{% endhint %}

{% hint style="success" %}

### Continue with Step 6.

Once you’ve found the old dispatch alert to replace, continue with Step 6.
{% endhint %}
{% endstep %}

{% step %}

### 6.  Add New Dispatch Alerts

{% hint style="info" %}

#### Compatible Integrations by Codesign

On our [**Resource Integration**](https://docs.codesign.pro/paid-scripts/dispatch3d/resource-integration) page, you can find a full list of **pre-integrated and compatible scripts** that work seamlessly with **cd\_dispatch3d** and **MDT integrations**.

🔗 [**View the full list of compatible scripts →**](https://docs.codesign.pro/paid-scripts/dispatch3d/resource-integration)
{% endhint %}

{% hint style="success" %}
{% tabs %}
{% tab title="client-side (recommended)" %}

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

{% endtab %}

{% tab title="server-side" %}

```lua
TriggerEvent('cd_dispatch:AddNotification', {
    job_table = { 'police', 'sheriff' },
    coords = vector3(0, 0, 0),
    title = '10-15 - Store Robbery',
    message = 'A person robbing a store',
    flash = 0,
    sound = 1,
    blip = {
        sprite = 431,
        scale = 1.2,
        colour = 3,
        flashes = false,
        text = '911 - Store Robbery',
        time = 5,
        radius = 0,
    }
})
```

{% endtab %}
{% endtabs %}

#### Player Info Export Reference

The following export is used in the example above:

{% code title="This data structure can be customized in: integrations/client/client\_exports.lua" %}

```lua
local data = exports['cd_dispatch3d']:GetPlayerInfo()
data.ped       -- Player ped ID (e.g., 123456789)
data.coords    -- Player coordinates (vector3)
data.street_1  -- Street name (e.g., "Palomino Ave")
data.street_2  -- Area name (e.g., "Legion Square")
data.street    -- Full location (e.g., "Palomino Ave, Legion Square")
data.sex       -- Ped sex (e.g., "Male")
```

{% endcode %}
{% endhint %}

#### Dispatch Alert Variable Reference

<table data-full-width="true"><thead><tr><th width="146.3333740234375">Variable Name</th><th width="106.9998779296875" data-type="checkbox">Required</th><th>Example</th><th width="541.333251953125">Description</th></tr></thead><tbody><tr><td><strong><code>job_table</code></strong></td><td>true</td><td><code>{'police', 'sheriff}</code></td><td>List of jobs that will receive the dispatch alert.</td></tr><tr><td><strong><code>coords</code></strong></td><td>true</td><td><code>vec3(0.0, 0.0, 0.0)</code></td><td>World coordinates where the alert occurred.</td></tr><tr><td><strong><code>title</code></strong></td><td>true</td><td><code>'10-19 Robbery'</code></td><td>Title displayed in the dispatch UI, usually 10 codes.</td></tr><tr><td><strong><code>message</code></strong></td><td>true</td><td><code>'Robbery in progress'</code></td><td>Main description shown to responders.</td></tr><tr><td><strong><code>flash</code></strong></td><td>false</td><td><code>true</code></td><td>Whether the alert flashes on the UI. (<code>true/false</code>)</td></tr><tr><td><strong><code>sound</code></strong></td><td>false</td><td><code>1</code></td><td>Dispatch alert sound.<br>Editable in <code>BlipSound()</code> (<code>client/other/functions.lua</code>).<br><code>1</code> = single alert, <code>2</code> = double alert, <code>3</code> = panic alert.</td></tr><tr><td><strong><code>blip</code></strong></td><td>false</td><td></td><td>Map blip configuration (see below).</td></tr><tr><td><strong><code>blip.sprite</code></strong></td><td>false</td><td><code>431</code></td><td>GTA blip sprite ID - <a href="https://docs.fivem.net/docs/game-references/blips/">More here.</a></td></tr><tr><td><strong><code>blip.scale</code></strong></td><td>false</td><td><code>1.2</code></td><td>Blip size on the map: <code>0.1</code>-<code>2.0</code>.</td></tr><tr><td><strong><code>blip.colour</code></strong></td><td>false</td><td><code>3</code></td><td>Blip color ID - <a href="https://docs.fivem.net/docs/game-references/blips/">More here at bottom.</a></td></tr><tr><td><strong><code>blip.flashes</code></strong></td><td>false</td><td><code>true</code></td><td>Whether the blip flashes. (<code>true/false</code>)</td></tr><tr><td><strong><code>blip.time</code></strong></td><td>false</td><td><code>5</code></td><td>Time until blip fades and deletes (minutes)</td></tr><tr><td><strong><code>blip.radius</code></strong></td><td>false</td><td><code>0</code></td><td>Randomize coords; use a radius blip.<br><code>0</code> disables it, <strong>50–100</strong> recommended.</td></tr></tbody></table>
{% endstep %}
{% endstepper %}
