Code: Show/Hide int i=0;
_listnode <Player> *parse = playerlist->head; while (parse) { Player *p = parse->item; if (p->ship != SHIP_Spectator) ++i; parse = parse->next; } if (i == 2) countdown[1] = 5; |
Code: Show/Hide class botInfo
{ int SpecPop; void CountSpec(); } |
Code: Show/Hide void botInfo::CountSpec()
{ SpecPop=0; _listnode <Player> * parse = playerlist->head; Player *p = parse->item; while (parse) { if (p->ship == SHIP_Spectate) //Or, if you want to count the FREQ not SHIP //if(p->team == /*spec freq*/) //put em together to ignore staff like me who play on the spec freq to talk. SpecPop++; parse = parse->next; } } |