Created
June 2, 2018 20:41
-
-
Save Starfox64/cdc85af8d032d70584b2a56b0f2b104c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BIS_hideUnits = { | |
private ["_units", "_mode"]; | |
_units = [_this, 0, objNull, [objNull, []]] call BIS_fnc_param; | |
_mode = [_this, 1, 0, [0]] call BIS_fnc_param; // 0 - hide (default), 1 - unhide | |
if (_mode == 0) then { | |
// Hide | |
{ | |
{ | |
private ["_unit"]; | |
_unit = _x; | |
_unit hideObjectGlobal true; | |
_unit enableSimulationGlobal false; | |
_unit allowDamage false; | |
//_unit setCaptive true; | |
{_unit disableAI _x} forEach ["ANIM", "AUTOTARGET", "FSM", "MOVE", "TARGET"]; | |
} forEach ([vehicle _x, commander _x, gunner _x, driver _x, _x] + crew _x); | |
} forEach _units; | |
} else { | |
// Unhide | |
{ | |
{ | |
private ["_unit"]; | |
_unit = _x; | |
_unit hideObjectGlobal false; | |
_unit enableSimulationGlobal true; | |
_unit allowDamage true; | |
//_unit setCaptive false; | |
{_unit enableAI _x} forEach ["ANIM", "AUTOTARGET", "FSM", "MOVE", "TARGET"]; | |
} forEach ([vehicle _x, commander _x, gunner _x, driver _x, _x] + crew _x); | |
} forEach _units; | |
}; | |
true | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment