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

# Installation

Requirements, database, photo storage and items for ALT0 MDT.

## Requirements

| Resource                                                                      | Notes                                                                                                       |
| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| Qbox (`qbx_core`), QBCore (`qb-core`) or ESX (`es_extended`)                  | Found automatically, or set `Config.Framework`. See [Frameworks](/alt0-docs/getting-started/frameworks.md). |
| [ox\_lib](https://github.com/overextended/ox_lib)                             | Required                                                                                                    |
| [oxmysql](https://github.com/overextended/oxmysql)                            | Required                                                                                                    |
| [ox\_inventory](https://github.com/overextended/ox_inventory) or qb-inventory | On ESX, ox\_inventory. Found automatically, or set `Config.Inventory`.                                      |
| [FiveManage](https://fivemanage.com) account                                  | Photo storage for mugshots, vehicle photos and evidence. A free account works.                              |

Optional, detected automatically:

| Resource           | What it adds                                                                                |
| ------------------ | ------------------------------------------------------------------------------------------- |
| `alt0-dispatch`    | Calls and unit status (included with the MDT). Without it, the MDT keeps its own call list. |
| `alt0-bank`        | Fines as bank invoices, the Fines page and the financial audit                              |
| `alt0-camerautils` | Camera photos as evidence                                                                   |
| `alt0-prison`      | Jail time from processing                                                                   |
| `sd-phone`         | The Citizen Services phone app                                                              |

Without ALT0 Bank, fines are charged straight from the citizen's bank (Renewed-Banking or the framework). To use another billing or prison script, see [Integrations](/alt0-docs/alt0-mdt/integrations.md).

## 1. Add the resources

```cfg
ensure ox_lib
ensure oxmysql
ensure ox_inventory    # or qb-inventory
ensure qbx_core        # or qb-core / es_extended
ensure alt0-dispatch
ensure alt0-mdt
```

## 2. Database

Import `mdt.sql` and `medic.sql` once. Newer tables (cases, evidence, BOLOs, personnel files and so on) are created automatically on first start.

## 3. FiveManage key

In the FiveManage dashboard, create a **Media** token and put it in `config_server.lua`:

```lua
ServerConfig.FiveManageKey = "your-token"
```

Or set it in `server.cfg` instead:

```cfg
set alt0_mdt_fivemanage_key "your-token"
```

The key stays on the server. Players only ever receive one-time upload links.

## 4. Items

Add to `ox_inventory/data/items.lua`. Each item opens its terminal when used:

```lua
['policemdt']    = { label = 'Police MDT',   weight = 1000, stack = false, close = true },
['sheriffmdt']   = { label = 'Sheriff MDT',  weight = 1000, stack = false, close = true },
['emsmdt']       = { label = 'EMS MDT',      weight = 1000, stack = false, close = true },
['police_badge'] = { label = 'Police Badge', weight = 100,  stack = false, close = true },
['sheriff_badge'] = { label = 'Sheriff Badge', weight = 100, stack = false, close = true },
['ems_badge']    = { label = 'EMS Badge',    weight = 100,  stack = false, close = true },
```

Any badge item works for any agency: the badge shown follows the holder's job (police shield, sheriff star or EMS Star of Life). `pdbadge` also works, for older badge items. The list is `Config.BadgeItems`.

For the evidence locker, add the two evidence bags as well. Officers take empty bags at the station and bag casings into filled ones (the names are set in `Config.Evidence`):

```lua
['empty_evidence_bag']  = { label = 'Empty Evidence Bag',  weight = 200 },
['filled_evidence_bag'] = { label = 'Filled Evidence Bag', weight = 200 },
```

### qb-inventory

Add them to `qb-core/shared/items.lua` (QBCore already has both evidence bags; `filled_evidence_bag` must stay `unique = true`):

```lua
policemdt    = { name = 'policemdt', label = 'Police MDT', weight = 1000, type = 'item', image = 'tablet.png', unique = true, useable = true, shouldClose = true, description = '' },
sheriffmdt   = { name = 'sheriffmdt', label = 'Sheriff MDT', weight = 1000, type = 'item', image = 'tablet.png', unique = true, useable = true, shouldClose = true, description = '' },
emsmdt       = { name = 'emsmdt', label = 'EMS MDT', weight = 1000, type = 'item', image = 'tablet.png', unique = true, useable = true, shouldClose = true, description = '' },
police_badge = { name = 'police_badge', label = 'Police Badge', weight = 100, type = 'item', image = 'police_badge.png', unique = true, useable = true, shouldClose = true, description = '' },
sheriff_badge = { name = 'sheriff_badge', label = 'Sheriff Badge', weight = 100, type = 'item', image = 'police_badge.png', unique = true, useable = true, shouldClose = true, description = '' },
ems_badge    = { name = 'ems_badge', label = 'EMS Badge', weight = 100, type = 'item', image = 'police_badge.png', unique = true, useable = true, shouldClose = true, description = '' },
```

{% hint style="info" %}
**ESX** needs ox\_inventory for the evidence. The MDT reads characters and vehicles from `users` and `owned_vehicles` through two views it creates on start, and licences from esx\_license. **QBCore:** turn off qb-policejob's own evidence and casings if you use the MDT's.
{% endhint %}

## 5. Set up your agencies

Open `config.lua` and check `Config.Jobs`: it maps your job names to the police, sheriff and EMS sides. Then review the [permissions](/alt0-docs/alt0-mdt/permissions.md). Everything else works with the defaults.

## Next

* [Configuration](/alt0-docs/alt0-mdt/configuration.md)
* [Install ALT0 Dispatch](/alt0-docs/alt0-dispatch/installation.md)
