# Change fuel type for vehicle

### Location

This configuration is located in `rcore_fuel/config/fuel_config.lua`.

### Vehicle Fuel Type Configuration

The configuration is managed within the `Config.VehicleFuelType` array.

### Structure

The array structure consists of:

* `model`: The spawn model of the vehicle.
* `fuelType` The fuel type for the specific model.

Example of a new entry:

{% code overflow="wrap" lineNumbers="true" %}

```lua
{
    model = "myCar",
    fuelType = FuelType.NATURAL,
}
```

{% endcode %}

To find all types for the `FuelType` array, refer to the file located at `rcore_fuel/const.lua`. Look for the following array:

{% code overflow="wrap" lineNumbers="true" %}

```lua
FuelType = {
    NATURAL = 1,
    DIESEL = 2,
    EV = 3,
    LPG = 4,
    CNG = 5,
    MILK = 6,
    AVIATION = 7,
}
```

{% endcode %}

### Example of the "VehicleFuelType"

{% code overflow="wrap" lineNumbers="true" %}

```lua
Config.VehicleFuelType = {
    -- entry 1
    {
        model = "tesla",
        fuelType = FuelType.EV,
    },
    -- entry 2
    {
        model = "phantom3",
        fuelType = FuelType.DIESEL,
    },
    -- entry 3
    {
        model = "pavel",
        fuelType = FuelType.MILK,
    },
}
```

{% endcode %}

There is also the possibility to configure the fuel type for a specific vehicle class in the same config file mentioned above by using `Config.SpecificFuelTypePerVehicleClass`.

{% code overflow="wrap" lineNumbers="true" %}

```lua
Config.SpecificFuelTypePerVehicleClass = {
    [0] = { FuelType.DIESEL, FuelType.NATURAL }, -- Compacts
}
```

{% endcode %}

This will enforce either diesel or natural gas as the fuel type for the "compacts" class. If you wish to enforce only one specific fuel type, it can be done as follows:

{% code overflow="wrap" lineNumbers="true" %}

```lua
Config.SpecificFuelTypePerVehicleClass = {
    [0] = { FuelType.NATURAL }, -- Compacts
}
```

{% endcode %}

Now, all compacts will run only on natural gas.
