DMS_Exile/@ExileServer/addons/a3_dms/scripts/fn_FreezeToggle.sqf
2016-05-22 15:15:38 -05:00

34 lines
785 B
Plaintext

/*
DMS_fnc_FreezeToggle
created by eraser1
Usage:
[
_group, // GROUP: The AI Group to be frozen
_freeze // BOOL: "true" if you want to freeze, false if you want to un-freeze
] call DMS_fnc_FreezeToggle;
Freezes/un-freezes a specified group.
*/
if !(params
[
"_group",
"_freeze"
]) exitWith
{
diag_log format["DMS ERROR :: Calling DMS_fnc_FreezeToggle with invalid parameters: %1",_this];
};
if (_freeze) then
{
{_x enableSimulationGlobal false} forEach (units _group);
_group setVariable ["DMS_isGroupFrozen",true];
DMS_FrozenAIGroups pushBack _group;
}
else
{
{_x enableSimulationGlobal true} forEach (units _group);
_group setVariable ["DMS_isGroupFrozen",false];
};