> For the complete documentation index, see [llms.txt](https://daburnergermany.gitbook.io/mymdt/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://daburnergermany.gitbook.io/mymdt/info/sync-config.sync.lua/vehicles.md).

# 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="/files/YU0o94HUT92vNMZveD1D" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/gi7oEbJnfgOCY1FPDZvV" 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="/files/EKPR1Ha0tYlrJ9TkCjNi" 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
