> ## Documentation Index
> Fetch the complete documentation index at: https://docs.redutzu.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Set up redutzu-mdt on your FiveM server.

## 1. Prepare your database

The MDT needs a modern database engine to create its tables correctly. Use one of these versions or newer:

| Engine | Recommended version |
| - | - |
| [MariaDB](https://mariadb.org/download) | 10.11 LTS or 11.4 LTS |
| [MySQL](https://dev.mysql.com/downloads/mysql/) | 8.4 LTS |

To check your version, run this query in [HeidiSQL](https://www.heidisql.com/):

```sql theme={null}
SELECT VERSION();
```

> [!WARNING]
>
> We strongly recommend HeidiSQL with a standalone MariaDB server instead of XAMPP. XAMPP ships an old, modified MariaDB build that can break parts of the script.

Before you start the script, delete any old MDT tables left behind by another MDT resource (tables whose name starts with **mdt\_**). If a table with the same name already exists, the script can't create its own schema and some features won't work.

> [!NOTE]
>
> Upgrading from redutzu-mdt V2? Keep your tables. The script migrates V2 data automatically on first start.

## 2. Install all dependencies

Download and install the following dependencies:

* **redutzu-mdt-prop** (included with the script)
* [oxmysql](https://github.com/overextended/oxmysql/releases/latest)
* [ox\_lib](https://github.com/overextended/ox_lib/releases/latest)
* Up to date [server artifacts](https://runtime.fivem.net/artifacts/fivem/build_server_windows/master/)

## 3. Add the items

The MDT uses five inventory items. It doesn't create them, so add them to your inventory. The `[items]` folder included with the script has ready-made definitions and images.

| Item | What it does | Setting |
| - | - | - |
| `mdt` | Opens the MDT | `Config.Item` |
| `bodycam` | Turns the officer's bodycam on/off | `Config.Bodycam.Item` |
| `dashcam` | Turns a patrol car's dashcam on/off | `Config.Dashcam.Item` |
| `police_tape` | Ties crime-scene tape | `Config.Police.Scene.TapeItem` |
| `evidence_marker` | Places numbered evidence markers | `Config.Police.Scene.MarkerItem` |

> [tab] ox\_inventory / Qbox
>
> Add the items to `ox_inventory/data/items.lua`:
>
> ```lua ox_inventory/data/items.lua theme={null}
> ['mdt'] = {
>     label = 'Police MDT',
>     weight = 600,
>     stack = false,
>     consume = 0,
>     server = { export = 'redutzu-mdt.mdt' }
> },
> ['bodycam'] = {
>     label = 'Bodycam',
>     weight = 250,
>     stack = false,
>     consume = 0,
>     server = { export = 'redutzu-mdt.bodycam' }
> },
> ['dashcam'] = {
>     label = 'Dashcam',
>     weight = 200,
>     stack = false,
>     consume = 0,
>     server = { export = 'redutzu-mdt.dashcam' }
> },
> ['police_tape'] = {
>     label = 'Police Tape',
>     weight = 200,
>     stack = false,
>     close = true,
>     description = 'Crime-scene tape. Tie it from wall to wall to close off an area.',
>     server = { export = 'redutzu-mdt.police_tape' }
> },
> ['evidence_marker'] = {
>     label = 'Evidence Marker',
>     weight = 100,
>     stack = false,
>     close = true,
>     description = 'Numbered markers for evidence at a crime scene.',
>     server = { export = 'redutzu-mdt.evidence_marker' }
> },
> ```
>
> Copy the images from `[items]/images` to `ox_inventory/web/images`.
>
> > [!WARNING]
> >
> > Keep the `server.export` line. It's how ox\_inventory hands the item to the MDT. The format is `<resource folder>.<item name>`, so update it if you rename the resource or an item.

> [tab] qb-core
>
> Add the items to `qb-core/shared/items.lua`:
>
> ```lua qb-core/shared/items.lua theme={null}
> ['mdt'] = { name = 'mdt', label = 'Police MDT', weight = 600, type = 'item', image = 'mdt.png', unique = true, useable = true, shouldClose = true, description = 'Department-issued tough-book tablet running state police software' },
> ['bodycam'] = { name = 'bodycam', label = 'Bodycam', weight = 250, type = 'item', image = 'bodycam.png', unique = true, useable = true, shouldClose = true, description = 'Department-issued tactical camera for capturing field incidents' },
> ['dashcam'] = { name = 'dashcam', label = 'Dashcam', weight = 200, type = 'item', image = 'dashcam.png', unique = true, useable = true, shouldClose = true, description = 'Front-facing dashboard camera with continuous loop recording' },
> ['police_tape'] = { name = 'police_tape', label = 'Police Tape', weight = 200, type = 'item', image = 'police_tape.png', unique = true, useable = true, shouldClose = true, description = 'Crime-scene tape. Tie it from wall to wall to close off an area.' },
> ['evidence_marker'] = { name = 'evidence_marker', label = 'Evidence Marker', weight = 100, type = 'item', image = 'evidence_marker.png', unique = true, useable = true, shouldClose = true, description = 'Numbered markers for evidence at a crime scene.' },
> ```
>
> Copy the images from `[items]/images` to your inventory's image folder, such as `qb-inventory/html/images`.

> [tab] ESX
>
> Run this query on your database:
>
> ```sql theme={null}
> INSERT INTO `items` (`name`, `label`) VALUES
>     ('mdt', 'Police MDT'),
>     ('bodycam', 'Bodycam'),
>     ('dashcam', 'Dashcam'),
>     ('evidence_marker', 'Evidence Marker'),
>     ('police_tape', 'Police Tape');
> ```
>
> Copy the images from `[items]/images` to your inventory's image folder.

> [!NOTE]
>
> Tape and markers use the Scene page of the interactions menu by default. To use the items too, set `TapeMethod` and `MarkerMethod` to `'item'` or `'both'` in `Config.Police.Scene`, or in **Field** in [`/mdtadmin`](https://docs.redutzu.com/redutzu-mdt/configuration).

## 4. Add the script to your server.cfg

Start the prop resource before the MDT. We suggest you start the MDT last.

```cfg server.cfg theme={null}
ensure redutzu-mdt-prop
ensure redutzu-mdt
```

## 5. Set up uploads

The MDT uploads recordings, screenshots, and gallery images to Fivemanage, Qbox, Discord, or your own provider.

Open `config/config.lua` and choose your provider:

```lua config/config.lua theme={null}
Config.Upload = 'fivemanage' -- 'fivemanage', 'qbox', 'discord' or 'custom'
```

Then open `config/credentials.lua` and paste your key next to that provider:

```lua config/credentials.lua theme={null}
Config.ApiKeys = {
    Fivemanage = 'your-api-key',
    Qbox = nil,
    Discord = nil,
    ...
}
```

| Provider | Key | Where to get it |
| - | - | - |
| Fivemanage | API key | [Fivemanage](https://refer.fivemanage.com/redutzu) |
| Qbox | CDN key | [Qbox dashboard](https://docs.qbox.re/dashboard/cdn) |
| Discord | Channel webhook URL | Channel settings, under Integrations |
| Custom | Your own | Add your logic in `server/custom/upload/custom.lua` |

> [!WARNING]
>
> Never put keys in `config.lua`. Players can read it.

> [!TIP]
>
> Get **20% off for 3 months** on Fivemanage with [our referral link](https://refer.fivemanage.com/redutzu). To be transparent, we earn a small commission from it, which helps us bring you more awesome features.

See [Media uploads](https://docs.redutzu.com/redutzu-mdt/guides/media-uploads.md) for a step-by-step setup of each provider.

## 6. Start the script

Restart your server. The MDT creates its tables on first start, so there's no SQL file to import. If you're upgrading from an older version, the migration converts your existing data automatically.

Once it's running, use [`/mdtadmin`](https://docs.redutzu.com/redutzu-mdt/configuration) in-game to configure the MDT. Changes apply instantly without a restart, sync to every player, and stay intact when you update the script.

> [!NOTE]
>
> `/mdtadmin` opens for the admin and god groups by default, set in `Config.AdminGroups`. On standalone servers, add `add_ace group.admin redutzu_mdt.admin allow` to your server.cfg.

> [card] [Configure the MDT](https://docs.redutzu.com/redutzu-mdt/configuration.md)
>
> See everything you can change from the `/mdtadmin` panel.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.