Author |
Message |
Doggeti Server Help Squatter
Age:39 Gender: Joined: Jan 12 2003 Posts: 297 Location: Germany Offline
|
Posted: Wed Feb 05, 2003 7:04 am Post subject: Playercount of the teams |
|
|
|
|
How can I figure out how many players are in the teams in MervBot Is there an array like 'playersInTeam[x]' or is there a possibility to use this playerlist _________________ Expect the worst but hope for the best. |
|
Back to top |
|
|
SOS (Skool) Guest
Offline
|
Posted: Wed Feb 05, 2003 8:32 am Post subject: |
|
|
|
|
Uint16 teamplayers [MAX_TEAMS]; // Assuming MAX_TEAMS is the max number of teams you wanna check
_listnode<Player> *p = playerlist->head;
while (p)
{
if (p->team < MAX_TEAMS)
teamplayers[p->team]++;
p = p->next;
} |
|
Back to top |
|
|
Doggeti Server Help Squatter
Age:39 Gender: Joined: Jan 12 2003 Posts: 297 Location: Germany Offline
|
|
Back to top |
|
|
VampZ Guest
Offline
|
Posted: Wed Feb 05, 2003 10:19 pm Post subject: |
|
|
|
|
try initializing:
teamplayers[0] = 0;
teamplayers[1] = 0;
before you use them. |
|
Back to top |
|
|
Doggeti Server Help Squatter
Age:39 Gender: Joined: Jan 12 2003 Posts: 297 Location: Germany Offline
|
Posted: Fri Feb 07, 2003 9:35 am Post subject: |
|
|
|
|
Thank you. That was the solution. I first learned VB (I know, I know: It's not good starting with VB and then changing to C )and there it's not necessary to initialize the variables to get the programs work properly. |
|
Back to top |
|
|
|