> For the complete documentation index, see [llms.txt](https://rscripts.gitbook.io/r_scripts-docs./llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://rscripts.gitbook.io/r_scripts-docs./paid-resources/r_prison/api/server.md).

# Server

### JailPlayer

```lua
local target = 1 -- ID 1
local time = 10 -- 10 minutes
local bail = 10000 -- $10000 (0 or nil for no bail)

exports.r_prison:JailPlayer(target, time, bail)
```

* Returns `true` or `false`, indicating whether the target was successfully jailed.

***

### ReleaseInmate

```lua
local target = 1 -- ID 1

exports.r_prison:ReleaseInmate(target)
```

* Returns `true` or `false`, indicating whether the target was successfully released.

***

### ReleaseInmateOffline

```lua
local charId = "EFR16E1B"

exports.r_prison:ReleaseOfflineInmate(charId)
```

* Returns `true` or `false`, indicating whether the offline character's sentence was cleared.

***

### EditInmateSentence

```lua
local target = 1 -- ID 1
local time = 15 -- 15 minutes

exports.r_prison:EditInmateSentence(target, time)
```

* Returns `true` or `false`, indicating whether the target's sentence was changed.

***

### IsInmate

```lua
local target = 1 -- ID 1

exports.r_prison:IsInmate(target)
```

* Returns `true` or `false`, indicating whether the target is an inmate.

***

### GetInmateInfo

```lua
local target = 1 -- ID 1

exports.r_prison:GetInmateInfo(target)
```

* Returns a table of inmate information if the target is an inmate.

***

### SetLockdown

```lua
local target = 1 -- ID 1
local time = 5 -- 5 minutes

exports.r_prison:SetLockdown(target, time)
```

* <mark style="color:red;">**Target**</mark><mark style="color:red;">**&#x20;**</mark>*<mark style="color:red;">**must**</mark>*<mark style="color:red;">**&#x20;**</mark><mark style="color:red;">**be an inmate.**</mark>
* Returns `true` or `false`, indicating whether the target was successfully placed in lockdown.

***

### ReleaseLockdown

```lua
local target = 1 -- ID 1

exports.r_prison:ReleaseLockdown(target)
```

* Returns `true` or `false`, indicating whether the target was successfully released from lockdown.&#x20;

***

### IsInmateSolitary

```lua
local target = 1 -- ID 1

exports.r_prison:IsInmateSolitary(target)
```

* Returns `true` or `false`, indicating whether the target is in lockdown.

***

### AddCanteen

```lua
local target = 1 -- ID 1
local amount = 500 -- $500

exports.r_prison:AddCanteen(target, amount)
```

* <mark style="color:red;">**Target**</mark><mark style="color:red;">**&#x20;**</mark>*<mark style="color:red;">**must**</mark>*<mark style="color:red;">**&#x20;**</mark><mark style="color:red;">**be an inmate.**</mark>
* Returns `true` or `false`, indicating whether the target's canteen balance has been updated.

***

### RemoveCanteen

```lua
local target = 1 -- ID 1
local amount - 250 -- $250

exports.r_prison:RemoveCanteen(target, amount)
```

* <mark style="color:red;">**Target**</mark><mark style="color:red;">**&#x20;**</mark>*<mark style="color:red;">**must**</mark>*<mark style="color:red;">**&#x20;**</mark><mark style="color:red;">**be an inmate.**</mark>
* Returns `true` or `false`, indicating whether the target's canteen balance has been updated.

***

## Events

### r\_prison:playerJailed

```lua
AddEventHandler('r_prison:playerJailed', function(src)
    -- insert your code here
end
```
