Server Help

Bot Questions - How to refresh the playerlist linkedlist

Anonymous - Thu Jul 19, 2007 6:06 am
Post subject: How to refresh the playerlist linkedlist
I was trying to have a mervbot keep track of scores with the player->score struct.
But as there is also a ?buy command available i found it impossible to have the bot display the correct scores after a ?buy was issued. It keeps showing the old score and just adds any new score to it.

Lets say that i had 400 points overall and spent 100 buying a rocket.
so now i have 300 points but the bot will display 400 for player->score
If i gain 200 more points, I will have 500 points, but bot will display 600.

If the bot rejoins the arena, the scores will be just fine, as it is probably refreshing the playerlist..

My question is if there is a way to refresh the list without actually rejoining the arena...

thanks,

-the_snake
Anonymous - Wed Aug 15, 2007 3:56 am
Post subject:
I used this to display the scores.

Code: Show/Hide
   case EVENT_PlayerScore:
      {
      Player *p = (Player*)event.p[0];
      
        sendPublic("*arena Player killScore: " + (String)p->score.killPoints);
        sendPublic("*arena Player flagScore: " + (String)p->score.flagPoints);
        sendPublic("*arena Player wins: " + (String)p->score.wins);
        sendPublic("*arena Player losses: " + (String)p->score.losses);
   
      }
      break;


p->score.flagPoints is being correctly updated after a ?buy
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group