Skip to content

Count Alive

Mike-MF edited this page Jun 5, 2023 · 1 revision

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);
 *
 */

Usage

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 {};
Clone this wiki locally