15.05.2015, 01:56
foreach or y_iterrate have a random feature, use it.
And i completely recommend you to create your own iterrate for team humans!
pawn Код:
Iter_Random(Player); //for players but if you have your own iter., than you can specify that instead of Player
pawn Код:
stock TeamBalance()
{
new Humans;
foreach(Player, i)
{
if(Humans < 3)
{
HumanSetup(i);
printf("Selected humans");
Humans ++;
}
else
{
new randomzombie = Iter_Random(Player);
if(GetPlayerTeam(i) == TEAM_HUMANS)
{
ZombieSetup2(randomzombie);
printf("Selected zombies");
Humans = 0;
}
else //make this timer run again or if its already dependent on "Humans=0", than ignore.
}
}
printf("Finished Selecting teams");
return 1;
}