How to create,if on server connected TWO player,one player infect.
Code:
stock Half()
{
new Humans;
switch(random(4))
{
case 0:
{
foreach(Player, i)
{
if(Humans < 1)
{
HumanSetup(i);
printf("Selected humans");
Humans ++;
}
else
{
ZombieSetup2(i);
printf("Selected zombies");
Humans = 0;
}
}
}
case 1:
{
foreach(Player, i)
{
if(Humans < 2)
{
HumanSetup(i);
printf("Selected humans");
Humans ++;
}
else
{
ZombieSetup2(i);
printf("Selected zombies");
Humans = 0;
}
}
}
case 2:
{
foreach(Player, i)
{
if(Humans < 3)
{
HumanSetup(i);
printf("Selected humans");
Humans ++;
}
else
{
ZombieSetup2(i);
printf("Selected zombies");
Humans = 0;
}
}
}
case 3:
{
foreach(Player, i)
{
if(Humans < 4)
{
HumanSetup(i);
printf("Selected humans");
Humans ++;
}
else
{
ZombieSetup2(i);
printf("Selected zombies");
Humans = 0;
}
}
}
}
printf("Finished Selecting teams");
return 1;
}
stock EvenTeams(playerid)
{
new Humans, Zombies, rand = switch(random(25));
switch(random(25))
{
case 0:
{
switch(random(4))
{
case 0:
{
foreach(Player, i)
{
ZombieSetup2(i);
Zombies ++;
}
}
case 1:
{
foreach(Player, i)
{
HumanSetup2(i);
Humans ++;
}
}
case 2:
{
foreach(Player, i)
{
ZombieSetup2(i);
Zombies ++;
}
}
case 3:
{
foreach(Player, i)
{
HumanSetup2(i);
Humans ++;
}
}
}
}
case 1:
{
switch(random(4))
{
case 0:
{
foreach(Player, i)
{
ZombieSetup2(i);
Zombies ++;
}
}
case 1:
{
foreach(Player, i)
{
HumanSetup2(i);
Humans ++;
}
}
case 2:
{
foreach(Player, i)
{
ZombieSetup2(i);
Zombies ++;
}
}
case 3:
{
foreach(Player, i)
{
HumanSetup2(i);
Humans ++;
}
}
}
}
case 2:
{
switch(random(4))
{
case 0:
{
foreach(Player, i)
{
ZombieSetup2(i);
Zombies ++;
}
}
case 1:
{
foreach(Player, i)
{
HumanSetup2(i);
Humans ++;
}
}
case 2:
{
foreach(Player, i)
{
ZombieSetup2(i);
Zombies ++;
}
}
case 3:
{
foreach(Player, i)
{
HumanSetup2(i);
Humans ++;
}
}
}
}
case 3:
{
switch(random(4))
{
case 0:
{
foreach(Player, i)
{
ZombieSetup2(i);
Zombies ++;
}
}
case 1:
{
foreach(Player, i)
{
HumanSetup2(i);
Humans ++;
}
}
case 2:
{
foreach(Player, i)
{
ZombieSetup2(i);
Zombies ++;
}
}
case 3:
{
foreach(Player, i)
{
ZombieSetup2(i);
Zombies ++;
}
}
}
}
case 4:
{
switch(random(4))
{
case 0:
{
foreach(Player, i)
{
ZombieSetup2(i);
Zombies ++;
}
}
case 1:
{
foreach(Player, i)
{
ZombieSetup2(i);
Zombies ++;
}
}
case 2:
{
foreach(Player, i)
{
ZombieSetup2(i);
Zombies ++;
}
}
case 3:
{
foreach(Player, i)
{
HumanSetup2(i);
Humans ++;
}
}
}
}
case 6:
{
switch(random(4))
{
case 0:
{
foreach(Player, i)
{
ZombieSetup2(i);
Zombies ++;
}
}
case 1:
{
foreach(Player, i)
{
HumanSetup2(i);
Humans ++;
}
}
case 2:
{
foreach(Player, i)
{
ZombieSetup2(i);
Zombies ++;
}
}
case 3:
{
foreach(Player, i)
{
ZombieSetup2(i);
Zombies ++;
}
}
}
}
case 7..9:
{
switch(random(4))
{
case 0:
{
foreach(Player, i)
{
ZombieSetup2(i);
Zombies ++;
}
}
case 1:
{
foreach(Player, i)
{
HumanSetup2(i);
Humans ++;
}
}
case 2:
{
foreach(Player, i)
{
ZombieSetup2(i);
Zombies ++;
}
}
case 3:
{
foreach(Player, i)
{
HumanSetup2(i);
Humans ++;
}
}
}
}
case 9..11:
{
switch(random(4))
{
case 0:
{
foreach(Player, i)
{
ZombieSetup2(i);
Zombies ++;
}
}
case 1:
{
foreach(Player, i)
{
HumanSetup2(i);
Humans ++;
}
}
case 2:
{
foreach(Player, i)
{
ZombieSetup2(i);
Zombies ++;
}
}
case 3:
{
foreach(Player, i)
{
HumanSetup2(i);
Humans ++;
}
}
}
}
case 11..16:
{
switch(random(4))
{
case 0:
{
foreach(Player, i)
{
ZombieSetup2(i);
Zombies ++;
}
}
case 1:
{
foreach(Player, i)
{
HumanSetup2(i);
Humans ++;
}
}
case 2:
{
foreach(Player, i)
{
ZombieSetup2(i);
Zombies ++;
}
}
case 3:
{
foreach(Player, i)
{
HumanSetup2(i);
Humans ++;
}
}
}
}
case 16..20:
{
switch(random(4))
{
case 0:
{
foreach(Player, i)
{
ZombieSetup2(i);
Zombies ++;
}
}
case 1:
{
foreach(Player, i)
{
HumanSetup2(i);
Humans ++;
}
}
case 2:
{
foreach(Player, i)
{
ZombieSetup2(i);
Zombies ++;
}
}
case 3:
{
foreach(Player, i)
{
HumanSetup2(i);
Humans ++;
}
}
}
}
case 20..25:
{
switch(random(4))
{
case 0:
{
foreach(Player, i)
{
ZombieSetup2(i);
Zombies ++;
}
}
case 1:
{
foreach(Player, i)
{
HumanSetup2(i);
Humans ++;
}
}
case 2:
{
foreach(Player, i)
{
ZombieSetup2(i);
Zombies ++;
}
}
case 3:
{
foreach(Player, i)
{
HumanSetup2(i);
Humans ++;
}
}
}
}
}
return 1;
}