For the complete documentation index, see llms.txt. This page is also available as Markdown.

Server

Server-side events and exports exposed by rcore_prison. Call them from other resources running on the same server.

📡 Events

Prison Action Listener

This event is listener for actions happening in prison.

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

---@param actionType string
---@param data table

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)

🔒 Jail

Jail

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

---@param playerId number
---@param jailTime number - jail time in minutes
---@param jailReason? string - optional, not needed
---@param officerPlayerId? number - optional, if used it will be logged in ./jailcp Logs

local playerId = 1 -- playerId
local jailTime = 5 -- 5 minutes
local jailReason = 'multiple felonies' -- jailReason is optional, not needed
local officerPlayerId = 2 -- officerPlayerId is optional, if used it will be logged in ./jailcp Logs

exports['rcore_prison']:Jail(playerId, jailTime, jailReason, officerPlayerId)
Unjail

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

---@param playerId number
---@param skipTeleport? bool - if true, does not teleport the player in front of the prison

local playerId = 1
local skipTeleport = true -- If you dont want to teleport in front of Prison

exports['rcore_prison']:Unjail(playerId, skipTeleport)
UnjailOffline

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

---@param charId string

local charId = "ZW32561A"

exports['rcore_prison']:UnjailOffline(charId)

📋 Prisoner Data

GetPrisonerData

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

EditPrisonerSentence

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

IsPrisoner

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

💰 Credits

AddCredits

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

RemoveCredits

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

🚫 Solitary

SetSolitary

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

ReleaseFromSolitary

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

IsPrisonerInSolitary

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

👮 Community Service

StartCOMS

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

Last updated