> For the complete documentation index, see [llms.txt](https://tk-scripts.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tk-scripts.gitbook.io/docs/tk_mdt/config.md). Agents can also search and read this documentation through its [MCP server](https://tk-scripts.gitbook.io/docs/~gitbook/mcp).

# Config

Every option in the MDT config files for a FiveM server, with its default and what it changes.

Options are in `config.lua`, except the [server-only settings](#server-only-settings) in `config_sv.lua`.

## Framework and integrations

| Option                    | Default     | What it does                                                                                                                                                                                                                     |
| ------------------------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Config.Framework`        | `'esx'`     | `'esx'` or `'qb'`. Qbox uses `'qb'`.                                                                                                                                                                                             |
| `Config.NotificationType` | `'esx'`     | `'esx'`, `'qb'` or `'mythic'`. Other systems go in `Notify` (see [Editable functions](#editable-functions)).                                                                                                                     |
| `Config.Locale`           | `'en'`      | Language file from `locales/`: `'en'`, `'fi'` or `'fr'`.                                                                                                                                                                         |
| `Config.DebugMode`        | `false`     | Prints debug lines to the F8 and server consoles.                                                                                                                                                                                |
| `Config.Inventory`        | `'default'` | `'ox'` uses `ox_inventory`. `'default'` uses the framework's item functions; on ESX, `WEAPON_` items count as weapons.                                                                                                           |
| `Config.License`          | `''`        | Where profile licences are saved: `'esx'` (`user_licenses`), `'qb'` (`licences` metadata), or `''` for the MDT only.                                                                                                             |
| `Config.Phone`            | `''`        | Phone script for numbers: `'lb'`, `'qs'`, `'gks'`, `'gks2'`, `'high'`, `'yseries'` or `'okok'`. `''` uses the framework's number.                                                                                                |
| `Config.Housing`          | `''`        | Housing script for properties: `'tk'` ([Housing](https://tk-scripts.gitbook.io/docs/tk_housing.md) V1), `'tk_v2'`, `'qb'`, `'qbx'`, `'ps'`, `'loaf'`, `'qs'`, `'cylex'`, `'nolag'`, `'bcs'`, `'vms'` or `'rx'`. `''` shows none. |
| `Config.Dispatch`         | `''`        | Copies calls from `'tk'`, `'cd'`, `'qs'`, `'ps'`, `'core'`, `'rcore'` or `'loverp'` dispatch onto the MDT map. `''` shows only calls sent with [addCall](https://tk-scripts.gitbook.io/docs/tk_mdt/exports/server.md#addcall).   |
| `Config.Jail`             | `''`        | Jail script for the jail button: `'tk'`, `'pickle'`, `'xt'` or `'rcore'`. Other scripts go in `JailPlayer`.                                                                                                                      |
| `Config.UseOxLib`         | `false`     | Uses ox\_lib text UI. Needs `shared_script '@ox_lib/init.lua'` in `fxmanifest.lua`.                                                                                                                                              |
| `Config.UseOxTarget`      | `false`     | Uses `ox_target` at MDT and police report locations instead of key prompts.                                                                                                                                                      |
| `Config.BPS`              | `500000`    | Bytes per second for the first data transfer when the MDT opens. Lower it if the server lags or players crash on first open.                                                                                                     |

## Interface

| Option                                   | Default               | What it does                                                                             |
| ---------------------------------------- | --------------------- | ---------------------------------------------------------------------------------------- |
| `Config.UISettings.color`                | `'blue'`              | Primary colour, a [Mantine v6 colour](https://v6.mantine.dev/theming/colors/) name.      |
| `Config.UISettings.shade`                | `6`                   | Shade, 1 (lightest) to 9 (darkest).                                                      |
| `Config.UISettings.scheme`               | `'dark'`              | `'dark'` or `'light'`.                                                                   |
| `Config.TabletAnim`                      | tablet idle animation | Animation and prop while the MDT is open: `dict`, `name`, `model`, `bone`, `pos`, `rot`. |
| `Config.MDTNotifications`                | `true`                | Notifications inside the MDT.                                                            |
| `Config.ShowProfileIdentifiers`          | `true`                | Character identifiers on profiles.                                                       |
| `Config.ShowAddLicenseButton`            | `true`                | Add-licence button on profiles.                                                          |
| `Config.ShowRemoveLicenseButton`         | `true`                | Remove-licence button on profiles.                                                       |
| `Config.EnableIncidentExporting`         | `false`               | Button that copies an incident to the clipboard.                                         |
| `Config.NeedItemCommand`                 | `false`               | The MDT command needs one of that MDT's `items`.                                         |
| `Config.UseProfileImagesForEmployeePage` | `false`               | The employees page uses the profile image instead of a separate employee image.          |

## Police report locations

`Config.PoliceReportLocations` lists the spots where citizens file police reports. Remove it to turn the feature off.

| Field      | Default                                        | What it does                   |
| ---------- | ---------------------------------------------- | ------------------------------ |
| `coords`   | `vec4(441.1595, -978.8431, 30.6896, 178.8787)` | Position and heading.          |
| `dist`     | `5.0`                                          | Interaction distance.          |
| `ped`      | `` `s_f_y_cop_01` ``                           | Ped model at the spot.         |
| `scenario` | `'WORLD_HUMAN_COP_IDLES'`                      | Scenario the ped plays.        |
| `page`     | `'police'`                                     | MDT that receives the reports. |

## MDTs

`Config.MDTs` holds one entry per MDT; its key is the MDT name that exports take as `page`. The download has `police` and `ambulance`, plus a commented-out `citizen` MDT that reads police data without write or delete rights.

| Field            | Default (`police`)                              | What it does                                                                                                             |
| ---------------- | ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| `label`          | `'Police'`                                      | Name in the header.                                                                                                      |
| `image`          | not set                                         | Logo URL shown instead of `label`.                                                                                       |
| `color`, `shade` | `'blue'`, `6`                                   | Colour of this MDT. `ambulance` uses `'red'`.                                                                            |
| `jobs`           | `{police = 0, leo = 0, sheriff = 0}`            | Job name and minimum grade that can open it.                                                                             |
| `items`          | `{'pol_mdt'}`                                   | Usable items that open it.                                                                                               |
| `command`        | `'polmdt'`                                      | Command that opens it; leave out for none. See [Commands](https://tk-scripts.gitbook.io/docs/tk_mdt/commands.md).        |
| `locations`      | one spot at `vec4(449.33, -984.9, 30.69, 90.0)` | Spots where job members open it: `coords`, `dist`, `ped`, `scenario`.                                                    |
| `statuses`       | `{'Active', 'Inactive'}`                        | Status choices on the employees page.                                                                                    |
| `licenses`       | `{'Motorcycle', 'Helicopter', 'Investigation'}` | Employee licence choices on the employees page.                                                                          |
| `templates`      | empty texts                                     | Starting text of new incidents, reports, training reports and each report type. HTML tags such as `<br>` and `<b>` work. |
| `reportTypes`    | examples commented out                          | Report types and the other jobs that share them: `arrest = {detective = 0}`. Add each type name to the locale files.     |
| `pages`          | 19 built-in pages                               | Pages in menu order, with the fields below.                                                                              |

Built-in page names: `home`, `profiles`, `vehicles`, `properties`, `businesses`, `incidents`, `reports`, `trainingReports`, `policeReports`, `evidence`, `weapons`, `map`, `charges`, `legislation`, `employees`, `tags`, `permissions`, `logs`, `settings`.

| Page field    | What it does                                                                                   |
| ------------- | ---------------------------------------------------------------------------------------------- |
| `name`        | Built-in page name, or a new name for a custom page.                                           |
| `icon`        | [Tabler icon](https://tabler-icons.io/) component name, such as `'IconHome'`.                  |
| `label`       | Menu name of a custom page.                                                                    |
| `sidebar`     | Sidebar sections, in order.                                                                    |
| `permissions` | Starting `read`, `write` and `delete` rights: job name and minimum grade.                      |
| `components`  | The same rights per part of the `home` and `map` pages, such as `chat`, `warrants` or `calls`. |
| `iframeUrl`   | Website shown inside a custom page.                                                            |
| `onClick`     | Client function run when a custom page is clicked.                                             |
| `dataPage`    | Reads this page's data from another MDT, such as `'police'`.                                   |

The `permissions` page changes rights in game. A page without `permissions` is open to read, write and delete for everyone who can open the MDT. The download has a commented-out `cctv` page that opens [CCTV](https://tk-scripts.gitbook.io/docs/tk_cctv.md).

## Records, dates and licences

| Option                         | Default                                           | What it does                                                                                                                                          |
| ------------------------------ | ------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Config.ExcludedBusinesses`    | `{'unemployed'}`                                  | Jobs left off the businesses page.                                                                                                                    |
| `Config.DateFormat`            | numeric year, 2-digit month, day, hour and minute | [toLocaleString options](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString#options) for MDT dates. |
| `Config.DateLocale`            | `'en-US'`                                         | Locale for those dates.                                                                                                                               |
| `Config.Licenses`              | weapon, driver, fishing, hunting                  | Framework licence name and its MDT label, used when `Config.License` is `'esx'` or `'qb'`. Names must match your framework's.                         |
| `Config.WarrantDuration`       | `30`                                              | Days a warrant stays active.                                                                                                                          |
| `Config.BOLODuration`          | `7`                                               | Days a BOLO stays active.                                                                                                                             |
| `Config.LicensePointsDuration` | `7`                                               | Days licence points last. Remove the line to turn licence points off.                                                                                 |
| `Config.LogDuration`           | `7`                                               | Days MDT logs are kept.                                                                                                                               |

## Controls

`Config.Controls` uses [FiveM control IDs](https://docs.fivem.net/docs/game-references/controls/).

| Option        | Default | What it does                                           |
| ------------- | ------- | ------------------------------------------------------ |
| `interact`    | `38`    | Opens the MDT or the police report form at a location. |
| `takePhoto`   | `38`    | Takes an in-game photo.                                |
| `cancelPhoto` | `177`   | Leaves photo mode.                                     |

## Vehicle colours and weapons

`Config.Colors` maps GTA colour IDs to vehicle colour names in map calls. `Config.Weapons` maps weapon hashes to item names for the caller's weapon in a call; add your custom weapons there.

## Charges

Charges are edited in game on the `charges` page. `Config.Charges` ships commented out; uncommented, it adds each charge whose `name` is not in the database yet when `tk_mdt` starts.

| Field                            | What it does                                                         |
| -------------------------------- | -------------------------------------------------------------------- |
| `name`                           | Charge name.                                                         |
| `class`                          | Class, such as `'Felony'`.                                           |
| `fine`, `sentence`               | `{default = 500, min = 250, max = 750}`: the officer's slider range. |
| `description`, `points`, `color` | Optional.                                                            |
| `page`                           | MDT that gets the charge. Default: `'police'`.                       |

## Server-only settings

| Option                     | Default | What it does                                                                                                                |
| -------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------- |
| `ConfigSV.FivemanageToken` | `''`    | Token for in-game photos. See [Fivemanage setup](https://tk-scripts.gitbook.io/docs/tk_mdt/fivemanage-setup-for-images.md). |
| `ConfigSV.WebhookLink`     | `''`    | Discord webhook for MDT action logs.                                                                                        |

## Editable functions

| File                                                 | Function                                                              | When it runs                                                                | What to put there                                                                                                                              |
| ---------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `client/main_editable.lua`                           | `FinePlayer(data)`                                                    | An officer fines a player.                                                  | Your billing export, with `data.targetIdentifier`, `data.amount` and `data.charges`. Empty in the download: fines do nothing until you add it. |
| `client/main_editable.lua`                           | `JailPlayer(data)`                                                    | An officer jails a player.                                                  | A jail script not in `Config.Jail`, with `data.targetIdentifier` and `data.time`.                                                              |
| `client/main_editable.lua`                           | `TogglePhotoMode(isTakingPhoto)`                                      | Photo mode starts or stops.                                                 | Hide or show your HUD.                                                                                                                         |
| `client/main_editable.lua`                           | `Notify(text, notifyType)`                                            | The client shows a notification.                                            | Another notification system.                                                                                                                   |
| `server/main_editable.lua`                           | `GetPhoneNumber(identifier)`                                          | A profile or employee loads.                                                | A phone script not in `Config.Phone`.                                                                                                          |
| `server/main_editable.lua`                           | `GetPropertiesByIdentifier(identifier)`, `GetProperties(profileData)` | A profile opens; the MDT starts.                                            | A housing script not in `Config.Housing`. Return `{id, name}` entries.                                                                         |
| `server/main_editable.lua`                           | The `Config.Dispatch` blocks                                          | Your dispatch script fires its call event.                                  | Copy one block for a dispatch script not in `Config.Dispatch`.                                                                                 |
| `server/main_editable.lua`                           | `BoloCreated(...)`, `BoloRemoved(...)`                                | A BOLO is added to or removed from a vehicle.                               | Your own code; the arguments include the plate, owner and incident ID.                                                                         |
| `server/main_editable.lua`                           | `GetAdditionalSidebarData(id, page)`                                  | A record opens; `page` is `'profile'`, `'vehicle'`, `'incident'` and so on. | Extra sidebar lists. Add each key to the locale files.                                                                                         |
| `client/frameworks/*.lua`, `server/frameworks/*.lua` | Framework functions                                                   | Always.                                                                     | Changes for a custom framework or character script.                                                                                            |
