# Installation

Welcome to the Gang-Activities installation guide. Here, you will learn how to fully install our asset to ensure a smooth and trouble-free setup for your FiveM server. By carefully following each step in this guide, you will achieve a clean and efficient installation.

{% hint style="info" %}
If you encounter any issues during the installation, please do not hesitate to reach out for assistance. Open a ticket in our Discord server, and our dedicated support team will be ready to help you resolve any problems. We're committed to ensuring that your setup process is as smooth and trouble-free as possible, so feel free to contact us with any questions or concerns you may have.
{% endhint %}

***

### Download the asset

After purchasing the script from our store at [**Redutzu's Scripts Store**](https://store.redutzu.com), head over to [**Keymaster**](https://keymaster.fivem.net/asset-grants). Here, you will find the assets you have acquired. Download the scripts named **"Gang Activities"**  to your environment.

{% hint style="danger" %}
The script will not work if the asset is not purchased and present on your Keymaster account. Additionally, please be aware that if you transfer these assets, you will not be able to receive them back, and the script will cease to function.
{% endhint %}

***

### Download the dependencies

To make sure the MDT works as it should, there are a few scripts you must download. These extra scripts are key for the MDT system to run well and fit into your FiveM server. Be sure to get all the needed dependencies listed in the documentation to ensure a smooth and fully working setup.

<table><thead><tr><th width="224">Dependency</th><th>Link</th></tr></thead><tbody><tr><td>oxmysql / mysql-async</td><td><a href="https://github.com/overextended/oxmysql/releases">OxMySQL</a> or <a href="https://github.com/brouznouf/fivem-mysql-async/releases">MySQL-Async</a></td></tr></tbody></table>

{% hint style="info" %}
For optimal performance and smooth operation of the script, we highly recommend having one of the latest recommended artifacts installed.
{% endhint %}

***

### Start the resources

To get Gang Activities running smoothly on your FiveM server, it's important to start the scripts in the right order. This ensures everything loads correctly, avoiding problems and making sure the MDT system works well.

```systemd
# The first hing you want to start is your database wrapper
ensure oxmysql / mysql-async

# Then start your core
ensure es_extended / qb-core / qbx_core / vrp

ensure gang-activities
```

{% hint style="danger" %}
Make sure the license for your server matches the account where you bought the script. Using different licenses will cause errors, making the script to not work.
{% endhint %}

***

### Enable onesync

To ensure the script runs optimally and missions function correctly, it is strongly recommended — and in fact required — to enable **OneSync** and **OneSync Infinity**, along with several additional settings that improve overall performance.

```systemd
onesync on
onesync_enableInfinity 1
onesync_distanceCullVehicles true
onesync_forceMigration true
onesync_population false
onesync_distanceCulling false
```

### Insert the SQL

This step is crucial, so pay close attention. Inserting the SQL is a vital part of setting up the MDT on your server. Be sure to follow each step carefully and with full attention to detail. This ensures that the database is properly configured and ready to support the functionality of the MDT system without any issues.

{% hint style="warning" %}
The SQL file is working for every type of framework, you do not need a special one for your server.
{% endhint %}

{% tabs %}
{% tab title="Default" %}
You must insert this code, no matter which framework you're using. This is the main SQL required for the script to function properly.

```sql
CREATE TABLE `gang_activities` (
  `id` int(255) NOT NULL AUTO_INCREMENT,
  `identifier` varchar(20) NOT NULL,
  `avatar` varchar(255) DEFAULT 'default',
  `level` int(20) DEFAULT 1,
  `xp` int(255) DEFAULT 0,
  `statistics` LONGTEXT,
  `missions` LONGTEXT,
  PRIMARY KEY (`id`)
) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
```

{% endtab %}
{% endtabs %}

***

### Start your server

You can now start your server and enjoy the script. Additionally, you can configure the script further to match your preferences. For more information, refer to the configuration section.


---

# 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://docs.redutzu.com/resources/gang-activities/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.
