> For the complete documentation index, see [llms.txt](https://documentation.rcore.cz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.rcore.cz/paid-resources/rcore_prison/api/client.md).

# Client

Client-side events and exports exposed by `rcore_prison`. Call them from other resources running in the same client.

## 🔒 Jail Actions

<details>

<summary>Jail</summary>

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

{% hint style="info" %}
**The initiator player needs to be in Police job to make it work!**
{% endhint %}

```lua
---@param targetPlayerId number
---@param jailTime number - jail time in minutes

local targetPlayerId = 1
local jailTime = 5 -- 5 minutes

exports['rcore_prison']:Jail(targetPlayerId, jailTime)
```

</details>

<details>

<summary>Unjail</summary>

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

{% hint style="info" %}
**The initiator player needs to be in Police job to make it work!**
{% endhint %}

```lua
---@param targetPlayerId number

local targetPlayerId = 1

exports['rcore_prison']:Unjail(targetPlayerId)
```

</details>

<details>

<summary>JailByIdentifier</summary>

This export is used to jail player by identifier

```lua
---@param identifier string
---@param jailTime number - jail time in minutes

exports['rcore_prison']:JailByIdentifier(identifier, jailTime)
```

</details>

<details>

<summary>JailPlayerByNPC</summary>

This export is used when you want to jail player by NPC

```lua
---@param targetPlayerId number
---@param netId number - networked ped id, use PedToNet(ped)

local targetPlayerId = 1
local pedId = 321321

-- The peds needs to be networked to make this -> see: modules\base\server\api\sv-jailPlayer.lua

TriggerServerEvent('rcore_prison:server:JailPlayerByNPC', targetPlayerId, PedToNet(pedId))
```

</details>

## 🔍 Player State

<details>

<summary>IsPrisoner</summary>

This export is used when you want to check if target player is in Prison

```lua
---@return boolean isPrisoner

exports['rcore_prison']:IsPrisoner()
```

</details>

<details>

<summary>IsPlayerInCutScene</summary>

This export is used when you want know if player is cutscene (Prolog)

```lua
---@return boolean inCutscene

exports['rcore_prison']:IsPlayerInCutScene()
```

</details>

## 🖥️ Dashboard

<details>

<summary>Open dashboard</summary>

This export is used when you want to open included dashboard

```lua
exports['rcore_prison']:OpenDashboard()
```

</details>

## 👮 Community Service

<details>

<summary>rcore_prison:server:StartComs</summary>

This event is used to sent player to coms

```lua
---@param target number
---@param perollCount number

TriggerServerEvent('rcore_prison:server:StartComs', target, perollCount)
```

</details>
