🔌Installation & Usage
Installation
Add the prison gates to your ox_doorlock (you'll need the names of the doors you set)
Configure your config files found in the configs folder
Setup the doorlock names you created in the prison break config. This is to be sure it unlocks the correct door when a terminal is hacked
Commands
/jail
- Send player to jail (toggleable command)
/jailtime
- Check your jail time
/prisoners
- View the prison roster if you're a police officer
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 in jail.
Client
local newTime = 100
local setTime = lib.callback.await('xt-prison:server:setJailStatus', false, newTime)
if setTime then
print('jail time set')
end
Server
local newTime = 100
local setTime = exports['xt-prison']:SetJailTime(newTime)
if setTime then
print('jail time set')
end
Send Player to Jail
In order to properly send a player to jail, use the following callback. Pass the target player's source and the intended jailing time.
Server
local sent = lib.callback.await('xt-prison:client:enterJail', targetSource, setTime)
if sent then
lib.notify(source, {
title = 'Sent Player to Jail'
})
end
Unjail 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
local unjailed = lib.callback.await('xt-prison:client:exitJail', isUnjailed)
if unjailed then
lib.notify(source, {
title = 'Unjailed Player'
})
end
Last updated