04.03.2014, 12:20
Hello, how can i get the player with the most kills after the end of a round (i have a round-map-system)? I know something with a timer, but can you give me a example please.
forward High();
public High()
{
static last; //it's static because it's like a global variable
new highestid = INVALID_PLAYER_ID, highest = -1;
for(new i = 0; i < MAX_PLAYERS; ++i)
{
if(GetPlayerScore(i) > highest)
{
highestid = i;
highest = GetPlayerScore(i);
}
}
if(highestid != INVALID_PLAYER_ID)
{
if(last != highestid)
{
//do something to remove the last one with highest score from the team
}
team[highestid] = 3;
}
last = highestid;
}