# Police Jail — Arrest & Prison System for FiveM
**Build your cells by walking around them. No coordinates. No config editing. No map dependency.**
A complete police jail script for ESX, QBCore and QBox: booking terminal, your own penal code, permanent criminal records, bail, item confiscation and three prison work minigames.
---
## Why this one
Most jail scripts hand you a config file full of coordinates and a sphere around a spawn point. This one doesn't.
- **You build the jail ingame.** Walk into the cell, aim at each corner, press E. The cell becomes a real polygon that follows the shape of the room.
- **Works in any MLO or custom map.** Nothing is hardcoded, so a map update never breaks your jail.
- **Your penal code, not ours.** Every charge carries its own sentence and bail amount.
- **Arrests are remembered.** A permanent criminal record your officers can look up before deciding a sentence.
---
## The Cell Creator
No coordinates anywhere in the config. Everything is placed ingame.
| Step | What you do |
| --- | --- |
| **Corners** | Aim at each corner and press `E` — as many as the room needs |
| **Height** | Mouse wheel up and down, live preview |
| **Spawn** | Walk to the spot where prisoners land |
| **Work spots** | Place the minigames by hand, mouse wheel switches the type |
Build one **station** per police building — that's the booking NPC, the release point and the bail desk. Then add as many **cells** to it as you have rooms. The terminal only ever offers the cells of the station the officer is standing at.
The red preview walls disappear the moment you save. Ingame the cell is invisible, because your map already has the real walls.
---
## Booking Terminal
Officers press `E` at the booking NPC — or use `ox_target` / `qb-target`. The terminal has three tabs:
- **Nearby Suspects** — everyone in range, with a repeat-offender counter on each card
- **In Custody** — every current inmate with live remaining time
- **Record** — the full register of everyone who has ever sat
Full cells are locked out automatically. The whole list refreshes live while the terminal is open.
---
## Your Own Penal Code
Every charge carries its own sentence and bail. Pick `ARMED ROBBERY` and the terminal fills in 15 minutes and a $5.000 bail — the officer types nothing.
Two switches decide how much freedom your police get:
| Fixed sentences | Manual override | What officers can do |
| :---: | :---: | --- |
| ✅ | ❌ | Same crime, same sentence, every single time. Nothing to argue about. |
| ✅ | ✅ | Sentence is pre-filled, officers may adjust it for context |
| ❌ | ✅ | Fully manual — charge and sentence chosen separately |
> A locked sentence is enforced on the server. Nothing the client sends can change it.
---
## Criminal Records
Every arrest is stored permanently and stays after the release.
- **Prior-conviction counter** on every suspect card — yellow at 1, red from 3. A repeat offender is obvious before you open his file.
- **Full register tab** listing everyone who has ever sat: last charge, total time served, last arrest.
- **Complete history per person** — charge, sentence, date, arresting officer, cell, bail and how they got out.
Old entries are cleaned up automatically after a number of days you choose.
---
## Bail
An inmate cannot buy himself out. Somebody on the **outside** has to walk to the bail desk and pay for him — a friend, a lawyer, a gang member.
The officer sets the amount while booking and decides how much of the sentence has to be served first. A murder charge can require 75% served before bail is even possible, a traffic offence is payable immediately. Bank or cash, your choice.
---
## Prison Work
Sitting still for 30 minutes is not gameplay. Three minigames cut real time off a sentence:
- **Mop the floor** — clean the cell until it's spotless
- **Fold the laundry** — sort garments onto the right piles
- **Break the rocks** — pickaxe work, three hits each
You decide where they are. Work spots are placed by hand while building the cell — up to twelve per cell, and you can mix all three types in the same room. Every completion is validated server-side with a minimum play duration, so nothing can be faked.
---
## Arrest & Release
- **Cinematic arrest** — the screen fades to black, a cell door slams, and the view clears once the suspect is already inside. No teleport flash. Swappable sound file.
- **Confiscation** — items and weapons are stored in the database and returned on release. Whitelist what inmates may keep.
- **Prison clothing** — automatic outfit swap, exact original outfit restored afterwards, props included.
- **Offline handling** — the timer pauses on disconnect and resumes on login. Nobody sits out a sentence by logging off.
- **Automatic release** at the station's release point, online or offline.
---
## Built for Your Other Scripts
A documented export API ships with the script.
```lua
-- Sentence someone from your court script
exports['risk-policejail']:JailPlayer(targetId, 15 * 60, 'CONTEMPT OF COURT', nil, 'JUDGE')
-- Pull a full criminal record into your MDT
local records = exports['risk-policejail']:GetRecords(targetId)
-- Block a shop for inmates
if exports['risk-policejail']:IsJailed() then return end
```
Twelve server exports, two client exports, plus events on every arrest and release so your dispatch or logging system can react.
---
## Compatibility
| | Supported |
| --- | --- |
| **Framework** | ESX · QBCore · QBox — auto-detected at runtime |
| **Inventory** | ox_inventory · qs-inventory · codem-inventory · framework native |
| **Target** | ox_target · qb-target · built-in `E` prompt |
| **Database** | oxmysql · mysql-async — tables created automatically |
| **Maps** | Any MLO or custom map, nothing hardcoded |
| **Languages** | English · German · Spanish · French · Portuguese |
---
## What You Get
- ✅ Ingame polygon cell creator — build stations and cells by walking around
- ✅ Booking terminal with nearby, custody and criminal record tabs
- ✅ Configurable penal code with fixed sentences and bail per charge
- ✅ Permanent criminal records with prior-conviction warnings
- ✅ Bail paid from the outside at a placeable bail desk
- ✅ Three prison work minigames with hand-placed spots
- ✅ Cinematic blackscreen arrest with swappable cell door sound
- ✅ Item and weapon confiscation with whitelist
- ✅ Automatic prison clothing with original outfit restore
- ✅ Offline timer pause and automatic release
- ✅ Discord webhooks for arrests, releases and bail payments
- ✅ Optional Discord profile pictures in the terminal
- ✅ Full export API with documentation
- ✅ Admin unjail command from console or ingame
- ✅ 5 languages, every string translatable
- ✅ Exploit-safe, server-authoritative, 0.00ms idle
- ✅ Responsive from 1080p to 4K ultrawide
---
## Installation
1. Drop `risk-policejail` into your resources folder
2. Add `ensure risk-policejail` to your `server.cfg`
3. Set your police jobs in `config.lua` and restart
4. Type `/createcell` ingame and build your first station and cell
Database tables are created automatically on the first start. No SQL import needed.
**Requirements:** `oxmysql` or `mysql-async` · ESX, QBCore or QBox
---
## FAQ
**Does it work with my MLO?**
Yes. There are no coordinates in the config — you build the cells ingame around whatever walls your map has.
**Can I use it without a target script?**
Yes. A built-in `E` prompt is used by default. `ox_target` and `qb-target` are optional.
**Does it work with my inventory?**
Yes. `ox_inventory`, `qs-inventory`, `codem-inventory` and the framework native API are all detected automatically. No code changes.
**Can other scripts jail players?**
Yes. A documented export API is included — your MDT, court script or admin menu can jail, release, read records and react to arrest events.
**What happens if a prisoner disconnects?**
The timer pauses and resumes on his next login. His items and outfit stay stored, and a server restart mid-sentence loses nothing.
**Can prisoners escape?**
No. A containment check teleports them back into the cell. Officers and the console can release anyone at any time.
**Can I translate it?**
Yes. Five languages ship complete, and every single string in the interface lives in a locale file.
---
"Finally a script that actually works. Support was super fast and helpful."
"Top quality. We've been using it on our server for 2 weeks without issues. 10/10."
"Very clean code, easy to customize. 0.00ms resmon is not an empty promise."
"This system is awesome. My players love the new features."
"Best developer. Updates come regularly and bugs are fixed immediately."
"Everything perfect, installation was done in 5 minutes. Would buy again."