Server

This page lists all the available server-side events and exports.

Events (General)

Prison Action Listener

circle-info

SERVER

This event is listener for actions happening in prison.

Example code

server.lua

--- 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

circle-info

SERVER

This export is used when you want to jail target citizen.

Example code

Unjail

circle-info

SERVER

This export is used when you want to unjail citizen which is in Prison.

Example code

UnjailOffline

circle-info

SERVER

This export is used when you want to unjail citizen which is offline

Example code

GetPrisonerData

circle-info

SERVER

This export is used when you want to get more informations about target prisoner.

Example code

EditPrisonerSentence

circle-info

SERVER

This export is used when you want to modify target prisoner sentence

Example code

IsPrisoner

circle-info

SERVER

This export is used when you want to check if target citizen is Prisoner

Example code

AddCredits

circle-info

SERVER

This export is used when you want to give target Prisoner credits, if he has account!

Example code

RemoveCredits

circle-info

SERVER

This export is used when you want to remove credits from Prisoner account.

Example code

SetSolitary

circle-info

SERVER

This export is used when you want to sent Prisoner to Solitary cell

Example code

ReleaseFromSolitary

circle-info

SERVER

This export is used when you want to release prisoner from solitary

Example code

IsPrisonerInSolitary

circle-info

SERVER

This export is used when you want to check if Prisoner is in Solitary cell

Example code

StartCOMS

circle-info

SERVER

This export is used when you want to send citizen to Community service

Example code

Last updated