23.12.2012, 18:11
Cara o comando ta bagunзado e.e se liga nele como vocк coloco :
Agora ele indentado :
Nгo me leve a mal mas o cуdigo assim fica mais bonito ^^ Mesmo assim a intenзгo foi boa pois existe poucos fs de rank de score
pawn Код:
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;
}
pawn Код:
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;
}