mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
21 lines
704 B
Plaintext
21 lines
704 B
Plaintext
#include "script_component.hpp"
|
|
|
|
|
|
["minedetector_enabled", {
|
|
params ["_unit", "_type"];
|
|
private _config = [_type] call FUNC(getDetectorConfig);
|
|
|
|
private _helperObject = "ACE_LogicDummy" createVehicleLocal (getPos _unit);
|
|
_unit setvariable [QGVAR(helperLogic), _helperObject];
|
|
|
|
[FUNC(detectorLoop), 0.05, [_unit, _type, _config, ACE_time, _helperObject]] call CBA_fnc_addPerFrameHandler;
|
|
}] call EFUNC(common,addEventhandler);
|
|
|
|
["minedetector_disabled", {
|
|
params ["_unit", "_type"];
|
|
private _helperObject = _unit getvariable [QGVAR(helperLogic), objNull];
|
|
if !(isNull _helperObject) then {
|
|
deleteVehicle _helperObject;
|
|
};
|
|
}] call EFUNC(common,addEventhandler);
|