diff --git a/cScripts/cScripts_preInit.sqf b/cScripts/cScripts_preInit.sqf index 2e1ed269e..5dc7e4d22 100644 --- a/cScripts/cScripts_preInit.sqf +++ b/cScripts/cScripts_preInit.sqf @@ -202,6 +202,16 @@ private _cScriptSettings = "cScripts Mission Settings"; {}, true ] call CBA_fnc_addSetting; +[ // Increased fuel usage + QEGVAR(Settings,enableIncreasedFuelUsage), + "CHECKBOX", + ["Increased Fuel Usage", "Enables increased fuel usage for vehicles"], + [_cScriptSettings, "5; Vehicle"], + false, + true, + {}, + true +] call CBA_fnc_addSetting; [ // Factions QEGVAR(Settings,vehicleFactions), "EDITBOX", diff --git a/cScripts/functions/init/fn_init_vehicle.sqf b/cScripts/functions/init/fn_init_vehicle.sqf index a2b40b234..3c4a3409c 100644 --- a/cScripts/functions/init/fn_init_vehicle.sqf +++ b/cScripts/functions/init/fn_init_vehicle.sqf @@ -44,3 +44,17 @@ if !(EGVAR(Settings,enableVehicleSystem)) exitWith {}; }; INFO_2("VehicleinitPost", "initPost applied to %1 [%2]", _vehicle, typeOf _vehicle); }, true, ["man"], true] call CBA_fnc_addClassEventHandler; + +if !(EGVAR(Settings,enableIncreasedFuelUsage)) then { + INFO("VehicleFuelUsage", "Increase fuel usage system enabled"); + + if (isServer) then { + ["AllVehicles", "initPost", { + params ["_vehicle"]; + if (_vehicle isKindOf "LandVehicle") then { + INFO_2("VehicleFuelUsage", "Vehicle fuel usage increased by x2 to %1 [%2]...", _vehicle, typeOf _vehicle); + _vehicle setFuelConsumptionCoef 2; + }; + }, true, ["man"], true] call CBA_fnc_addClassEventHandler; + }; +};