[Ajuda] Balance
#4

pawn Code:
stock BalanceEx(Team1, Team2, const Players = MAX_PLAYERS){

    static
        Interador,
        Bloco[2],
        MaxP
    ;
   
    for(Interador = 0, MaxP = Players;  Interador != MaxP; ++Interador){
        if(IsPlayerConnected(Interador)){
            Bloco[0] ++;
        }
    }
   
    MaxP = Bloco[0] + 1;

   
    if(MaxP % 2){
        Bloco[0] = (MaxP / 2);
    }else{
        Bloco[0] = (MaxP - 1) / 2;
    }

    Bloco[1] = (MaxP - Bloco[0]);
   


    for(Interador = 0; Interador != (MaxP - 1); ++Interador)
    {
        Times[Interador] = (Interador <= Bloco[0] ? Team1 : Team2);
    }
   
    return true;
 }
Reply


Messages In This Thread
Balance - by Mteck - 26.01.2013, 19:01
Re: Balance - by zSuYaNw - 26.01.2013, 19:53
Re: Balance - by Dwayne-Pheonix - 26.01.2013, 19:53
Re: Balance - by zSuYaNw - 26.01.2013, 21:02
Re: Balance - by JonathanFeitosa - 26.01.2013, 21:09
Re: Balance - by Mteck - 26.01.2013, 21:11

Forum Jump:


Users browsing this thread: 1 Guest(s)