# Commands & Export

### 💬 Commands

The script includes a variety of built-in commands for administrative control, player interaction, and minigame access.

#### 🧑‍⚖️ Jail Commands

* **`/jailmenu`**\
  Opens the jail management interface for authorized users. This menu allows you to jail nearby players, set durations, assign tasks, and review player details.
*

```
<figure><img src="https://3505378470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmOhVROw9E3kpmAG3JYVe%2Fuploads%2FodB8G0ryB3xq32ZM8e0b%2Fimage.png?alt=media&#x26;token=735c8f4a-6014-4ed7-bae4-0479f72c4c2b" alt=""><figcaption></figcaption></figure>
```

* **`/jailList`**\
  Displays a full list of all current inmates along with their jail time, tasks completed, and escape status. Only accessible by authorized staff.
*

```
<figure><img src="https://3505378470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmOhVROw9E3kpmAG3JYVe%2Fuploads%2FcVRpl1HSEfEDoodKlHrU%2Fimage.png?alt=media&#x26;token=4759c894-8e1c-475e-ae45-c694a8e873c2" alt=""><figcaption></figcaption></figure>
```

#### 🏀 Basketball Command

* **`/basket`** (or your configured command name)\
  Spawns a basketball in the yard if the player is inside a valid basketball zone. The command respects a maximum spawn limit defined in the config.

  After spawning the ball, players are prompted with controls for:

  * Picking up the ball
  * Changing dribble style
  * Shooting the ball
  * Detaching the ball
  *

  ```
  <figure><img src="https://3505378470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmOhVROw9E3kpmAG3JYVe%2Fuploads%2FAyQMdXdpDquYqFmfxvjH%2Fimage.png?alt=media&#x26;token=3ae98b4e-9bc6-40ef-84f8-0b08058ffd8c" alt=""><figcaption></figcaption></figure>
  ```

***

#### 🎲 Dice Game Commands

* **`/dicesend [id] [amount]`**\
  Sends a dice game request to a nearby player with the specified bet amount.
* **`/diceaccept`**\
  Accepts an incoming dice game request.
* **`/dicedeny`**\
  Rejects an incoming dice game request.
*

```
<figure><img src="https://3505378470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmOhVROw9E3kpmAG3JYVe%2Fuploads%2FL4fW2MS00tTahrTfy8qr%2Fimage.png?alt=media&#x26;token=68db3bd4-4a92-413f-a64f-c749136b1ef9" alt=""><figcaption></figcaption></figure>
```

### Export: JailPlayer

Send players to jail from any external resource (MDT, policejob, etc.).

#### Usage (Server-Side)

```lua
exports['frkn-prison']:JailPlayer(copSource, targetSource, jailTime, reason)
```

#### Parameters

| Parameter      | Type     | Description                                         |
| -------------- | -------- | --------------------------------------------------- |
| `copSource`    | `number` | Server ID of the officer sending the player to jail |
| `targetSource` | `number` | Server ID of the player being jailed                |
| `jailTime`     | `number` | Jail duration in minutes                            |
| `reason`       | `string` | Reason for imprisonment                             |

#### Example

```lua
-- Jail a player for 30 minutes
exports['frkn-prison']:JailPlayer(source, targetPlayerId, 30, "Armed Robbery")
```

#### What It Does

* Teleports the player to prison
* Saves and clears the player's inventory
* Assigns prison tasks (Dish Washing, Exercise, Cleaning)
* Creates a database record
* Automatically releases the player and restores inventory when time is up
