Get Player With The Most Kills?
#1

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.
Reply
#2

Loop the players, get their kills and check if the current amount is higher than the previous one.
Reply
#3

Any example please?
Reply
#4

pawn Code:
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;
}
Reply
#5

What should i add to remove the last one? And where i write than a message like "Player Blabla has the most highest kills in this round"?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)