CBA Events

This commit is contained in:
PabstMirror 2016-06-11 14:57:04 -05:00
parent 00e5cef145
commit ddf9e0b5cc
3 changed files with 6 additions and 6 deletions

View File

@ -1,7 +1,7 @@
#include "script_component.hpp"
["minedetector_enabled", {
[QGVAR(detectorEnabled), {
params ["_unit", "_type"];
private _config = [_type] call FUNC(getDetectorConfig);
@ -9,15 +9,15 @@
_unit setvariable [QGVAR(helperLogic), _helperObject];
[FUNC(detectorLoop), 0.01, [_unit, _type, _config, ACE_time, _helperObject]] call CBA_fnc_addPerFrameHandler;
}] call EFUNC(common,addEventhandler);
}] call CBA_fnc_addEventHandler;
["minedetector_disabled", {
[QGVAR(detectorDisabled), {
params ["_unit", "_type"];
private _helperObject = _unit getvariable [QGVAR(helperLogic), objNull];
if !(isNull _helperObject) then {
deleteVehicle _helperObject;
};
}] call EFUNC(common,addEventhandler);
}] call CBA_fnc_addEventHandler;

View File

@ -21,4 +21,4 @@ params ["_unit", "_detectorType"];
_unit setvariable [format[QGVAR(enable_%1), _detectorType], false];
["minedetector_disabled", [_unit, _detectorType]] call EFUNC(common,localEvent);
[QGVAR(detectorDisabled), [_unit, _detectorType]] call CBA_fnc_localEvent;

View File

@ -21,4 +21,4 @@ params ["_unit", "_detectorType"];
_unit setvariable [format[QGVAR(enable_%1), _detectorType], true];
["minedetector_enabled", [_unit, _detectorType]] call EFUNC(common,localEvent);
[QGVAR(detectorEnabled), [_unit, _detectorType]] call CBA_fnc_localEvent;