chrisyou 10 Posted April 20, 2014 Heya guys. Ive got 19 units placed in my mp mission. I wanna count how many of them are used.. I am not exactly new to scripting but this bothered me for quite some time.. west countSide allUnits returns 19. west countSide playableUnits returns 18. How do I count how many of them are ACTUALLY played? Thanks a lot guys.. If you need me to explain my situation a little further, go ahead and ask. :) Best Regards chrisyou Share this post Link to post Share on other sites
roguetrooper 2 Posted April 20, 2014 (edited) _players = 0; _unitlist = [] + allUnits + allDead; {if (isplayer _x) then {_players = _players +1}} forEach _unitlist; hintsilent format ["There are currently %1 human players.", _players]; Not sure whether the allDead-stuff works... Edited April 20, 2014 by RogueTrooper Share this post Link to post Share on other sites
chrisyou 10 Posted April 20, 2014 Thank you RogueTrooper. I already found my own solution. Stupid post by me :( Here is it for anyone wondering. _count = 0; { if((isPLayer _x) && (side _x == west)) then { _count = _count + 1 }; } forEach playableUnits; hint format["%1 west units",_count]; Share this post Link to post Share on other sites
Larrow 2822 Posted April 20, 2014 You could just use COUNT instead of countSide or foreach with a counter. hint format["%1 west players", {isPlayer _x && side _x == west}count playableUnits]; Share this post Link to post Share on other sites