# Installation

{% stepper %}
{% step %}

#### Install MariaDB

We highly recommend to use MariaDB since XAMPP it's outdated

{% hint style="warning" %}
Do not use XAMPP&#x20;
{% endhint %}

{% hint style="info" %}
Always take a backup of the sql before doing any changes in the script database
{% endhint %}

Install [MARIADB](https://mariadb.org/download/?t=mariadb\&p=mariadb\&r=12.2.2\&os=windows\&cpu=x86_64\&pkg=msi\&mirror=raiolanetworks) version 10.11 or newer, if you don't have it already. You can check your MariaDB version by runnning SELECT VERSION() in HeidiSQL.
{% endstep %}

{% step %}

#### Run the SQL file

Enable AutoCreateSQL on `config/config.lua`

{% code title="silio\_sanctions/config/config.lua" %}

```lua
Config.AutoCreateSQL = true -- Automatically creates the SQL table for reports if it doesn't exist
```

{% endcode %}

And disable it once created

Or run the sql file that it's on `sql/insert.sql`

<details>

<summary>SQL CODE</summary>

{% code title="silio\_reports/sql/insert.sql" %}

```sql
CREATE TABLE IF NOT EXISTS `silio_reports` (
    `id`                 INT(11) NOT NULL AUTO_INCREMENT,
    `identifier`         VARCHAR(60) NOT NULL,
    `name`               VARCHAR(100) NOT NULL,
    `motivo`             VARCHAR(150) NOT NULL,
    `descripcion`        TEXT NOT NULL,
    `screenshot_url`     TEXT DEFAULT NULL,
    `timestamp`          INT(11) NOT NULL DEFAULT 0,
    `fecha_legible`      VARCHAR(50) DEFAULT NULL,
    `status`             ENUM('pendiente','resuelto') DEFAULT 'pendiente',
    `claimed_by`         VARCHAR(60) DEFAULT NULL,
    `chat`               LONGTEXT DEFAULT NULL,
    `screenshare_videos` LONGTEXT DEFAULT NULL,
    PRIMARY KEY (`id`),
    KEY `idx_identifier` (`identifier`),
    KEY `idx_status`     (`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `silio_reports_ranks` (
    `rankname`       VARCHAR(65) NOT NULL,
    `ranklabel`      VARCHAR(65) NOT NULL,
    `rankcolor`      VARCHAR(20) DEFAULT '#FFC300',
    `rankpermission` LONGTEXT DEFAULT NULL,
    `rank_order`     INT DEFAULT 999,
    PRIMARY KEY (`rankname`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `silio_reports_players` (
    `identifier`  VARCHAR(60) NOT NULL,
    `name`        VARCHAR(100) DEFAULT NULL,
    `rankname`    VARCHAR(65) DEFAULT 'user',
    `is_owner`    TINYINT(1) DEFAULT 0,
    `override`    LONGTEXT DEFAULT NULL,
    PRIMARY KEY (`identifier`),
    KEY `idx_rankname` (`rankname`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `silio_reports_stats` (
    `identifier`       VARCHAR(60) NOT NULL,
    `name`             VARCHAR(100) NOT NULL DEFAULT '',
    `reports_attended` INT DEFAULT 0,
    `reports_resolved` INT DEFAULT 0,
    `actions_taken`    INT DEFAULT 0,
    `last_active`      INT DEFAULT 0,
    PRIMARY KEY (`identifier`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `silio_reports_daily` (
    `day_ts`               INT NOT NULL,
    `reports_created`      INT DEFAULT 0,
    `total_attention_secs` BIGINT DEFAULT 0,
    `attention_count`      INT DEFAULT 0,
    PRIMARY KEY (`day_ts`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `silio_reports_logs` (
    `id`          INT(11) NOT NULL AUTO_INCREMENT,
    `admin_name`  VARCHAR(100) NOT NULL DEFAULT '',
    `target_name` VARCHAR(100) DEFAULT NULL,
    `action`      VARCHAR(50) NOT NULL DEFAULT '',
    `report_id`   INT DEFAULT NULL,
    `timestamp`   INT(11) NOT NULL DEFAULT 0,
    PRIMARY KEY (`id`),
    KEY `idx_timestamp` (`timestamp`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `silio_reports_player_logs` (
    `id`          INT(11) NOT NULL AUTO_INCREMENT,
    `identifier`  VARCHAR(60) NOT NULL DEFAULT '',
    `player_name` VARCHAR(100) DEFAULT NULL,
    `log_type`    VARCHAR(50) NOT NULL DEFAULT '',
    `details`     TEXT DEFAULT NULL,
    `timestamp`   INT(11) NOT NULL DEFAULT 0,
    PRIMARY KEY (`id`),
    KEY `idx_identifier` (`identifier`),
    KEY `idx_timestamp`  (`timestamp`),
    KEY `idx_log_type`   (`log_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

```

{% endcode %}

</details>
{% endstep %}

{% step %}

#### Install all dependencies

Download and install the following dependencies

* [oxmysql](https://github.com/overextended/oxmysql)
* up-to-date [server artifacts](https://runtime.fivem.net/artifacts/fivem/build_server_windows/master/)
* [pma-voice](https://github.com/AvarianKnight/pma-voice/releases/tag/v6.6.2) - need for voiceCall enabled
  {% endstep %}

{% step %}

#### Add to server.cfg

```ini
# Silio Sanctions
ensure silio_sanctions
```

{% endstep %}

{% step %}

#### Verify fxmanifest.lua

Check that you have uncommented the sql script that you are using

{% code title="silio\_sanctions/fxmanifest.lua" %}

```lua
server_scripts {
    '@oxmysql/lib/MySQL.lua',
    -- '@mysql-async/lib/MySQL.lua',
}
```

{% endcode %}
{% endstep %}

{% step %}

#### Configure

Configure the scripts as your server needs. See [configuration](/silio-scripts/scripts/silio-reports/configuration.md) for more info
{% 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://silio-scripts.gitbook.io/silio-scripts/scripts/silio-sanctions/installation.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.
