[Ajuda]sistema de pontuaзгo
#4

Embaixo das cores (#defines)
pawn Code:
#define b_swap(%0,%1)     if(%0 > %1) (%0 ^= %1, %1 ^= %0, %0 ^= %1) //swap xor in bubblesort (by drakins)

BubbleSort( Array[], iSize) // bubblesort (by drakins)
{
    new
        iLoop       = 0x00000000,
        iCircuito   = 0x00000000;

    while(++iLoop < iSize)
    {
        iCircuito = 0xFFFFFFFF;
        while(++iCircuito != iLoop) b_swap(Array[iLoop],Array[iCircuito]);
    }
    return Array;
}






Comando:
pawn Code:
if(!strcmp(cmdtext,"/ranking", true))
{
    static string[60];
    for(new i; i < MAX_PLAYERS; ++i)
    {
        BubbleSort(matou, sizeof(matou));
    }
    new b = -1;
    for(new a; a < MAX_PLAYERS; ++a)
    {
        for(new o; o < MAX_PLAYERS; ++o)
        {
            if(matou[a] == matou[o]) ++b;
            if(b == 10) break;
            format(string, sizeof(string),"[INFO]: Ranking: %s - %d",matou,b);
            SendClientMessage(playerid, -1, string);
        }
    }
        return 1;
}


Crйditos:
[iPs]Garfield
[iPs]DraKiNs
Reply


Messages In This Thread
[Ajuda]sistema de pontuaзгo - by luckvice - 31.05.2011, 13:35
Re: [Ajuda]sistema de pontuaзгo - by Falcon. - 31.05.2011, 13:57
Re: [Ajuda]sistema de pontuaзгo - by luckvice - 31.05.2011, 18:06
Re: [Ajuda]sistema de pontuaзгo - by TheGarfield - 31.05.2011, 23:40
Re: [Ajuda]sistema de pontuaзгo - by Shadoww5 - 31.05.2011, 23:48
Re: [Ajuda]sistema de pontuaзгo - by TheGarfield - 01.06.2011, 00:02
Re: [Ajuda]sistema de pontuaзгo - by Shadoww5 - 01.06.2011, 00:11
Re: [Ajuda]sistema de pontuaзгo - by TheGarfield - 01.06.2011, 00:30

Forum Jump:


Users browsing this thread: 1 Guest(s)