{"name":"countFriendly","title":"countFriendly","type":"command","url":"https://community.bistudio.com/wiki/countFriendly","revid":379406,"updated":"2026-10-31T00:02:17Z","groups":["Sides"],"status":"ok","games":{"ofp":"1.00","ofpe":"1.00","arma1":"1.00","arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"ofp 1.00","arma3_since":"0.50","locality":{"argument":"global"},"description":"Count how many units in the array are considered friendly to the given unit.","syntaxes":[{"syntax":"unit countFriendly others","params":[{"name":"unit","type":"Object","type_expr":"Object"},{"name":"others","type":"Array of Objects","type_expr":"Array<Object>"}],"returns":{"type":"Number","type_expr":"Number"},"form":"binary","left":{"text":"unit"},"right":{"text":"others"}}],"examples":[{"code":["_num = player countFriendly list _triggerOne;"]}],"see_also":["count","countEnemy","countUnknown","countSide","countType"],"notes":[{"user":"Hardrock","date":"2006-08-03T14:28:00Z","text":"*Notes from before the conversion:*\n\nThe 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."}]}