Count Alive - Theseus-Aegis/MissionTemplate GitHub Wiki
This page will explain the usage of the Count Alive function.
/*
* Author: Mike
* Returns count of alive units in given groups.
*
* Arguments:
* 0: Groups <ARRAY>
*
* Return Value:
* Count of alive units <NUMBER>
*
* Example:
* [[My_Group_One, My_Group_Two]] call MFUNC(countAlive);
*
*/
This function will return the count of alive units in the array of groups provided.
This function does return a value, save it as a private variable and check it that way. (Example 2)
Only call on the server.
Example 1:
private _myCount = [[My_Group_One, My_Group_Two]] call MFUNC(countAlive);
Example 2: (Checking code)
if (_myCount < 20) then {};