2015-01-16 13:20:41 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-01-29 07:38:46 +00:00
|
|
|
ADDON = false;
|
|
|
|
|
2016-11-23 19:35:25 +00:00
|
|
|
PREP_RECOMPILE_START;
|
2016-02-22 14:20:36 +00:00
|
|
|
#include "XEH_PREP.hpp"
|
2016-11-23 19:35:25 +00:00
|
|
|
PREP_RECOMPILE_END;
|
2015-01-29 07:38:46 +00:00
|
|
|
|
2023-12-07 03:20:47 +00:00
|
|
|
#include "initSettings.inc.sqf"
|
2019-04-01 09:17:18 +00:00
|
|
|
|
|
|
|
[
|
|
|
|
"AllVehicles",
|
|
|
|
"initPost",
|
|
|
|
{
|
|
|
|
params ["_vehicle"];
|
|
|
|
_vehicle setVariable [QGVAR(engineState), isEngineOn _vehicle];
|
|
|
|
}
|
|
|
|
] call CBA_fnc_addClassEventHandler;
|
|
|
|
[
|
|
|
|
"AllVehicles",
|
|
|
|
"engine",
|
|
|
|
{
|
|
|
|
params ["_vehicle", "_state"];
|
|
|
|
_vehicle setVariable [QGVAR(engineState), _state];
|
|
|
|
}
|
|
|
|
] call CBA_fnc_addClassEventHandler;
|
|
|
|
[
|
|
|
|
"AllVehicles",
|
|
|
|
"getout",
|
|
|
|
{
|
|
|
|
params ["_vehicle", "_position", "_unit"];
|
|
|
|
if (!GVAR(keepEngineRunning)) exitWith {};
|
|
|
|
if (_unit == ACE_player && {_position == "driver" && {_vehicle getVariable [QGVAR(engineState), false]}}) then {
|
|
|
|
[{
|
|
|
|
params ["_vehicle"];
|
|
|
|
[QEGVAR(common,engineOn), _this, _vehicle] call CBA_fnc_targetEvent;
|
|
|
|
}, [_vehicle, true]] call CBA_fnc_execNextFrame;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
] call CBA_fnc_addClassEventHandler;
|
|
|
|
|
2015-01-29 07:38:46 +00:00
|
|
|
ADDON = true;
|