# Installation

## Database

The database will be imported automatically for you when you start the resource for the first time.

## General information

{% hint style="info" %}
🗺️ **Note about the RCore Prison Map:**

The included RCORE Prison map **does not have a visitation room**, and the **canteen is located in a different section** of the prison (marked as a C on the map).

If you are migrating from **QBOX** or **QBCore**, those frameworks may come with a different prison map that **includes a visitation area**.

Our MLO is located at `vector3(1691.44, 2568.25, 45.56)`.
{% endhint %}

{% hint style="info" %}
🗺️ **Note about the Community service:**

The locations are set only to Los Santos (City) not outside of it.

It cannot be changed to different location.
{% endhint %}

{% hint style="info" %}
🗺️ **Note about the prisoners not being teleported back to prison**

The Prison check by default in 1 minute cycle if prisoner run from prison, when not doing prison break way and teleport him back.

The area is polyzone, its not distance based
{% endhint %}

{% hint style="info" %}
🗺️ **A Quick Note About Doors**

Just a heads-up: the prison doesn't come with specific door locations on the map. If you need doors for your prison setup, feel free to add them wherever you like—they’re completely up to you!
{% endhint %}

## Script

1. [Download the script from Keymaster](#script-download).
2. [Place the files in the resources folder](#place-files).
3. [Edit the server.cfg](#edit-server-cfg).
4. [Define server maps](#edit-server-cfg-maps).
5. [Define items using Deployer or manually](#define-items).
6. [Start the server](#start-server).

***

### Step 1: Download the Script <a href="#script-download" id="script-download"></a>

* Download the script from [keymaster](https://keymaster.fivem.net).

***

### Step 2: Place the Files <a href="#place-files" id="place-files"></a>

* Open the downloaded `.zip`, copy the `[prison]` folder, and put it in your resources folder.

<details>

<summary>Resource folder image</summary>

<figure><img src="https://1037498771-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MZErcztD5BvrKnwRGJq%2Fuploads%2Fgit-blob-5da6abaee2bea30f081554fd6b2d242785752cee%2Fprison_setup_folder.png?alt=media" alt="Resource Folder"><figcaption><p>Resources folder</p></figcaption></figure>

</details>

***

### Step 3: Edit server.cfg <a href="#edit-server-cfg" id="edit-server-cfg"></a>

Go to your `server.cfg` and add `ensure [prison]`.

### Step 4: Define Your Prison Map <a href="#edit-server-cfg-maps" id="edit-server-cfg-maps"></a>

To configure your prison map, ensure the correct map resources are included in your `server.cfg`.\
Below are configuration examples for **Standalone**, **Custom Prison Map**, and **RCORE** setups.

> **Note:**\
> If an unsupported map is loaded, a **Standalone configuration** will be applied by default, using the standard prison yard.

<details>

<summary>Standalone</summary>

* Description: Uses the default prison yard

```lua
ensure [prison]
```

</details>

<details>

<summary>Your map</summary>

* Description: Configures the prison map you have defined

```lua
ensure your_prison_map
ensure [prison]
```

</details>

<details>

<summary>RCORE</summary>

* **Description:** Configures the **RCORE Prison** map that comes included with the `[prison]` resource.
* **Path to Map Files:**

  You can find the RCORE prison map and models in the following locations:

  * Map folder:\
    `resources/[prison]/rcore_prison/includedMaps/rcore_prison_map`
  * Models folder:\
    `resources/[prison]/rcore_prison/includedMaps/rcore_prison_models`

**🛠️ How to Extract:**

To use the map and models directly in your server's resource system, follow these steps:

1. Navigate to: resources/\[prison]/rcore\_prison/includedMaps/
2. Copy the folders:

* `rcore_prison_map`
* `rcore_prison_models`

3. Paste both folders directly into your main `resources/` directory.

```lua
ensure rcore_prison_models
ensure rcore_prison_map
ensure [prison]
```

{% hint style="info" %}
🗺️ **Note about the RCore Prison Map:**

The included RCORE Prison map **does not have a visitation room**, and the **canteen is located in a different section** of the prison (marked as a C on the map).

If you are migrating from **QBOX** or **QBCore**, those frameworks may come with a different prison map that **includes a visitation area**.
{% endhint %}

</details>

***

### Step 5: Define Items <a href="#define-items" id="define-items"></a>

* To define items in the RCore Prison script, you can either use the Deployer command or edit the configuration manually.
* Item definitions can be found at `rcore_prison/inventory_items.lua`
* Item images are located in `rcore_prison/assets/inventoryImages`

<details>

<summary>Using the Deployer command</summary>

* Full guide at this page [Inventory](https://documentation.rcore.cz/paid-resources/rcore_prison/inventory)

1. Start the server.
2. Open the server console (`txAdmin - Live console`)
3. Type the following command to automatically define items:

   ```bash
   prisonsetup mf-inventory
   prisonsetup es_extended
   ```

> **Note:** `inventory_name` should correspond to the name of your inventory system. Ensure it matches your configuration to avoid errors.

> **Note:** The deployer supports: **mf-inventory** and **es\_extended**. For other inventories, please follow the manual setup guide.

</details>

<details>

<summary>Manually Adding Items</summary>

* Follow this guide at this page [Inventory](https://documentation.rcore.cz/paid-resources/rcore_prison/inventory)

</details>

***

***

### Step 5: Define ace permissions <a href="#define-items" id="define-items"></a>

* Add to bottom of server.cfg permission part (script need this permission to use properly ACE permission)

```lua
add_ace resource.rcore_prison command.add_ace allow
add_ace resource.rcore_prison command.remove_ace allow
add_ace resource.rcore_prison command.add_principal allow
add_ace resource.rcore_prison command.remove_principal allow
```

***

### Step 6: Enjoy <a href="#start-server" id="start-server"></a>

* Start your server and enjoy RCore Prison.

{% hint style="info" %}
🔄 **Server items** If you’ve made any changes to your items (or just defined them for the first time), don’t forget to restart your server. This ensures all your custom items get properly registered into the system and everything works smoothly.
{% endhint %}

***

## Commands

You can adjust all command names in config.lua

| Command                    | Description                               |
| -------------------------- | ----------------------------------------- |
| /jailcp                    | Use this to manage prisoners in your city |
| /jail playerId time reason | For jailing citizens                      |
| /startcs playerId amount   | For setting citizens into COMS            |
| /unjail playerId           | For unjailing target citizen              |
| /removescs playerId        | For removing citizen COMS                 |
| /stopalarm                 | Stop current active alarm                 |
| /solitary playerId time    | For setting prisoners to solitary         |
| /rsolitary playerId        | For removing player from solitary         |

## Discord logs

1. Go to rcore\_prison/sconfig.lua
2. Change SConfig.LogWebhook value
