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:

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

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

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

Example of the "VehicleFuelType"

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

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.

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

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:

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

Now, all compacts will run only on natural gas.

Last updated