[Ajuda] Rank
#1

Bom, estou tentando fazer um sistema de /rank para mostrar os players com melhor mйdia de Kill e Morte, jб refiz vбrias vezes e nгo consigo fazer ficar em ordem crescente, ficando o segundo colocado com melhor mйdia que o primeiro. Meu cуdigo й o seguinte:

pawn Код:
YCMD:rank(playerid, params[], help)
{
    new string[126], string2[126];
    new pName[MAX_PLAYER_NAME];
    new First, Second, Third;
    new Float:Razao[MAX_PLAYERS];
    getcolocado[0] = 0;
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        Razao[i] = floatdiv(PlayerInfo[i][pKills], PlayerInfo[i][pDeaths]);
        printf("Razao Player: %f", Razao[i]);
    }
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(Razao[i] > getcolocado[0])
        {
            getcolocado[0] = Razao[i];
            First = i;
            printf("Primeiro Colocado: %d", First);
        }
        if(Razao[i] > getcolocado[1] && Razao[i] < getcolocado[0])
        {
            getcolocado[1] = Razao[i];
            Second = i;
            printf("Segundo Colocado: %d", Second);
        }
    }
    format(string,sizeof(string), "1є Razгo: %1.2f", Razao[First]);
    format(string2,sizeof(string2), "2є Razгo: %1.2f", Razao[Second]);
    print(string);
    print(string2);
    SCM(playerid, -1, string);
    SCM(playerid, -1, string2);
    return 1;
}
Bom, nгo precisa corrigir o cуdigo, dando uma base do que tenho que usar jб fico feliz.

Grato!
Reply
#2

https://sampforum.blast.hk/showthread.php?tid=205314

https://sampforum.blast.hk/showthread.php?tid=191605

https://sampforum.blast.hk/showthread.php?tid=401480

usando o search encontra
Reply
#3

Ele estб pegando a razгo de todo mundo certinho, o ъnico problema й sу na hora de colocar em ordem crescente.

Bom, ainda estou tentando...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)