AI Core

ai-prison

Jail sentences counted by the server - items taken at the gate, prison work, a canteen and escapes with extra time.

ai-prison runs jail sentences. Police send a cuffed player to prison from their menu, admins with a command, and other scripts through AI Core. The server counts the minutes, so a player cannot change them. Prison work shortens the sentence, a canteen hands out free meals, and leaving the prison area brings the player back with extra time.

What it does in the game

  • Going in. The player is moved to a random cell point and gets a notification with the minutes. When Take items at the gate is on, the whole inventory is taken and kept on the character.
  • The clock. One minute of sentence passes per minute in the game. When Count time offline is on, time away from the server counts too. The player gets a notification with the time left at entry, every 10 minutes and every minute of the last 5. The radial menu shows Sentence while jailed.
  • Prison work. Work spots (fuse boxes by default) show only to jailed players. Working runs a progress bar; at the end the sentence gets shorter by the spot's minutes. Each spot has its own wait before the same character can work there again.
  • Canteen. A counter where jailed players get a meal item for free, once per Wait between meals.
  • Escapes. Every 10 seconds the server checks where each jailed player is. Outside the prison area the player is sent back to a cell with extra minutes, and the police get an alert when Alert the police is on.
  • Release. When the time is served (or a police or admin releases them), the player is moved to the release point and gets the taken items back.
  • Records. Every jailing writes a jail record into the police MDT when one runs.

Installation

Installed by the AI Core recipe. By hand: ensure ai-prison after ensure ai-core. It needs ai-core and OneSync. It uses no database table of its own: the sentence is stored on the character.

The default prison is Bolingbroke Penitentiary, with 11 cell points, a 16-corner area, 7 fuse box work spots and a canteen handing out burger. Make sure the meal item exists in your inventory, or change it.

Panel settings

Admin panel > Prison. Defaults come from data/settings.json and data/tasks.json.

Prison tab

Cells and release: a jailed player starts at a random cell point and walks out at the release point when the time is served.

SettingWhat it changesDefault
Cell pointsUp to 30 points (position and facing) where jailed players appear.11 cells in Bolingbroke
Release pointWhere a player stands after the sentence ends (outside the gate).1848.13, 2586.05, 44.67

Prison area: a jailed player outside this area counts as escaping.

SettingWhat it changesUnitDefault
Area cornersWalk around the prison walls and add a corner at each turn (at least 3, at most 32).16 corners
Area heightMetres above and below the corners that still count as inside. 5-200.m200

Canteen: a counter where jailed players get a meal for free.

SettingWhat it changesUnitDefault
Canteen counterWhere the canteen point is.1777.59, 2560.52, 44.62
Meal itemThe item handed out; empty closes the canteen.burger
Items per mealHow many of the item one meal gives. 1-10.1
Wait between mealsMinutes before the same character gets another meal. 0-240.min10

Rules tab

Sentence: the server counts the minutes; players cannot change them.

SettingWhat it changesUnitDefault
Longest sentenceLonger sentences from police or admins are cut to this. 1-10,000.min120
Count time offlineOn: minutes pass while the player is away too. Off: only time in the game counts.off
Take items at the gateOn: the inventory is taken when jailed and given back at release.on

Escapes

SettingWhat it changesUnitDefault
Extra time for an escapeMinutes added each time a jailed player is found outside the area. 0-600.min5
Alert the policeSends a police alert with the escape position.on

Prison work tab

One record per work spot. Deleting a spot means players can no longer work there.

SettingWhat it changesUnitDefault
NameThe spot's name, shown on its prompt ("Work: Fuse box 1").empty
PlaceWhere the player works. Stand there and use your position.0, 0, 0
Work timeHow long the progress bar runs. 3-120.s10
Minutes servedHow much shorter the sentence gets each time. 0-60.min1
Wait before working here againSeconds before the same character can work at this spot again. 0-3600.s120

Commands

CommandArgumentsWho may use itWhat it does
/jailid (player server id), minutes (number)ai-core admins (ACE ai.admin), the server console, or anyone allowed command.jailSends a player to prison. The minutes are cut to Longest sentence.
/unjailid (player server id)ai-core admins, the console, or command.unjailReleases a player at once, with their items.

Police officers jail from the ai-police menu (Send to prison); they do not need the command.

Keybinds

None. Work spots and the canteen are interaction points (prompt with E, or a target option, by ai-core's Interaction style).

What it stands in for

No fxProvide. It keeps the sentence in the character metadata key injail, the key QBCore uses, so QB scripts that read or write injail work with it. A QB police script that sets injail through the bridge starts a sentence in ai-prison; setting it to 0 releases.

Other prison scripts

AI Core's prison layer also supports qb-prison, rcore_prison, xt-prison and tgiann-policejob. Stop ai-prison and start one of them: ai-police and every other script keep jailing through AI Core. See Compatibility.

Known limits

  • With Count time offline off, a player who leaves keeps the remaining minutes until they come back.
  • Jailing a player who is already jailed sets the new sentence; the items stored at the first jailing stay stored.
  • A full inventory at release cannot take every item back; what did not fit is written to the server log.
  • Log channel: prison.

On this page