> For the complete documentation index, see [llms.txt](https://documentation.rcore.cz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.rcore.cz/paid-resources/rcore_mdt/installation.md).

# Installation

Follow these steps to install `rcore_mdt` for the first time.

## 📋 Prerequisites

Before installing, make sure your server has:

| Requirement        | Notes                                                                                |
| ------------------ | ------------------------------------------------------------------------------------ |
| Framework          | ESX, QBCore, QBX, or Standalone with a completed bridge.                             |
| Database resource  | `oxmysql` is recommended. `ghmattimysql` is also detected.                           |
| `screencapture`    | Needed for every in-game photo.                                                      |
| Image host API key | A [FiveStorage](https://fivestorage.io) or [FiveManage](https://fivemanage.com) key. |

{% hint style="info" %}
`esx_billing`, `rcore_dispatch`, and `rcore_cam` are optional. See [Integrations](https://documentation.rcore.cz/paid-resources/rcore_mdt/integrations.md).
{% endhint %}

## 🛠️ First Time Installation

{% stepper %}
{% step %}

### Download the resource

Download `rcore_mdt` from [CFX Portal](https://portal.cfx.re/assets/).

Download `screencapture` from [GitHub](https://github.com/rcore-cz/screencapture) if your server does not have it yet.
{% endstep %}

{% step %}

### Move the folders

Move both folders into your server 📁`resources` folder.

```
📁 server
└── 📁 resources
    ├── 📁 screencapture
    ├── 📁 rcore_mdt
    └── 📁 other resources
```

{% endstep %}

{% step %}

### Set your framework

Open `configs/sh_config.lua` and set your framework:

```lua
CONFIG.Framework = Framework.ESX
```

Use `Framework.ESX`, `Framework.QBCore`, `Framework.QBox`, or `Framework.Standalone`. See [Framework](https://documentation.rcore.cz/paid-resources/rcore_mdt/integrations/framework.md).
{% endstep %}

{% step %}

### Set up your departments

Every job that can use the MDT needs an entry in `CONFIG.JOBS` inside `configs/sh_config.lua`. The key must match the job name in your framework.

The default config includes `police`, `sheriff`, `ambulance`, and `mechanic`. See [Add Jobs](https://documentation.rcore.cz/paid-resources/rcore_mdt/configuration/add-jobs.md).
{% endstep %}

{% step %}

### Set up photo uploads

Open `configs/sv_config.lua`, choose your image host, and add your API key:

```lua
SV_CONFIG.ImageUpload = {
    Provider = 'fivestorage', -- 'fivestorage' or 'fivemanage'

    FiveStorage = {
        Url    = 'https://api.fivestorage.io/api/v1/images',
        ApiKey = 'YOUR_API_KEY',
    },

    FiveManage = {
        Url    = 'https://fmapi.net/api/v2/image',
        ApiKey = 'YOUR_API_TOKEN',
    },
}
```

{% endstep %}

{% step %}

### Ensure the resources

Add the resources to `server.cfg` after your database, framework, and optional integrations.

```cfg
ensure oxmysql
ensure es_extended
ensure screencapture
ensure rcore_dispatch
ensure rcore_cam
ensure rcore_mdt
```

Remove the lines for resources you do not use.
{% endstep %}

{% step %}

### Create your penal code

Start the server and open the MDT with `/mdt`.

The MDT does not include default penal codes. Open the **Penal Code** screen and add your charges. Only ranks with the `penal_codes` permission can do this. By default, that is the highest rank of each department.
{% endstep %}
{% endstepper %}

## 🗄️ Database

`rcore_mdt` creates its own database tables automatically on startup. You do not need to import an SQL file.

Civilians and vehicles are read from your framework's existing tables. See [Database](https://documentation.rcore.cz/paid-resources/rcore_mdt/integrations/database.md).
