> For the complete documentation index, see [llms.txt](https://hane-mod-studio.gitbook.io/hane-mod-studio/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hane-mod-studio.gitbook.io/hane-mod-studio/hane-scripts/hane-dispatch/installation.md).

# Installation

### Step 1 — Download & Extract

1. Download `hane_dispatch` from your Tebex purchase.
2. Extract the `hane_dispatch` folder into your server's `resources` directory.

```
resources/
└── [scripts]/
    └── hane_dispatch/
```

***

### Step 2 — Add to Server Config

Add the following line to your `server.cfg`:

```cfg
ensure ox_lib
ensure hane_dispatch
```

> ⚠️ `ox_lib` must be started **before** `hane_dispatch`.

***

### Step 3 — Configure Framework

Open `shared/config.lua` and set your framework:

```lua
Config.Framework = 'auto' -- auto / qbx / qb / esx
```

* `auto` — Automatically detects your framework (recommended)
* `qbx` — Force QBX Core
* `qb` — Force QBCore
* `esx` — Force ESX

***

### Step 4 — Item Registration (Optional)

If you want to open the dispatch tablet via an inventory item, register the item in your inventory system.

#### ox\_inventory

Add to `ox_inventory/data/items.lua`:

```lua
['dispatch_tablet'] = {
    label = 'Dispatch Tablet',
    weight = 500,
    stack = false,
},
```

Then enable the integration in `shared/config.lua`:

```lua
Config.UseOxInventory = true
Config.TabletItemName = 'dispatch_tablet'
Config.TabletOpenMethod = 'both' -- item / command / both
```

***

### Step 5 — lb-tablet Integration (Optional)

If you use `lb-tablet`, dispatches will automatically forward to the lb-tablet dispatch panel.

```lua
Config.UseLbTablet = true
```

> When enabled, all dispatches will be sent to both the Hane Dispatch UI and lb-tablet simultaneously.

***

### Step 6 — Configure Jobs

Edit the `Config.Jobs` table to match your server's job names:

```lua
Config.Jobs = {
    ['police'] = {
        label = 'Police',
        color = '#3b82f6',
        blipColor = 3
    },
    ['ambulance'] = {
        label = 'EMS',
        color = '#ef4444',
        blipColor = 1
    },
    ['sheriff'] = {
        label = 'Sheriff',
        color = '#22c55e',
        blipColor = 2
    }
}
```

***

### Step 7 — Restart Server

Restart your server or use:

```
ensure hane_dispatch
```

If `Config.Debug` is enabled, you should see the following in your server console:

```
[hane_dispatch] Framework: qbx
[hane_dispatch] Server loaded
[hane_dispatch] Item hook registered
```

***

### ✅ Verification

1. Join the server and set your job to one of the configured jobs.
2. Use the `/dispatch` command or the inventory item to open the tablet.
3. Use `/testdispatch` to trigger a test alert and verify everything works.
