> 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_jail.md).

# tk\_jail

Jail for FiveM: prison tasks, trading, escapes, lockup cells and ankle monitors, run by police from a Prison MDT.

Jail is built for police custody and prison time, not for staff jailing rule breakers. It supports ESX, QBCore and Qbox, and also ox\_lib, ox\_inventory, qb-inventory, qs-inventory and ox\_target. You set how much time each finished task spot takes off, which items it pays and where the prison is.

[Advanced Jail System V2 product page](https://tkscripts.com/scripts/jail) | [Watch the showcase on YouTube](https://www.youtube.com/watch?v=VuYm_8GZQGU) | [Install Jail](/docs/tk_jail/installation.md)

{% embed url="<https://www.youtube.com/watch?v=VuYm_8GZQGU>" %}
Jail showcase (6 min 16 s).
{% endembed %}

## Features

### Prison MDT

* Police open it with an item or a command (configurable)
* Send players to jail or lockup
* Set time, jail type, notes and cell, and turn teleporting on or off
* Jailed players list with name and time left
* Change time left, unjail a player or change notes
* Active ankle monitors: show location, edit notes or unlock
* Escaped prisoners with the sentence left and time of escape; remove them once sentenced again

### Prison tasks

* Mugshot animation on sentencing, which can be changed to a switchout animation or turned off
* Six tasks: trash work, electrical work, garden work, serving food, sweeping floors and washing dishes
* Choose tasks from the task board
* Do tasks in groups
* Each completed spot cuts the sentence by a configurable amount
* Optional item rewards for completing tasks
* A bonus reward for every player when the group completes all spots

### Trading, plants and drugs

* Search tables for items set in the config
* Plant growing: buy seeds and a watering can, plant, water and sell the harvest
* Trading for configurable items, paid in jail cigarettes
* Drug making: gather chemicals, buy lab tools from the trader, sell to an NPC
* 16 NPCs with their own lines, from bribable guards to a doctor who sells IFAKs

### Beds, gym, roulette and tattoos

* Jail beds heal players over time
* Gym equipment gives a short speed boost
* Synced roulette tables where everyone bets on red, black or green
* Personal stash that police can search
* Automatic jail clothes (configurable)
* Tattoo maker inside the prison

### Three escape routes

* Explosive: buy one from an NPC, place it, light it with a lighter and escape
* Fences: get a freedom chip or security card, disable the power, dig and cut through
* Digging: sharpen plastic utensils from tasks at an NPC and dig out of your cell

### Lockup and ankle monitors

* Lockup cells for holding players while investigating, without the prison activities
* Players stay in lockup until an officer releases them
* Ankle monitors as items, placed on a player
* All police see a monitored player's location at all times (blip set in the config)
* Remove a monitor from the Prison MDT or with a powersaw
* Ankle monitors stay synced and saved over restarts

### Exports, logs and languages

* [Client](/docs/tk_jail/exports/client.md) and [server](/docs/tk_jail/exports/server.md) exports to jail, release, seize items and read sentences
* Supports ox\_lib, ox\_inventory, qb-inventory, qs-inventory and ox\_target
* Logs sent to Discord
* English, Finnish and French included, translatable

## Requirements

| Item      | Supported                                                                     |
| --------- | ----------------------------------------------------------------------------- |
| Framework | ESX, QBCore, Qbox. Another framework works after editing the framework files. |
| Database  | oxmysql or mysql-async                                                        |
| Library   | ox\_lib                                                                       |
| Inventory | ESX default inventory, qb-inventory, ox\_inventory, qs-inventory              |
| Target    | ox\_target (optional)                                                         |
| Prison    | Gabz Bolingbroke Prison by default; any MLO after changing the coordinates    |
| Languages | English, Finnish, French                                                      |

Import `tk_jail.sql` and add the jail items to your inventory. Every dependency and its start order: [Jail installation](/docs/tk_jail/installation.md#requirements).

## Start here

* [Install Jail](/docs/tk_jail/installation.md)
* [Update without losing your config](/docs/tk_jail/installation.md#update-without-losing-your-config)
* [Set up the prison, tasks and escapes](/docs/tk_jail/config.md)
* [Jail players from other resources with the server exports](/docs/tk_jail/exports/server.md)
* [Fix common problems](/docs/tk_jail/common-questions-and-problems.md)

Support: open a ticket in the [TK Scripts Discord](https://discord.gg/YndnF9tkqu).
