# Installation

### Dependencies

<details>

<summary>oxmysql</summary>

#### Installation

* Download the [latest build](https://github.com/overextended/oxmysql/releases/latest) of oxmysql (not the source code).
* Extract the contents of the archive to your resources folder.
* Start the resource near the top of your resources in your server.cfg.

#### Required version

Your oxmysql version must be <mark style="color:yellow;">2.0.0 or above</mark> in order to work with our system.

#### Use the built version

Make sure you have downloaded the <mark style="color:yellow;">built version</mark> of oxmysql! If you download the source code, then the resource won't start and queries are unable to execute.&#x20;

The built version can be downloaded from the [releases page](https://github.com/overextended/oxmysql/releases/latest) (oxmysql.zip).

</details>

<details>

<summary>ox_lib</summary>

#### Installation

* Download the [latest build](https://github.com/overextended/ox_lib/releases/latest) of ox\_lib (not the source code).
* Extract the contents of the archive to your resources folder.
* Start the resource near the top of your resources in your server.cfg.

#### Use the built version

Make sure you have downloaded the <mark style="color:yellow;">built version</mark> of ox\_lib! If you download the source code, then it won't function correctly and the application will have problems.&#x20;

The built version can be downloaded from the [releases page](https://github.com/overextended/ox_lib/releases/latest) (ox\_lib.zip).

</details>

### Installing the resource

1. Make sure you have the [dependencies](#dependencies) listed above installed.
2. Extract the contents of the archive to your resources folder.
3. Run the SQL queries provided in <mark style="color:blue;">rahe-racing/sql/db.sql</mark>.
4. Choose your framework tab from the section below & follow the instructions.

{% tabs %}
{% tab title="QB" %}
In the file <mark style="color:blue;">rahe-racing/public/config/shared.lua</mark> change the framework to <mark style="color:blue;">'QB'.</mark>
{% endtab %}

{% tab title="ESX" %}
In the file <mark style="color:blue;">rahe-racing/public/config/shared.lua</mark> change the framework to <mark style="color:blue;">'ESX'.</mark>
{% endtab %}

{% tab title="Standalone" %}
In the file <mark style="color:blue;">rahe-racing/public/config/shared.lua</mark> make sure the framework is set to <mark style="color:blue;">'STANDALONE'.</mark>

Fill in the framework functions (like giving/removing money) if needed, taking QB/ESX as an example.
{% endtab %}

{% tab title="Custom" %}
In the file <mark style="color:blue;">rahe-racing/public/config/shared.lua</mark> make sure the framework is set to <mark style="color:blue;">'CUSTOM'.</mark>

Fill in the framework functions (like giving/removing money) if needed, taking QB/ESX as an example.
{% endtab %}
{% endtabs %}

### Using the resource

Use the command <mark style="color:blue;">/racing</mark> in-game to open the application tablet.

### Importing tracks

There are about 100 custom-made tracks included with the resource. If you wish, you can import these into your database to have some inital tracks. This is completely voluntary and is not required if you want to create your own tracks.

To import them, just run the SQL query provided in <mark style="color:blue;">rahe-racing/sql/tracks.sql</mark>

{% hint style="info" %}
The tracks SQL file is quite large and some databases tend to time out when trying to import the tracks. To counter this, please run the following SQL query before importing:

<mark style="color:blue;">`SET GLOBAL max_allowed_packet=1073741824;`</mark>
{% endhint %}
