2018-09-17 19:19:29 +00:00
|
|
|
#include "script_component.hpp"
|
2017-10-10 16:06:37 +00:00
|
|
|
/*
|
|
|
|
* Author: alganthe
|
|
|
|
* Un-garrison a garrisoned group.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Module logic <OBJECT>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
2020-04-25 06:41:45 +00:00
|
|
|
* [LOGIC] call ace_zeus_fnc_moduleUnGarrison
|
2017-10-10 16:06:37 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
|
|
|
params ["_logic"];
|
|
|
|
|
|
|
|
if (!local _logic) exitWith {}; // Module is global
|
|
|
|
|
|
|
|
scopeName "Main";
|
|
|
|
private _fnc_errorAndClose = {
|
|
|
|
params ["_msg"];
|
|
|
|
deleteVehicle _logic;
|
2017-10-16 20:23:39 +00:00
|
|
|
[_msg] call FUNC(showMessage);
|
2017-10-10 16:06:37 +00:00
|
|
|
breakOut "Main";
|
|
|
|
};
|
|
|
|
|
|
|
|
private _unit = effectiveCommander (attachedTo _logic);
|
|
|
|
|
|
|
|
switch (false) do {
|
|
|
|
case !(isNull _unit): {
|
|
|
|
[LSTRING(NothingSelected)] call _fnc_errorAndClose;
|
|
|
|
};
|
|
|
|
case (_unit isKindOf "CAManBase"): {
|
|
|
|
[LSTRING(OnlyInfantry)] call _fnc_errorAndClose;
|
|
|
|
};
|
|
|
|
case (alive _unit): {
|
|
|
|
[LSTRING(OnlyAlive)] call _fnc_errorAndClose;
|
|
|
|
};
|
|
|
|
case !(isPlayer _unit): {
|
2017-10-18 04:26:08 +00:00
|
|
|
["str_a3_cfgvehicles_moduleremotecontrol_f_errorPlayer"] call _fnc_errorAndClose;
|
2017-10-10 16:06:37 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
private _units = units _unit;
|
|
|
|
|
|
|
|
[QEGVAR(ai,unGarrison), [_units], _units] call CBA_fnc_targetEvent;
|
|
|
|
|
|
|
|
deleteVehicle _logic;
|