Server
This page lists all the available server-side events and exports.
Events (General)
Prison Action Listener
Example code
--- Action Types ---
-- PRISONER_RELEASED: Player is released from prison
-- PRISONER_LOADED: Player rejoins and is jailed since they have a remaining sentence
-- PRISONER_NEW: New player is jailed
-- PLAYER_ESCAPE_FROM_PRISON: Player escaped from prison (Prison break)
-- PLAYER_DESTROYED_WALL: Player destroyed a wall in prison (Prison break)
--- Prisoner Data Structure ---
-- data.prisoner: {
-- state: string,
-- officerName: string,
-- owner: string,
-- id: int,
-- jail_time: float,
-- source: int,
-- prisonerName: string,
-- jail_reason: string,
-- }
AddEventHandler('rcore_prison:server:heartbeat', function(actionType, data)
-- Your event handling logic here
if not next(data) then
return
end
local prisoner = data.prisoner
if not prisoner then
return
end
if actionType == 'PRISONER_NEW' then
print('New prisoner loaded')
end
end)
Exports (General)
Jail
Example code
Unjail
Example code
UnjailOffline
Example code
GetPrisonerData
Example code
EditPrisonerSentence
Example code
IsPrisoner
Example code
AddCredits
Example code
RemoveCredits
Example code
SetSolitary
Example code
ReleaseFromSolitary
Example code
IsPrisonerInSolitary
Example code
StartCOMS
Example code
Last updated