[PROBLEM] Balancer
#1

Now i got that balancer but ill go to play alone:

I cannot spawn when I press shift or spawn.

This is my balancer:

Код:
public OnPlayerRequestSpawn(playerid)
{
	new Count1, Count2;
  for(new p = 0; p < GetMaxPlayers(); p++)
	{
	  if (GetPlayerTeam(p) == TEAM_GREEN)
	  {
	    Count1++;
	  }
  	else if (GetPlayerTeam(p) == TEAM_BLUE)
  	{
    	Count2++;
  	}
	}
	if ((Count1 > Count2) && GetPlayerTeam(playerid) == TEAM_GREEN)
	  return !SendClientMessage(playerid,red, "[BALANCER] Balancing teams. Choose Another Team");
	else if ((Count2 > Count1) && GetPlayerTeam(playerid) == TEAM_BLUE)
	  return !SendClientMessage(playerid,red, "[BALANCER] Balancing teams. Choose Another Team");
	return 0;
}
So if you found the problem and you can help me then im happy
Reply
#2

Код:
public OnPlayerRequestSpawn(playerid)
{
  new Count1, Count2;
  for(new p = 0; p < GetMaxPlayers(); p++)
  {
    if (GetPlayerTeam(p) == TEAM_GREEN) Count1++;
    else if (GetPlayerTeam(p) == TEAM_BLUE) Count2++;
  }
  if ((Count1 > Count2) && GetPlayerTeam(playerid) == TEAM_GREEN)
  {
    SendClientMessage(playerid,red, "[BALANCER] Balancing teams. Choose Another Team");
    return 0;
  }
  else if ((Count2 > Count1) && GetPlayerTeam(playerid) == TEAM_BLUE)
  {
    SendClientMessage(playerid,red, "[BALANCER] Balancing teams. Choose Another Team");
    return 0;
  }
  return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)