Automatic Spawn as Zombie
#1

How can i make that, when Team Human is full and Player choose nevertheless Human, that he spawn automatic as Zombie? He are the Code:

Quote:

case TEAM_ARMY:
{
if(zt < ct)
{
NoSuccess(playerid,"This Team is full. Please choose another Team.");
return 0;
}
else

Reply
#2

I dont know what you mean, which code under which public?
Reply
#3

under OnPlayerRequestSpawn

Код:
public OnPlayerRequestSpawn(playerid)
{
	new zt, ct;
	for(new i=0;i<MAX_PLAYERS;i++)
	{
	    if(i != playerid)
	    {
	        if(IsPlayerConnected(i))
	        {
	            switch(gTeam[i])
	            {
	                case TEAM_ARMY: ct ++;
	                case TEAM_ZOMBIE: zt++;
				}
	        }
		}
	}
	switch(GetPVarInt(playerid,"TEAM"))
	{
	    case TEAM_ARMY:
	    {
	        if(zt < ct)
			{
				NoSuccess(playerid,"This Team is full. Please choose another Team.");
                	return 0;
			}
			else
			{
			    TextDrawHideForPlayer(playerid,streifen1);
				TextDrawHideForPlayer(playerid,streifen2);
				ClearAnimations(playerid);
				gTeam[playerid] = GetPVarInt(playerid,"TEAM");
			}
	    }
	    case TEAM_ZOMBIE:
	    {
	        if(zt > ct)
			{
				NoSuccess(playerid,"This Team is full. Please choose another Team.");
				return 0;
			}
			else
			{
			    TextDrawHideForPlayer(playerid,streifen1);
				TextDrawHideForPlayer(playerid,streifen2);
				ClearAnimations(playerid);
				gTeam[playerid] = GetPVarInt(playerid,"TEAM");
			}
	    }
	}
	return 1;
}
Reply
#4

Work, thx for Help i give you +1 Rep.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)