20.10.2012, 22:57
pawn Код:
public OnPlayerUpdate(playerid)
{
new
playerScores[MAXPLAYERSJFS][rankingEnum],
index
;
for(new i; i != MAXPLAYERSJFS; ++i)
{
if(IsPlayerConnected(i) && !IsPlayerNPC(i))
{
playerScores[index][player_Score] = GetPlayerScore(i);
playerScores[index++][player_ID] = i;
}
}
GetPlayerHighestScores(playerScores, 0, index);
new
score_Text[256] = "~n~",
player_Name[MAX_PLAYER_NAME]
;
for(new i; i < 5; ++i)
{
if(i < index)
{
GetPlayerName(playerScores[i][player_ID], player_Name, sizeof(player_Name));
format(score_Text, sizeof(score_Text), "%s~n~~y~%d. ~w~%s - ~r~%d", score_Text, i + 1, player_Name, playerScores[i][player_Score]);
}
else
format(score_Text, sizeof(score_Text), "%s~n~~y~%d. ~r~N/A", score_Text, i + 1);
}
TextDrawSetString(text_Top5[1], score_Text);
return true;
}
pawn Код:
1. Player - 300
2. Player - 23 // O Nome do Player que estб em primeiro estб repetindo aqui, mais o Score pega normal.
3. OutroPlayer - 3