If team is full --> Switch team
#12

Try this script:

Код:
public OnPlayerRequestSpawn(playerid)
{
	new count1,count2;
	for(new i = 0; i < GetMaxPlayers(); i++)
  {
    if(PlayerTeam[i] == ZombieTeam)
		{
			count1 ++;
		}
    else if (PlayerTeam[i] == HumanTeam)
		{
			count2 ++; // Same for here, just the other team
		}
  			if(count1 > count2)
  		{
				GameTextForPlayer(playerid,"~r~This team is full! Please select another.",3000,3);
				ForceClassSelection(playerid);
			}
			else if(count2 > count1)
			{
	  		GameTextForPlayer(playerid,"~r~This team is full! Please select another.",3000,3);
				ForceClassSelection(playerid);
			}
		}
	}
 	return 1;
}
Might be some lose brackets, i made it here.
Reply


Messages In This Thread
If team is full --> Switch team - by rbN. - 05.05.2010, 17:38
Re: If team is full --> Switch team - by Naxix - 05.05.2010, 17:58
Re: If team is full --> Switch team - by rbN. - 05.05.2010, 18:10
Re: If team is full --> Switch team - by Naxix - 05.05.2010, 18:11
Re: If team is full --> Switch team - by rbN. - 05.05.2010, 18:15
Re: If team is full --> Switch team - by Naxix - 05.05.2010, 18:16
Re: If team is full --> Switch team - by rbN. - 05.05.2010, 18:17
Re: If team is full --> Switch team - by Naxix - 05.05.2010, 18:18
Re: If team is full --> Switch team - by rbN. - 05.05.2010, 18:19
Re: If team is full --> Switch team - by Naxix - 05.05.2010, 18:23
Re: If team is full --> Switch team - by rbN. - 05.05.2010, 18:25
Re: If team is full --> Switch team - by Naxix - 05.05.2010, 18:29
Re: If team is full --> Switch team - by rbN. - 05.05.2010, 18:40
Re: If team is full --> Switch team - by Naxix - 05.05.2010, 18:43
Re: If team is full --> Switch team - by rbN. - 05.05.2010, 18:48
Re: If team is full --> Switch team - by Naxix - 05.05.2010, 18:49
Re: If team is full --> Switch team - by rbN. - 05.05.2010, 19:06
Re: If team is full --> Switch team - by Naxix - 05.05.2010, 19:20
Re: If team is full --> Switch team - by rbN. - 05.05.2010, 19:42

Forum Jump:


Users browsing this thread: 4 Guest(s)