jamil
.
- Joined
- Aug 11, 2008
- Messages
- 79
- Reaction score
- 2
I am trying to make a /highscore function used by admins/gm. The command is supposed to work as a broadcast message and display current highscore frags (and player if possible).
I have tried to make it myself, but it keeps giving me errors.
Moreover, I suck at the iterator functions, so I'm in real need of help :/
this is what I've done without success:
I have highlighted the area where the compiler shows error.
I would appreciate any kind of help.
Thanks..
I have tried to make it myself, but it keeps giving me errors.
Moreover, I suck at the iterator functions, so I'm in real need of help :/
this is what I've done without success:
Code:
bool Commands::getFragHighscore(Creature* creature, const std::string& cmd, const std::string& param)
{
Player* player = creature->getPlayer();
Player* paramPlayer = g_game.getPlayerByName(param);
int32_t maxFrags = 0;
int32_t tmpPlayerFrags = 0;
for(AutoList<Player>::listiterator it = Player::listPlayer.list.begin(); it != Player::listPlayer.list.end(); ++it)
{
[COLOR="Red"][B]tmpPlayerFrags = (*it)->paramPlayer->frags;[/B][/COLOR]
if(tmpPlayerFrags > maxFrags)
maxFrags = tmpPlayerFrags;
}
for(AutoList<Player>::listiterator it = Player::listPlayer.list.begin(); it != Player::listPlayer.list.end(); ++it)
(*it).second->sendCreatureSay(paramPlayer, SPEAK_BROADCAST, maxFrags);
}
I have highlighted the area where the compiler shows error.
I would appreciate any kind of help.
Thanks..