11.01.2011, 18:29
Nice, but... Why do you need an array to store each player's score? Try this one, it should be better:
pawn Код:
stock GetPlayerWithHighestScore()
{
new MaxHighestScore, Player, TempScore;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i)) continue;
if(IsPlayerNPC(i)) continue;
TempScore = GetPlayerScore(i);
if(TempScore > MaxHighestScore)
{
MaxHighestScore = TempScore;
Player = i;
}
}
return Player;
}