SA-MP Forums Archive
[Pedido] Rank - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Pedido] Rank (/showthread.php?tid=537064)



Rank - SatanMessenger - 13.09.2014

Existe como fazer rank de ping й fps dos players? tipo

Rank do melhor ping: TalNome \n2 Lugar: TalNome
Rank do melhor fps: TalNome \n2 Lugar: TalNome


Re: Rank - zSuYaNw - 13.09.2014

pawn Код:
[quote=zSuYaNw;2162516]Cara tire este seu AVATAR...

[php]

forward RankingMaisPontos(); public RankingMaisPontos(){

    // Criamos as variбveis
    new Scores[MAX_PLAYERS], log[100], nome[24];
   
   
    // Pegamos as pontuaзхes
    for(new i, e = GetMaxPlayers(); i != e; ++i){
        format(log, 100, "Contas/%s.pwn", (GetPlayerName(i, nome, 24), nome));
        Scores[i] = dini_Int(log, "Pontos");
    }
   
   
    // Classificamos
    BubbleSort(Scores, sizeof(Scores));
   
   
    // Limpamos a array "log".
    log[0] = EOS;
   
   
    // Imprimimos.
    format(log, ""Grad3"[Ranking Ping] "Creme"%s "Grad3"estб em Primeiro Lugar no Ranking de Ping com "Creme"%d", Nome(0), Scores[0]);
    SendClientMessageToAll(-1, log);
    return true;
}

static stock BubbleSort(v[], size)// Function By SuYaNw (http://pastebin.com/PQTTwzgB)
{
    #if !defined s_swap
        #define s_swap(%0,%1)  (%0 ^= %1, %1 ^= %0, %0 ^= %1) //By: SuYaNw's
    #endif
    for(new i = 1; i != size; ++i)
    {
        for(new q = 0; (q != size - i); ++q)if(v[i] > v[q]) s_swap(v[q],v[i]);
    }
}[/php][/quote]


Apenas troque por

pawn Код:
// Pegamos as pontuaзхes
    for(new i, e = GetMaxPlayers(); i != e; ++i){
        Scores[i] = GetPlayerScore(i);
    }