[FilterScript] Ranking por Mortes
#8

Cara o comando ta bagunзado e.e se liga nele como vocк coloco :
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;
}
Agora ele indentado :
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;
}
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
Reply


Messages In This Thread
Ranking por Mortes - by Baiano - 23.12.2012, 17:44
Re: Ranking por Mortes - by mau.tito - 23.12.2012, 17:47
Re: Ranking por Mortes - by Schocc - 23.12.2012, 17:51
Re: Ranking por Mortes - by Baiano - 23.12.2012, 17:54
Re: Ranking por Mortes - by Sky™ - 23.12.2012, 17:58
Re: Ranking por Mortes - by Baiano - 23.12.2012, 17:59
Re: Ranking por Mortes - by Kuddy - 23.12.2012, 18:04
Re: Ranking por Mortes - by Diogo123 - 23.12.2012, 18:11
Re: Ranking por Mortes - by Don_Speed - 23.12.2012, 18:13
Re: Ranking por Mortes - by Etton - 23.12.2012, 18:18

Forum Jump:


Users browsing this thread: 1 Guest(s)