Installation & Usage
Installation
Add the prison gates to ox_doorlock
You’ll need the names of the doors you set — the prison break config refers to them later.
Configure your config files
They live in the configs folder.
Set up the doorlock names in the prison break config
This is what makes a hacked terminal unlock the correct door.
Commands
| Command | What it does | Who can use it |
|---|---|---|
/jail | Send a player to jail | Toggleable command |
/jailtime | Check your own jail time | Anyone in prison |
/prisoners | View the prison roster | Police officers |
Usage
Check if Player is Lifer
Check if a player is a lifer by using their source.
exports['xt-prison']:isLifer(source)Set Player Jail Time
These are not used to send a player to jail, but to modify their jail time while they are already in jail.
Client
local newTime = 100
local setTime = lib.callback.await('xt-prison:server:setJailStatus', false, newTime)
if setTime then
print('jail time set')
endSend Player to Jail
To properly send a player to jail, use the following callback. Pass the target player’s source and the intended jailing time.
server.lua
local sent = lib.callback.await('xt-prison:client:enterJail', targetSource, setTime)
if sent then
lib.notify(source, {
title = 'Sent Player to Jail'
})
endUnjail Player
To properly unjail a player, use the following callback. isUnjailed is passed as a boolean to release the player and ignore their existing jail time — usually true.
server.lua
local unjailed = lib.callback.await('xt-prison:client:exitJail', isUnjailed)
if unjailed then
lib.notify(source, {
title = 'Unjailed Player'
})
endLast updated on