# Vehicle Properties

## Introduction

With the release of [T1GER Tuning System](/resources/t1ger-tuning-system.md), we needed to introduce our own `vehicleprops.lua` with get and set methods to fully ensure vehicle mods being applied and saved correctly.&#x20;

{% hint style="success" %}
You can easily add your 3rd-party custom edits from your current vehicle properties into our `vehicleprops.lua`.
{% endhint %}

## Setup

This guide will help you setup vehicle properties inside your framework functions.

{% hint style="info" %}
Please note. If you have 3rd-party resources that calls vehicle properties but not using ESX/QB framework functions, then you need to manually replace these with our exports.&#x20;
{% endhint %}

<details>

<summary>ESX</summary>

1. Navigate to `es_extended/client/functions.lua`
2. Find this function:

{% code fullWidth="false" %}

```lua
function ESX.Game.GetVehicleProperties(vehicle)
```

{% endcode %}

3. Take a backup of the whole function (in-case you have some custom edits, you want to transfer).
4. Replace the whole function with this code:

<pre class="language-lua"><code class="lang-lua"><strong>function ESX.Game.GetVehicleProperties(vehicle)
</strong>    return exports['t1ger_lib']:GetVehicleProperties(vehicle)
end
</code></pre>

5. Now find this function:

```lua
function ESX.Game.SetVehicleProperties(vehicle, props)
```

6. As we did in 3., take a backup of the whole function.&#x20;
7. Replace the whole function with this code:

<pre class="language-lua"><code class="lang-lua"><strong>function ESX.Game.SetVehicleProperties(vehicle, props)
</strong>    exports['t1ger_lib']:SetVehicleProperties(vehicle, props)
end
</code></pre>

8. If done correct, it should look like this (please ensure):\
   ![screenshot from es\_extened/client/functions.lua showing the updated changes.](/files/Sct90sUxFaz6BQ8c55QP)
9. Restart the server and you are all set!

</details>

<details>

<summary>QB Core</summary>

1. Navigate to `qb-core/client/functions.lua`
2. Find this function:

{% code fullWidth="false" %}

```lua
function QBCore.Functions.GetVehicleProperties(vehicle)
```

{% endcode %}

3. Take a backup of the whole function (in-case you have some custom edits, you want to transfer).
4. Replace the whole function with this code:

<pre class="language-lua"><code class="lang-lua"><strong>function QBCore.Functions.GetVehicleProperties(vehicle)
</strong>    return exports['t1ger_lib']:GetVehicleProperties(vehicle)
end
</code></pre>

5. Now find this function:

```lua
function QBCore.Functions.SetVehicleProperties(vehicle, props)
```

6. As we did in 3., take a backup of the whole function.&#x20;
7. Replace the whole function with this code:

<pre class="language-lua"><code class="lang-lua"><strong>function QBCore.Functions.SetVehicleProperties(vehicle, props)
</strong>    exports['t1ger_lib']:SetVehicleProperties(vehicle, props)
end
</code></pre>

8. If done correct, it should look like this (please ensure):\
   ![screenshot from qb-core/client/functions.lua showing the updated changes.](/files/Pd0uHK3VLojAaAQTycVe)
9. Restart the server and you are all set!

</details>

## Functions

The `GetVehicleProperties()` and `SetVehicleProperties()` functions can be found and altered inside `t1ger_lib/vehicleprops.lua`

### GetVehicleProperties

```lua
exports['t1ger_lib']:GetVehicleProperties(vehicle)
-- returns the given vehicle's properties
```

**Parameters:**

* vehicle: entity(vehicle)

### SetVehicleProperties

```lua
exports['t1ger_lib']:SetVehicleProperties(vehicle, props)
-- sets the given vehicle's properties
```

**Parameters:**

* vehicle: entity(vehicle)
* props: table(props)


---

# 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.t1ger.net/resources/t1ger-library/installation/vehicle-properties.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.
