2017-10-10 16:06:37 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
[QGVAR(AISection), {
|
|
|
|
params [["_units", [], [[]]], ["_sections", [], [[]]], ["_bool", true, [true]]];
|
|
|
|
{
|
|
|
|
private _section = _x;
|
|
|
|
{
|
|
|
|
if (_bool) then {
|
|
|
|
_x enableAI _section;
|
2018-04-19 19:01:26 +00:00
|
|
|
LOG_3("%1 enableAI %2 | ID: %3",_x,_section,clientOwner);
|
2017-10-10 16:06:37 +00:00
|
|
|
} else {
|
|
|
|
_x disableAI _section;
|
2018-04-19 19:01:26 +00:00
|
|
|
LOG_3("%1 disableAI %2 | ID: %3",_x,_section,clientOwner);
|
2017-10-10 16:06:37 +00:00
|
|
|
};
|
2018-04-19 19:01:26 +00:00
|
|
|
} forEach (_units select {local _x});
|
|
|
|
} forEach _sections;
|
2017-10-10 16:06:37 +00:00
|
|
|
}] call CBA_fnc_addEventHandler;
|
|
|
|
|
2024-03-28 18:57:23 +00:00
|
|
|
[QGVAR(unGarrison), LINKFUNC(unGarrison)] call CBA_fnc_addEventHandler;
|
2018-02-24 17:44:57 +00:00
|
|
|
|
2017-10-10 16:06:37 +00:00
|
|
|
[QGVAR(doMove), {
|
|
|
|
params ["_unitsArray"];
|
2018-02-24 17:44:57 +00:00
|
|
|
{
|
2017-10-10 16:06:37 +00:00
|
|
|
_x params ["_unit", "_pos"];
|
2018-10-18 16:14:26 +00:00
|
|
|
_unit setDestination [_pos, "LEADER PLANNED", true];
|
2018-10-23 18:28:30 +00:00
|
|
|
_unit doMove _pos;
|
2018-04-19 19:01:26 +00:00
|
|
|
LOG_3("%1 doMove %2 | ID: %3",_unit,_pos,clientOwner);
|
|
|
|
} forEach _unitsArray;
|
2017-10-10 16:06:37 +00:00
|
|
|
}] call CBA_fnc_addEventHandler;
|
2018-02-24 17:44:57 +00:00
|
|
|
|
2017-10-10 16:06:37 +00:00
|
|
|
[QGVAR(setBehaviour), {
|
|
|
|
params ["_groupsArray", "_behaviour"];
|
2018-02-24 17:44:57 +00:00
|
|
|
{
|
2018-04-19 19:01:26 +00:00
|
|
|
_x setBehaviour _behaviour;
|
|
|
|
LOG_3("%1 setBehaviour %2 | ID: %3",_x,_behaviour,clientOwner);
|
|
|
|
} forEach _groupsArray;
|
2017-10-10 16:06:37 +00:00
|
|
|
}] call CBA_fnc_addEventHandler;
|
2018-02-24 17:44:57 +00:00
|
|
|
|
2017-10-10 16:06:37 +00:00
|
|
|
[QGVAR(enableAttack), {
|
|
|
|
params ["_unitsArray", "_mode"];
|
|
|
|
{
|
2018-04-19 19:01:26 +00:00
|
|
|
_x enableAttack _mode;
|
|
|
|
LOG_3("%1 enableAttack %2 | ID: %3",_x,_mode,clientOwner);
|
|
|
|
} forEach _unitsArray;
|
2017-10-10 16:06:37 +00:00
|
|
|
}] call CBA_fnc_addEventHandler;
|
|
|
|
|
2018-02-24 17:44:57 +00:00
|
|
|
[QGVAR(setUnitPos), {
|
|
|
|
params ["_unit", "_mode"];
|
|
|
|
_unit setUnitPos _mode;
|
|
|
|
}] call CBA_fnc_addEventHandler;
|
|
|
|
|
|
|
|
[QGVAR(setSpeedMode), {
|
|
|
|
params ["_unit", "_mode"];
|
|
|
|
_unit setSpeedMode _mode;
|
|
|
|
}] call CBA_fnc_addEventHandler;
|
|
|
|
|
|
|
|
[QGVAR(setCombatMode), {
|
|
|
|
params ["_unit", "_mode"];
|
|
|
|
_unit setCombatMode _mode;
|
|
|
|
}] call CBA_fnc_addEventHandler;
|
|
|
|
|
|
|
|
[QGVAR(allowFleeing), {
|
|
|
|
params ["_unit", "_cowardice"];
|
|
|
|
_unit allowFleeing _cowardice;
|
|
|
|
}] call CBA_fnc_addEventHandler;
|
|
|
|
|
2018-04-19 19:01:26 +00:00
|
|
|
[QGVAR(enableGunLights), {
|
|
|
|
params ["_unit", "_mode"];
|
|
|
|
_unit enableGunLights _mode;
|
|
|
|
}] call CBA_fnc_addEventHandler;
|
2023-09-05 14:20:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
if (isServer) then {
|
|
|
|
["CAManBase", "init", {
|
|
|
|
// wait for HMD to be assigned so `hmd _unit` works
|
2024-03-28 18:57:23 +00:00
|
|
|
[LINKFUNC(assignNVG), _this, 1] call CBA_fnc_waitAndExecute;
|
2023-09-05 14:20:06 +00:00
|
|
|
}] call CBA_fnc_addClassEventHandler;
|
|
|
|
};
|