# T1GER Dealerships

![](https://2167335559-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MiDWIMbFBeXle-trOlk%2Fuploads%2FrAackg7JgOQmHJrLY4t3%2Fcover_img.png?alt=media\&token=cd953aef-a014-4118-94aa-a0906296c13f)

#### [**View on Tebex**](https://store.t1ger.net/package/4727699) | [**CFX Forum Post**](https://forum.cfx.re/t/esx-t1ger-dealerships-all-in-one-multi-shops-jobs-aicrafts-boats-and-more/4770444) | [**YouTube Showcase**](https://youtu.be/fuZUXemcKPI) | [**Discord**](https://discord.gg/t1ger)

## INSTALLATION

### DEPENDENCIES

<table data-header-hidden><thead><tr><th width="150" align="center">Dependency</th><th width="150" align="center">Download</th><th width="150" align="center">Install</th><th>Description</th></tr></thead><tbody><tr><td align="center"><strong>Dependency</strong></td><td align="center"><strong>Download</strong></td><td align="center">In<strong>stall</strong></td><td><strong>Description</strong></td></tr><tr><td align="center"><code>esx_society</code></td><td align="center"><a href="https://github.com/esx-framework/esx-legacy/tree/main/[esx_addons]/esx_society">Link</a></td><td align="center">Optional</td><td>Required to use boss-menu, employment, etc.</td></tr><tr><td align="center"><code>esx_addonaccounts</code></td><td align="center"><a href="https://github.com/esx-framework/esx-legacy/tree/main/[esx_addons]/esx_addonaccount">Link</a></td><td align="center">Optional</td><td>Required to use society accounting/money and so on.</td></tr><tr><td align="center"><code>K4MB1 PDM Dealership (FREE)</code></td><td align="center"><a href="https://forum.cfx.re/uploads/short-url/bhL2DWM8Qd2rHNKSy365EoeGJDu.rar">Link</a></td><td align="center">Optional</td><td>Required to use predefined config setup for 2nd dealership.</td></tr></tbody></table>

### START

1. Extract`t1ger_dealerships.rar` and place it into your resource folder.
2. Install the SQL files into your database (⚠️see [#SQL](#sql) for instructions).
3. Setup`config.lua` (⚠️see [#CONFIGURATION](#configuration) for instructions).&#x20;
4. Add`ensure t1ger_dealerships`to your server start config (place it anywhere below the dependency & framework resources).

### SQL

{% hint style="danger" %}
Please open **`SQL`** folder from the resource and follow the below steps.

**Be aware:** if you have a **`vehicles`** table in your database, use **`main1.sql`** otherwise you need to use **`main2.sql`**.
{% endhint %}

1. Open either **`main1.sql`** or **`main2.sql`** and either execute the queries manually (my preferred way) or import the respective file.
2. Then open **`vehicle_display.sql`** and ensure that the **`model`** and **`name`** of the display vehicles exists in your **`vehicles`** table. If not then please change it to vehicles that do exists.

   *This is important, otherwise you may encounter errors on startup of the resource.*
3. Open **`jobs.sql`** and execute/import the file. If you change these names/values, makes sure to change/update equivalently in your config in the respective places.
4. This step is optional, but I have a **`vehicles.sql`** with default GTA vehicles, including DLC vehicles up to & including Los Santos Tuner DLC. However, this requires that your gameBuild is set to tuner ([click here](https://docs.fivem.net/docs/server-manual/server-commands/#sv_enforcegamebuild-build) for instructions).

### CONFIGURATION

{% hint style="warning" %}
Please go through **all** configurable options & settings in `config.lua` and configure them to your server's preferences.

Also please read the comments at the end of each line, for a brief information on what the option does.&#x20;
{% endhint %}

It is utmost important that your values for Config.Society in the resource matches your database values!

### UTILITIES

{% hint style="info" %}
In **`client/utils.lua`** there is a file where you can edit some utility functions. In here you can customize notifications, draw texts and many other functions. \
Please do read it through and make changes to meet your server's preferences.
{% endhint %}

## MISCELLANEOUS

### CHAT COMMANDS

{% hint style="info" %}
*Please note, all these command strings are configurable and can be disabled as well.*
{% endhint %}

| **Command**     | **Description**                                   |
| --------------- | ------------------------------------------------- |
| `/finance`      | Command to manage financing.                      |
| `/registration` | Command to view, show or give registration paper. |

### EXPORTS

{% hint style="info" %}
These are available exports in the resource - use them as you please and find necessary.
{% endhint %}

| Export Function                                     | Description                                                                                                                                                                                             |
| --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `exports['t1ger_dealerships']:ProduceNumberPlate()` | Use this export to generate a plate for a spawned vehicle. It checks against the database to make sure the plate doesn't exists. This is a replacement for exports\['esx\_vehicleshop']:GeneratePlate() |

## SCRIPT NOT WORKING / ERRORS

{% hint style="success" %}
**VEHICLE NAME NULL**\
[❓](https://emojipedia.org/question-mark/)  My vehicles show up as NULL and not by name.

[✔️](https://emojiguide.com/symbols/check-mark/) Please read [this post](https://forum.cfx.re/t/how-to-add-on-vehicles-detailed/37501) on CFX Forum on how to properly add custom vehicles to your server. If that didn't fix your issue, then find the respective`vehicles.meta` file (typically located in your stream folder for the given vehicle). In here you want to set the`<gameName>` property to match the given vehicle mode in your`vehicles` table in database. There is a [youtube guide here](https://youtu.be/m5mR9qUy164), I don't understand the language but the video itself should give you an idea.
{% endhint %}

{% hint style="success" %}
**NO DISPLAY VEHICLES**\
[❓](https://emojipedia.org/question-mark/)  There are no display vehicles in the showroom.&#x20;

[✔️](https://emojiguide.com/symbols/check-mark/) Please re-install the resource completely and follow all steps from [#INSTALLTION](#installation).&#x20;
{% endhint %}

{% hint style="success" %}
**AIRCRAFTS, BOATS ETC.**\
[❓](https://emojipedia.org/question-mark/)  Aircrafts, boats or other custom types doesn't work properly as display?

[✔️](https://emojiguide.com/symbols/check-mark/) By default the resource only supports cars as display vehicles and nothing else. However, aircrafts and other types may as well work. It's not supported and not intended by the resource. To purchase custom types, please use the `Config.MenuDealerships`.
{% endhint %}

{% hint style="info" %}
[🆘](https://emojipedia.org/sos-button/) **IF YOU HAVE TRIED YOUR BEST AND NOTHING WORKS, THEN CONTACT US ON OUR OFFICIAL DISCORD:** [**CLICK HERE**](https://discord.gg/FdHkq5q)**.**
{% endhint %}
