All == TEAM_HUMAN
#3

pawn Код:
new NonZombieCount;
#define MIN_NONZOMBIES 3
foreach( Player, i )
{
    if( PlayerTeam[i] != ZOMBIE_TEAM ) NonZombieCount++;
    if( NonZombieCount >= MIN_NONZOMBIES ) break;
}
if( NonZombieCount >= MIN_NONZOMBIES )
{
    new PlayersAssigned, pID;
    do{
        pID = Iter_Random(Player);
        if( PlayerTeam[pID] == ZOMBIE_TEAM )
        {
            PlayerTeam[pID] = HUMAN_TEAM;
            PlayersAssigned++;
        }
    }
    while( PlayersAssigned >= MIN_NONZOMBIES );
}
#undef MIN_NONZOMBIES
Something like that.

EDIT: Sorry, just woke. Gimme a sec.
EDIT2:
pawn Код:
new NonZombieCount;
foreach( Player, i )
{
    if( PlayerTeam[i] != ZOMBIE_TEAM ) NonZombieCount++;
}
if( !NonZombieCount )
{
    new PlayersAssigned, pID;
    do{
        pID = Iter_Random(Player);
        if( PlayerTeam[pID] == ZOMBIE_TEAM )
        {
            PlayerTeam[pID] = HUMAN_TEAM;
            PlayersAssigned++;
        }
    }
    while( PlayersAssigned >= MIN_NONZOMBIES );
}
Reply


Messages In This Thread
All == TEAM_HUMAN - by Kitten - 20.11.2010, 07:03
Re: All == TEAM_HUMAN - by Lorenc_ - 20.11.2010, 09:26
Re: All == TEAM_HUMAN - by TheXIII - 20.11.2010, 09:27
Re: All == TEAM_HUMAN - by Hiddos - 20.11.2010, 09:29
AW: All == TEAM_HUMAN - by Saitecx - 20.11.2010, 09:33
Re: All == TEAM_HUMAN - by TheXIII - 20.11.2010, 09:35

Forum Jump:


Users browsing this thread: 1 Guest(s)