mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
464ab0cefb
Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> Co-authored-by: PabstMirror <pabstmirror@gmail.com> Co-authored-by: jonpas <jonpas33@gmail.com>
43 lines
1.0 KiB
Plaintext
43 lines
1.0 KiB
Plaintext
#include "script_component.hpp"
|
|
|
|
ADDON = false;
|
|
|
|
PREP_RECOMPILE_START;
|
|
#include "XEH_PREP.hpp"
|
|
PREP_RECOMPILE_END;
|
|
|
|
#include "initSettings.inc.sqf"
|
|
|
|
[
|
|
"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;
|
|
|
|
ADDON = true;
|