{"name":"countType","operator":null,"title":"countType","type":"command","url":"https://community.bistudio.com/wiki/countType","revid":377068,"updated":"2026-01-01T09:25:18Z","groups":["Object Detection"],"status":"ok","replaced_by":[],"games":[{"game":"ofp","name":"Operation Flashpoint","version":"1.00"},{"game":"ofpe","name":"Operation Flashpoint: Elite","version":"1.00"},{"game":"arma1","name":"Armed Assault","version":"1.00"},{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"ofp","name":"Operation Flashpoint","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":"global","effect":null,"server_exec":false},"exec":null,"description":"Count how many objects in the array are of given type. This command also works with parent classes like \"Air\", \"Tank\", and \"Car\". For a full class reference see Classes.","syntaxes":[{"syntax":"type countType objects","since":null,"effect":null,"exec":null,"params":[{"name":"type","type":"String","optional":false,"default":null,"description":"class type","types":["String"],"since":null,"text":"type: String - class type"},{"name":"objects","type":"Array of Objects","optional":false,"default":null,"description":null,"types":["Array","Object"],"since":null,"text":"objects: Array of Objects"}],"returns":{"type":"Number","types":["Number"],"description":null,"text":"Number"},"form":"binary","operator":null,"left":{"text":"type","types":["String"]},"right":{"text":"objects","types":["Array","Object"]}}],"examples":[{"text":"```sqf\n_count = \"Tank\" countType list _triggerOne;\n```","code":["_count = \"Tank\" countType list _triggerOne;"]},{"text":"```sqf\n_count = \"B_medic_F\" countType units player;\n```","code":["_count = \"B_medic_F\" countType units player;"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["count","isKindOf","typeOf","countFriendly","countEnemy","countSide","countUnknown"],"notes":[],"categories":["ArmA: Armed Assault: Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Object Detection","Introduced with Operation Flashpoint version 1.00","Operation Flashpoint: Elite: Scripting Commands","Operation Flashpoint: New Scripting Commands","Operation Flashpoint: Scripting Commands","Scripting Commands","Take On Helicopters: Scripting Commands"]}