# Installation & Configuration

{% stepper %}
{% step %}

### Add the resource

Drag the `dynyx_prison` folder into your `resources` directory.

Make sure to rename the script from `dynyx_prison-main` to `dynyx_prison` or it will not work. Then make sure its in the correct location so the server can access it. Once done, add `ensure dynyx_prison` to your `server.cfg` to activate the script.&#x20;
{% endstep %}

{% step %}

### Install Dependencies

**Ensure all required dependencies for the script are installed and up to date.**&#x20;

Dependencies usually include core resources like the frameworks (**QBCore**, **QBox** or **ESX**), target systems (`ox_target` or `qb-target`) and an inventory system like (`ox_inventory`, `qb-inventory`, `ps-inventory`, `qs-inventory`, `origen_inventory`, or `core_inventory`). Missing dependencies may prevent the script from working property.
{% endstep %}

{% step %}

### Import the SQL File

**Open your database (like HeidiSQL or phpMyAdmin) and import the provided SQL file.**\
This step adds the necessary tables and data structure to your database, ensuring that the prison system can store and retrieve relevant information such as inmate records, escape flags, and confiscated items.
{% endstep %}

{% step %}

### Ensure MLO Compatility

**Dynyx Prison is designed to work with the Prompt Studios Bolingbroke Prison MLO & GabZ Bolingbroke Prison MLO.**\
This MLO is required for proper interior functionality. If you're using a different MLO, open a ticket in our Discord for placement adjustments and support.

> ❗ **Need help with MLO compatibility?**\
> 🎫 Open a ticket in our [Discord](https://discord.gg/dynyxscripts) for help adapting to other prison interiors.
> {% endstep %}

{% step %}

### Add the Corrections Officer Job

The CO systems (tablet `/co`, cameras, inspections, patrols, solitary, etc.) require a **job role** in your framework.

{% tabs %}
{% tab title="QBox" %}

1. Open: `qbx_core/shared/jobs.lua`
2. Add this job inside the jobs table:

```lua
['co'] = {
    label = 'Corrections Officer',
    type = 'leo',
    defaultDuty = true,
    offDutyPay = false,
    grades = {
        [0] = { name = 'Recruit', payment = 50 },
        [1] = { name = 'Officer', payment = 75 },
        [2] = { name = 'Sergeant', payment = 100 },
        [3] = { name = 'Lieutenant', payment = 125 },
        [4] = { name = 'Chief', isboss = true, bankAuth = true, payment = 150 },
    },
},
```

3. Restart your server.
   {% endtab %}

{% tab title="QBCore" %}

1. Open: `qb-core/shared/jobs.lua`
2. Add this job inside `QBShared.Jobs`:

```lua
['co'] = {
    label = 'Corrections Officer',
    defaultDuty = true,
    offDutyPay = false,
    grades = {
        [0] = { name = 'Recruit', payment = 50 },
        [1] = { name = 'Officer', payment = 75 },
        [2] = { name = 'Sergeant', payment = 100 },
        [3] = { name = 'Lieutenant', payment = 125 },
        [4] = { name = 'Chief', isboss = true, payment = 150 },
    },
},
```

3. Restart your server.
   {% endtab %}

{% tab title="ESX" %}

ESX jobs must exist in the database.

1. Open your database (HeidiSQL/phpMyAdmin)
2. Run the SQL below:

```sql
INSERT IGNORE INTO jobs (name, label) VALUES ('co', 'Corrections Officer');

INSERT IGNORE INTO job_grades (job_name, grade, name, label, salary) VALUES
('co', 0, 'recruit', 'Recruit', 50),
('co', 1, 'officer', 'Officer', 75),
('co', 2, 'sergeant', 'Sergeant', 100),
('co', 3, 'lieutenant', 'Lieutenant', 125),
('co', 4, 'chief', 'Chief', 150);
```

3. Restart your server.
   {% endtab %}
   {% endtabs %}
   {% endstep %}

{% step %}

### Configure Inventory Integration

**Navigate to your `inventory` folder.**

Choose the correct guide for your inventory system. Each guide has specific instructions and images for setting up item images and ensuring full compatibility with your chosen inventory.

* [ox\_inventory](/dynyx-scripts/prison/installation-and-configuration/ox_inventory.md)
* [qb-inventory](/dynyx-scripts/prison/installation-and-configuration/qb-inventory-ps-inventory.md) / [ps-inventory](/dynyx-scripts/prison/installation-and-configuration/qb-inventory-ps-inventory.md)
* [qs-inventory](/dynyx-scripts/prison/installation-and-configuration/qs-inventory.md)
* [tgiann-inventory](/dynyx-scripts/prison/installation-and-configuration/tgiann-inventory.md)
* origen\_inventory
* core\_inventory

{% endstep %}
{% endstepper %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dynyx-scripts.gitbook.io/dynyx-scripts/prison/installation-and-configuration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
