# Understanding Prices

To understand the configuration of prices, you must first know the priority of their recognition and examples of use.

***

## Database

The highest priority, if you use the [*`Config.LoadPricesFromDatabase`*](#user-content-fn-1)[^1] option and a price for a specific model is obtained from the database, this price will be the most important for tuning.

***

## By model

Getting the price by model in [`Config.Vehicles`](#user-content-fn-2)[^2] is the second point of priority, you can configure this option in two ways, a more extensive one defining the price for cosmetic, mechanical and extra options, and a simple one that will calculate to each part a percentage of one price.

<details>

<summary>Extensive Way</summary>

In the Extensive Way, you must define three options in the table.

Options that fall under:\
`mechanicals`: Engine, Brakes, Transmission, Suspension, Armor, Turbo\
`extras`: Paint Type Primary, Paint Type Secondary, Xenon Color, Horn, Livery\
`cosmetics`: all the rest not mentioned above

```lua
["italigtb2"] = {
    mechanicals = 500000,
    cosmetics = 300000, 
    extras = 130000, 
},
```

</details>

<details>

<summary>Simple Way</summary>

In the Simple Way, you only have to define the amount of the vehicle.

{% code fullWidth="false" %}

```lua
["italigtb2"] = 300000,
```

{% endcode %}

</details>

***

## By class

Getting the price by vehicle class in [`Config.VehiclesPricesByClass`](#user-content-fn-2)[^2], is the third point in priority, you can also configure this option in two ways like the above - extensive and simple.

<details>

<summary>Extensive Way</summary>

In the Extensive Way, you must define three options in the table.

Options that fall under:\
`mechanicals`: Engine, Brakes, Transmission, Suspension, Armor, Turbo\
`extras`: Paint Type Primary, Paint Type Secondary, Xenon Color, Horn, Livery\
`cosmetics`: all the rest not mentioned above

```lua
[0] = { -- Compacts
    mechanicals = 65000,
    cosmetics = 40000, 
    extras = 32000, 
},
[1] = { -- Sedans
    mechanicals = 90000,
    cosmetics = 70000, 
    extras = 45000, 
},
```

</details>

<details>

<summary>Simple Way</summary>

In the Simple Way, you only have to define the amount of the vehicle.

{% code fullWidth="false" %}

```lua
[0] = 65000, -- Compacts
[1] = 90000, -- Sedans
```

{% endcode %}

</details>

***

## By default price

If none of the above options apply to the vehicle you are currently trying to tune, then it will load a fixed price from [`Config.DefaultVehiclePrice`](#user-content-fn-1)[^1]

[^1]: config.lua

[^2]: config.vehicles.lua
