countFriendly: Difference between revisions

From Bohemia Interactive Community
m (Text replacement - "<code>([^ ]*)\[\[([a-zA-Z0-9_]+)\]\]([^ ]*)<\/code>" to "<code>$1$2$3</code>")
mNo edit summary
 
(4 intermediate revisions by one other user not shown)
Line 28: Line 28:
|descr= Count how many units in the array are considered friendly to the given unit.
|descr= Count how many units in the array are considered friendly to the given unit.


|s1= unitName [[countFriendly]] arrayName
|s1= unit [[countFriendly]] others


|p1= unitName: [[Object]]
|p1= unit: [[Object]]


|p2= arrayName: [[Array]]
|p2= others: [[Array]] of [[Object]]s


|r1= [[Number]]
|r1= [[Number]]


|x1= <code>_num = player [[countFriendly]] [[list]] _triggerOne;</code>
|x1= <sqf>_num = player countFriendly list _triggerOne;</sqf>


|seealso= [[count]] [[countEnemy]] [[countUnknown]] [[countSide]] [[countType]]
|seealso= [[count]] [[countEnemy]] [[countUnknown]] [[countSide]] [[countType]]
Line 44: Line 44:


<dt><dt>
<dt><dt>
<dd class="notedate">Posted on August 3, 2006 - 14:28</dd>
<dd class="notedate">Posted on 2006-08-03 - 14:28</dd>
<dt class="note">[[User:Hardrock|hardrock]]</dt>
<dt class="note">[[User:Hardrock|hardrock]]</dt>
<dd class="note">''Notes from before the conversion:''
<dd class="note">''Notes from before the conversion:''

Latest revision as of 11:49, 1 January 2026

Hover & click on the images for description

Description

Description:
Count how many units in the array are considered friendly to the given unit.
Groups:
Sides

Syntax

Syntax:
unit countFriendly others
Parameters:
unit: Object
others: Array of Objects
Return Value:
Number

Examples

Example 1:
_num = player countFriendly list _triggerOne;

Additional Information

See also:
count countEnemy countUnknown countSide countType

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord.
Only post proven facts here! Add Note
Posted on 2006-08-03 - 14:28
hardrock
Notes from before the conversion: The countFriendly 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.