25.10.2014, 18:08
UP, achei um a FS de ranking por mortes alguйm poderia converter ou me dar um exemplo de como eu poderia converte-lo de de Mortes para o maior Score.
http://i.imgur.com/BOVDjw2.jpg
+Rep para quem me ajudar.
http://i.imgur.com/BOVDjw2.jpg
pawn Код:
enum Ranking
{
Score, Id
}
enum pDados
{
pMatou
}
new PlayerScore[MAX_PLAYERS][Ranking];
new PlayerDados[MAX_PLAYERS][pDados];
CMD:ranking(playerid)
{
new n = 0, Rmsg[1000];
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i) && !IsPlayerNPC(i))
{
PlayerScore[n][Score] = PlayerDados[i][pMatou];
PlayerScore[n][Id] = i;
n++;
}
}
GetPlayerHighestScores(PlayerScore, 0, n);
for (new i = 10; i > 0; i--)
if (PlayerScore[i][Id] == PlayerScore[i - 1][Id]) PlayerScore[i][Id] = 999;
for (new i = 0; i < 10; i++)
{
if (PlayerScore[i][Id] == 999) format(Rmsg, sizeof(Rmsg), "{FFFF00}%s %i - Ninguйm.\n", Rmsg, i + 1);
else
{
new BaianoGTS[MAX_PLAYER_NAME];
GetPlayerName(PlayerScore[i][Id], BaianoGTS, sizeof(BaianoGTS));
format(Rmsg, sizeof(Rmsg), "{FFFF00}%s %i - %s | [Matou %i]\n", Rmsg, i + 1, BaianoGTS, PlayerScore[i][Score]);
}
}
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "{FF0000}Ranking", Rmsg, "Ok", "");
return 1;
}
stock GetPlayerHighestScores(array[][Ranking], left, right)[...]
+Rep para quem me ajudar.