QBCore Frameworkqbcore.netCommunity docs
On this page

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

  1. Start qb-core and qb-inventory before prison-related resources.
  2. Configure qb-prison and the installed qb-policejob to use the same jail flow.
  3. Keep Config.UseTarget aligned with the UseTarget convar if using target interactions.
  4. Verify Config.Locations, Config.Jobs and Config.Uniforms in the actual config.
  5. Test jailing, inventory custody, working off time, release and reconnect with test characters.

Player state and inventory

Data / eventRole
PlayerData.metadata.injailTime remaining in jail
PlayerData.metadata.jailitemsSaved items during custody
prison:server:SetJailStatusUpdates jail metadata; source code also changes a jailed player's job to unemployed
prison:server:SaveJailItemsSaves/clears inventory while jailed
prison:server:GiveJailItemsAttempts item return; behavior differs when the escaped argument is true
prison:server:ResetJailItemsClears 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

SymptomFirst check
Player stays jailed after reconnectmetadata.injail persistence and jail-status flow
Confiscated items do not returnmetadata.jailitems, qb-inventory and release/escape path
Prison outfit does not applyConfigured Uniforms and actual appearance resource
Police do not receive alertsPolice job, onduty and prison-break server events
Job unexpectedly changesSetJailStatus resets non-unemployed jobs when jailing
Jail time can be changed without authorityAudit all exposed event paths and server-side authorization

Update checklist

  1. Record installed qb-prison, qb-policejob and qb-inventory commits.
  2. Test detention and release with two different players and persistence across reconnect.
  3. Verify no untrusted client can arbitrarily call a privileged jail-time or alarm operation.
  4. 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.

On this page

Leonida RP server website built with RPWebsite
RPWebsite

Advertisement · RPWebsite

Want a website for your server?

Launch a site with live player status, rules, and a join button in minutes.

Build your website