Highest score!
#4

This will get the player with the highest score:
pawn Код:
new
    iHighest;

for(new i = 0; i < MAX_PLAYERS; i++)
{
    if(IsPlayerConnected(i))
    {
        if(GetPlayerScore(i) > GetPlayerScore(iHighest)) iHighest = i;
    }
}

// The variable: "iHighest" now contains the player id holding the highest score.
Reply


Messages In This Thread
Highest score! - by Zhoom - 03.03.2012, 04:55
Re: Highest score! - by DarkScripter - 03.03.2012, 05:13
Re: Highest score! - by Finn - 03.03.2012, 05:31
Re: Highest score! - by -Prodigy- - 03.03.2012, 05:31
Re: Highest score! - by Zhoom - 03.03.2012, 05:32
Re: Highest score! - by DarkScripter - 03.03.2012, 05:36
Re: Highest score! - by Zhoom - 03.03.2012, 05:57
Re: Highest score! - by Finn - 03.03.2012, 06:02
Re: Highest score! - by DarkScripter - 03.03.2012, 06:31

Forum Jump:


Users browsing this thread: 1 Guest(s)