Skip to content

np_prison v0.1.0 ​

A prison where time inside is play time. An arrest ends at a sentencing screen with a real charge sheet; the suspect accepts, asks for a lawyer or demands a trial. Inmates arrive through a short intake, live by a daily routine (count, chow, work, yard, visits, lockdown), take jobs that cut the sentence, spend their account at the commissary, trade with the plug, hide contraband and plan multi-step breakouts. Friends outside book visits, write letters and top up the account from their phone. Corrections officers get a console with the roster, a cell map, searches and a lockdown, and NPC officers take over when nobody is on duty.

It uses the Nimbus UI look of np_hud and np_phone: grey glass, glossy squircle tiles, and colour only where it means something. It runs on es_extended, qbx_core and qb-core, or standalone, with np_inventory, ox_inventory, qb-inventory or the plain ESX inventory. es_extended with np_inventory is the first target. It requires oxmysql, np_npchandler (NPCs) and np_prophandler (held props, cell doors), both 1.1.0+.

Not yet run on a live server

Every module is covered by the plain-Lua test suite (four framework boots, and the whole stay end to end on es_extended with np_inventory) and every screen is rendered from mock data. The game-side parts (coordinates, cell doors, props, animations, natives) still need the checks in Installation → Before you open it.

The sentencing screen

The charge sheet the suspect answers Intake: the booking card
Charge sheet Intake
Inmate HUD Job board
HUD Jobs
Commissary The plug
Commissary Plug
Breakout planner Siren
Escape Siren
Corrections console Parole hearings
Console Parole
Corrections app: booked visits German
Corrections app German

The screenshots come from the browser mock (see Development). The UI ships in English and German.

At a glance ​

  • Sentences in roleplay months. One month lasts Config.MonthSeconds (30) seconds of online time: the sentence only counts down while the inmate is on the server. Every screen shows months first and real time second.
  • Sentencing screen: police and guards pick charges from a penal code, add modifiers (repeat offender, cooperative, plea deal, lawyer present, send to judge), choose a facility, a security level and an alternative. The suspect answers the charge sheet: accept, request a lawyer or demand a trial. See Sentencing & intake.
  • Three facilities: Bolingbroke Penitentiary for long sentences, the Mission Row holding cells for short ones and the Paleto Bay county lockup on request. Each has its own cells, areas and schedule.
  • Intake and the property bag: transport, mugshot, pat-down, jumpsuit, cell. Everything the inmate carries is sealed and handed back at the release desk; contraband goes to evidence; cash moves to a capped inmate account.
  • A daily routine with roll calls, free chow, work periods, yard time, visiting hours and a night lockdown (sleep in your bed and time runs faster). See Daily life.
  • Work detail: eight jobs from cleaning to road crew, each a short shift of steps with one shared skill ring. Every finished shift takes months off, pays the account and adds behaviour. Jobs feed the prison: no kitchen crew, no free meals.
  • Activities: workout and yard games for skill XP that stays after release, dice and poker for noodles and cigarettes, classes that end in a certificate and a large cut.
  • Commissary, plug and contraband: a kiosk with weekly limits, an NPC plug who trades items for items, hiding spots in the cell, the yard and a hollow book, guard searches and shakedowns, bribes. See Commissary & contraband.
  • Breakouts: a cell tunnel, the yard fence, the laundry truck, the staff gate and an outside job. Each is a plan with tools, a time window and a guard counter-play, on an alert ladder from quiet to manhunt. See Breakouts.
  • Visits, mail and phone: visit booths with a handset, letters read by guards first, care packages, the Corrections app in np_phone, collect calls from the wall phones and a smuggled burner. See Visits, mail & phone.
  • Guards: the corrections console (roster, cell map, searches, solitary, time, lockdown), guard sight on the HUD, and NPC officers when no player guard is on duty. See Console & guards.
  • Parole and alternatives: hearings at half the sentence, an NPC board when nobody decides, parole served as online time; community service, an ankle monitor or bail for short sentences. See Parole & alternatives.
  • Drop-in for other jail scripts: answers the pickle_prisons and esx_jail events and keeps qb-core's injail metadata in step, so menus and MDTs that call them keep working.
  • Server-authoritative: months, money, positions, durations and outcomes are decided on the server. Every RPC has a schema, a rate limit and a permission check. No ACE anywhere.

Who uses it ​

Resource What it reads from np_prison
np_character Spawn provider np_prison: a jailed character's spawn list gets the cell
np_tattoos Jailed provider for prison ink
np_identification Warrant provider: bail no-shows and escapees count as open warrants
np_phone The Corrections app; an inmate's phone is sealed with setBlocked(src, true, 'jail')
np_inventory ConfiscateInventory / ReturnInventory are the property bag
np_payments Fines become invoices; bail, top-ups, stamps and parcels are charged through it
np_admin Permission nodes, settings page "Prison", staff tools, audit log
MDT Breakout, siren and breach calls on the dispatch board
np_helicam Escapees' plates on the BOLO list during a manhunt

All of them are optional (np_npchandler and np_prophandler are required, see Installation). See Integrations for the full list and what happens without each one.

Quick example ​

lua
-- server: book a player for 24 months (facility picked by length)
local ok, view = exports.np_prison:JailPlayer(source, 24, nil, { reason = 'Armed robbery', by = 'mdt' })

-- server: is this character inside, and for how long?
local s = exports.np_prison:GetSentence(source)
if s then print(('%s, cell %s, %d months left'):format(s.name, s.cell, s.monthsLeft)) end

-- server: federal cases always go to Bolingbroke, maximum security
exports.np_prison:registerHook('beforeJail', function(p)
  if isFederalCase(p.identifier) then return { facility = 'bolingbroke', security = 'maximum' } end
end)

-- any resource, no call needed
if Player(src).state.jailed then return end

Next steps ​