# Vehicles

{% hint style="info" %}
If the exports are active and the sync is also active, the sync is preferred and the exports are deactivated.
{% endhint %}

**Configure in config.sync.lua**

Make sure that in Config.Sync the entry active is set to true and in Types the Users & Vehicles are set to true. (if Users is false there is no correct connection to the owner)

<figure><img src="https://lh6.googleusercontent.com/xWSv4LumRAnlGLJCr8U2TQZq_vytI0D6PvYsRQgOUMoqXNAhVRlIMPZJYYtUWfbFlapWeVdWTMJw0XZdqEotQiguNES7CiutFyS2qeggFiA49ye52LIkpDUhSvyGXG52Y3JKf-5C1Hkn0XMQ2sqh2Ow" alt=""><figcaption><p>ConConfig.Sync is now SyncSettings.MainData</p></figcaption></figure>

### **(Optional VehiclesWhere)**

You can insert a custom where statement for the vehicles sync

Only the column in the Vehicles-Table can be filtered

1. ESX “owned\_vehicles”
2. QB “player\_vehicles”

#### Example filters:

This filter will remove all vehicles where plate is starting with LSPD or LSMD

ESX

owned\_vehicles.plate not like ‘LSPD%’ AND owned\_vehicles.plate not like ‘LSMD%’

QB

player\_vehicles.plate not like ‘LSPD%’ AND player\_vehicles.plate not like ‘LSMD%’

## **Add data to the sync**

1. Open the sync\_functions.lua with any ide (notepad++, visual studio code)
   1. /server/sync/vehicles.lua
2. Search in the file the FormatData function for your Framework
   1. ESX : myMDT\_core\_sync.vehicles.FormatData\_ESX
   2. QB: myMDT\_core\_sync.vehicles.FormatData\_QB

<figure><img src="https://1719785099-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGFy5gkCCSVwo9uFjcwjL%2Fuploads%2Fi52dj0CxYjPPkEhzmP0m%2Fimage.png?alt=media&#x26;token=298f6517-1ac7-4b48-b890-10b28d76c346" alt=""><figcaption></figcaption></figure>

The Important part is now where the curly brackets from the return

<figure><img src="https://1719785099-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGFy5gkCCSVwo9uFjcwjL%2Fuploads%2FCNEB1UmLygeSe9w9UAeq%2Fimage.png?alt=media&#x26;token=f9eef91f-809a-4dd8-95da-85717691e2c8" alt=""><figcaption></figcaption></figure>

if your vehicles-table stores the model of the vehicle than you simply need to add this like following:

<figure><img src="https://1719785099-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGFy5gkCCSVwo9uFjcwjL%2Fuploads%2FMZReVbEal2Za0ZXIaGHw%2Fimage.png?alt=media&#x26;token=e184ce42-9680-40a1-8782-69165e3fd652" alt=""><figcaption><p>veh_model = inputData.model added</p></figcaption></figure>

on the left hand is the column name/key from myMDT\_core, on the right side is the column from your vehicles table.

**Never remove this keys : id, fromsystem, plate**

{% hint style="info" %}
if you want to remove the owner from sync please set follwing to false if available:&#x20;

```lua
myMDT_core_sync.vehicles.QuestionOwnerOnPartialSync
```

{% endhint %}

### **Available Keys**

owner

veh\_type

mot

veh\_model

others

color
