Arma 3 Scripting

countEnemy

  • Global argument
  • Arma 3 v0.50
  • First in Operation Flashpoint v1.00

Command · also in Object Detection · Markdown · JSON · original wiki page

Description

Count how many units in the array are considered enemy to the given unit.

Syntax

unit countEnemy others

Parameters:

Returns: Number

Examples

Example 1

_num = player countEnemy list _triggerOne;

See also

countFriendly · count · countUnknown · countSide · countType

Community notes

Hardrock

Notes from before the conversion:

The countEnemy command seem to count the number of units from the array that are considered to be of the given type by the whole side, not just the specified unit.

Kronzky

The unit that's checking (left side of the command) needs a certain level of knowledge about the target (about .1) before the enemy units are actually counted. (OFP & ArmA)