Updated 2026-10-11 · 2 min read
qb-prison: inmate state and prison break flow
The official qb-prison works with qb-policejob, QBCore player metadata and qb-inventory to manage jail time, inmate belongings, prison jobs and prison-break alerts. Verified against commit 4ac6a67.
Setup
- Start
qb-coreandqb-inventorybefore prison-related resources. - Configure
qb-prisonand the installedqb-policejobto use the same jail flow. - Keep
Config.UseTargetaligned with theUseTargetconvar if using target interactions. - Verify
Config.Locations,Config.JobsandConfig.Uniformsin the actual config. - Test jailing, inventory custody, working off time, release and reconnect with test characters.
Player state and inventory
| Data / event | Role |
|---|---|
PlayerData.metadata.injail | Time remaining in jail |
PlayerData.metadata.jailitems | Saved items during custody |
prison:server:SetJailStatus | Updates jail metadata; source code also changes a jailed player's job to unemployed |
prison:server:SaveJailItems | Saves/clears inventory while jailed |
prison:server:GiveJailItems | Attempts item return; behavior differs when the escaped argument is true |
prison:server:ResetJailItems | Clears saved jail item metadata |
Those handlers are network events, not external server exports. In the reviewed server source, SetJailStatus accepts a jail time directly and does not perform a caller-role authorization check. Never expose it as an unrestricted jailing/un-jailing integration; enforce police/admin authority in a trusted server-side workflow.
Prison activity and alarms
The server source also registers prison:server:SecurityLockdown, SetGateHit, CheckRecordStatus, JailAlarm and CheckChance. These implement internal prison-break and item-reward behavior, not a general permission-safe administration API. Configure the corresponding coordinates and test the flow with multiple clients.
The prison jobs list lives under Config.Jobs (the bundled example includes electrician) and its location entries live under Config.Locations.jobs.
Troubleshooting
| Symptom | First check |
|---|---|
| Player stays jailed after reconnect | metadata.injail persistence and jail-status flow |
| Confiscated items do not return | metadata.jailitems, qb-inventory and release/escape path |
| Prison outfit does not apply | Configured Uniforms and actual appearance resource |
| Police do not receive alerts | Police job, onduty and prison-break server events |
| Job unexpectedly changes | SetJailStatus resets non-unemployed jobs when jailing |
| Jail time can be changed without authority | Audit all exposed event paths and server-side authorization |
Update checklist
- Record installed
qb-prison,qb-policejobandqb-inventorycommits. - Test detention and release with two different players and persistence across reconnect.
- Verify no untrusted client can arbitrarily call a privileged jail-time or alarm operation.
- Test item restoration and rollback on a staging database.
Sources
Repository · Server events · Config
Related: qb-policejob, safe server events.
Found an issue in this guide?
Send the page URL, the affected example, and a source or reproduction to the site maintainer. For a server or resource problem, use the support guide.
qb-smallresources
Find QBCore smallresources settings, make controlled consumable and AFK changes, isolate overlapping scripts, and verify exact before-and-after behavior.
qb-weathersync
Source-verified qb-weathersync configuration: dynamic weather, synchronized time, admin permissions, blackouts and troubleshooting.
