Server
This page lists all the available server-side events and exports.
Events (General)
Prison Action Listener
This event is listener for actions happening in prison.
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)
List of general exports.
Jail
This export is used when you want to jail target citizen.
Example code
Unjail
This export is used when you want to unjail citizen which is in Prison.
Example code
UnjailOffline
This export is used when you want to unjail citizen which is offline
Example code
GetPrisonerData
This export is used when you want to get more informations about target prisoner.
Example code
EditPrisonerSentence
This export is used when you want to modify target prisoner sentence
Example code
IsPrisoner
This export is used when you want to check if target citizen is Prisoner
Example code
AddCredits
This export is used when you want to give target Prisoner credits, if he has account!
Example code
RemoveCredits
This export is used when you want to remove credits from Prisoner account.
Example code
SetSolitary
This export is used when you want to sent Prisoner to Solitary cell
Example code
ReleaseFromSolitary
This export is used when you want to release prisoner from solitary
Example code
IsPrisonerInSolitary
This export is used when you want to check if Prisoner is in Solitary cell
Example code
StartCOMS
This export is used when you want to send citizen to Community service
Example code
Last updated
Was this helpful?