> For the complete documentation index, see [llms.txt](https://squirrel-bracket.gitbook.io/squirrel-bracket-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://squirrel-bracket.gitbook.io/squirrel-bracket-documentation/handling-tuning/installation.md).

# Installation

Installation difficulty

🟠⚫⚫⚫⚫

### Download the resource

* Head to your [cfx keymaster](https://keymaster.fivem.net/asset-grants), in `Granted Assets` look for an asset called `sb-handlingtuning V2 Latest Release` and download it.

### Install dependencies

* Download and install [ox\_lib](https://github.com/overextended/ox_lib/releases)
  * Insallation guide: <https://overextended.dev/ox_lib>

### Create inventory items

{% tabs %}
{% tab title="ox\_inventory" %}
Add this to `ox_inventory/data/items.lua`

```lua
['car_mod_nitro_kit'] = {
    label = 'Nitro Kit',
    weight = 500,
    close = true,
    client = {},
},
['car_mod_nitro_tank'] = {
    label = 'Nitro Refill Tank',
    weight = 700,
    close = true,
    client = {},
},
['car_mod_diff_lsd'] = {
    label = 'LSD Differential',
    weight = 1000,
    close = true,
    client = {},
},
['car_mod_diff_welded'] = {
    label = 'Welded Differential',
    weight = 1000,
    close = true,
    client = {},
},
['car_mod_tires'] = {
    label = 'Sport Tires',
    weight = 1000,
    close = true,
    client = {},
    server = {
        -- Add server export if needed
    },
},
['car_mod_stiff_arb'] = {
    label = 'Stiff ARB',
    weight = 1000,
    close = true,
    client = {},
},
['car_mod_ecu'] = {
    label = 'ECU',
    weight = 175,
    close = true,
    client = {},
},
['car_mod_lock_kit'] = {
    label = 'Lock Kit',
    weight = 800,
    close = true,
    client = {},
},

["tunertablet"] = {
    label = "Tuner tablet",
    weight = 1,
    stack = true,
    close = true,
},

["smalltunertablet"] = {
    label = "Small tuner tablet",
    weight = 1,
    stack = true,
    close = true,
},
```

{% endtab %}

{% tab title="ESX" %}
Run the following sql code on your database:

```sql
-- Tablet items
INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES
    ('tunertablet',	'Spray',	200,	1,	1),
    ('smalltunertablet',	'Spray Remover',	150,	1,	1);

-- Upgrades items
INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES
    ('car_mod_nitro_kit',	'Nitro Kit',	500,	1,	1),
    ('car_mod_nitro_tank',	'Nitro Refill Tank',	700,	1,	1),
    ('car_mod_diff_lsd', 'LSD Differential', 1000, 1, 1),
    ('car_mod_diff_welded', 'Welded Differential', 1000, 1, 1),
    ('car_mod_tires', 'Sport Tires', 1000, 1, 1),
    ('car_mod_stiff_arb', 'Stiff ARB', 1000, 1, 1),
    ('car_mod_ecu', 'ECU', 175, 1, 1),
    ('car_mod_lock_kit', 'Lock kit', 800, 1, 1);
```

{% endtab %}

{% tab title="QBCore" %}
Add the following to `qb-core/shared.lua` > `QBShared.Items`

{% code fullWidth="true" %}

```lua
['car_mod_nitro_kit'] = {['name'] = 'car_mod_nitro_kit', ['label'] = 'Nitro Kit', ['weight'] = 500, ['type'] = 'item', ['image'] = 'car_mod_nitro_kit.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'A kit for installing nitrous oxide boosting'},
['car_mod_nitro_tank'] = {['name'] = 'car_mod_nitro_tank', ['label'] = 'Nitro Refill Tank', ['weight'] = 700, ['type'] = 'item', ['image'] = 'car_mod_nitro_tank.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'A refill tank for nitrous oxide systems'},
['car_mod_diff_lsd'] = {['name'] = 'car_mod_diff_lsd', ['label'] = 'LSD Differential', ['weight'] = 1000, ['type'] = 'item', ['image'] = 'car_mod_diff_lsd.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Limited Slip Differential for better traction'},
['car_mod_diff_welded'] = {['name'] = 'car_mod_diff_welded', ['label'] = 'Welded Differential', ['weight'] = 1000, ['type'] = 'item', ['image'] = 'car_mod_diff_welded.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Welded Differential for drift racing'},
['car_mod_tires'] = {['name'] = 'car_mod_tires', ['label'] = 'Sport Tires', ['weight'] = 1000, ['type'] = 'item', ['image'] = 'car_mod_sport_tires.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'High-performance sport tires'},
['car_mod_stiff_arb'] = {['name'] = 'car_mod_stiff_arb', ['label'] = 'Stiff ARB', ['weight'] = 1000, ['type'] = 'item', ['image'] = 'car_mod_stiff_arb.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Stiff Anti-Roll Bar for improved handling'},
['car_mod_ecu'] = {['name'] = 'car_mod_ecu', ['label'] = 'ECU', ['weight'] = 175, ['type'] = 'item', ['image'] = 'car_mod_ecu.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Engine Control Unit for performance tuning'},
['car_mod_lock_kit'] = {['name'] = 'car_mod_lock_kit', ['label'] = 'Lock Kit', ['weight'] = 800, ['type'] = 'item', ['image'] = 'car_mod_lock_kit.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = ''},
['tunertablet'] = {['name'] = 'tunertablet', ['label'] = 'Tuner Tablet', ['weight'] = 1000, ['type'] = 'item', ['image'] = 'tunertablet.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Tablet used to adjust vehicle handling data'},
['smalltunertablet'] = {['name'] = 'smalltunertablet', ['label'] = 'Small Tuner Tablet', ['weight'] = 1000, ['type'] = 'item', ['image'] = 'smalltunertabler.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Small Tablet used to adjust vehicle handling data'},

```

{% endcode %}
{% endtab %}
{% endtabs %}

### Unzip the resource archive

* Using 7zip or win rar unzip the archive you just downloaded.

### Add the script to your server `resources` folder

* Locate your server files and inside it find the `resources` folder;
* Copy and paste the `sb-handlingtuning` folder to it;
* Add the resource to your `server.cfg` by adding the following line:\
  `ensure sb-handlingtuning`;
* Restart the server...
  * The resource should identify your framework and create database tables. To make sure the automatic processes went through properly have a look at messages that come up on your server console.

### Save default handling data

* In game use command `/admin:cars` and save all vehicles data

## Common issues

TODO
