Server Help

Bot Questions - Amount per freq

Anonymous - Thu Apr 10, 2003 4:52 pm
Post subject: Amount per freq
Hey
How can I make mervbot determine how many warbirds or terriers there are per freq?

ex: if there are 2 warbirds and you try joining as a warbird, it will setfreq you to another freq, etc
rahXephon - Thu Apr 10, 2003 7:41 pm
Post subject:
This keeps the teams even:
Freqsize
Anonymous - Thu Apr 10, 2003 8:27 pm
Post subject: thanks
Thanks, I need this too, but what I really need the source code that can determine the amount of warbirds (or terriers) per freq

Thanks a lot
Red_opium
rahXephon - Thu Apr 10, 2003 9:13 pm
Post subject:
just go to the site i gave you...its all there
Anonymous - Fri Apr 11, 2003 10:49 am
Post subject:
Code: Show/Hide
_listnode <Player> *parse = playerlist->head;
short wbCount = 0;
short terrCount = 0;

while (parse)
{
     if (parse->item->ship == SHIP_Warbird)
     {   
         wbCount++;
     }
     else if (parse->item->ship == SHIP_Terrier)
     {
         terrCount++;
     }

      parse = parse->next;
      if (parse == playerlist->head) break;
}


wbCount and terrCount now contain the number of warbird and terriers in the arena.
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group