team baance bug
#1

I am using

pawn Код:
forward ChangeTeam(playerid);
public ChangeTeam(playerid)
{
      if ((Count1 > Count2) && gTeam[playerid] == TEAM_ZOMBIE)
      {
        SendClientMessageToAll(COLOR_RED,"[BALANCER] Balancing teams");
       
        new Random = Iter_Random(Player);
        foreach(Player, i)
        {
        if(gTeam[i] == TEAM_HUMAN) Count1++;
        if(Count1 == Iter_Count(Player))
        {
             HumanSetting(Random);
        }
        }
        return 0;
      }
      else if ((Count2 > Count1) && gTeam[playerid] == TEAM_HUMAN)
      {
        SendClientMessage(playerid,COLOR_RED, "[BALANCER] Balancing teams");
       
        new Random = Iter_Random(Player);
        foreach(Player, i)
        {
        if(gTeam[i] == TEAM_ZOMBIE) Count2++;
        if(Count2 == Iter_Count(Player))
        {
             ZombieSetting(Random);
        }
        }
        return 0;
      }
      return 1;
}
Count2 = TEAM_ZOMBIE
Count1 = TEAM_HUMAN

Anyway when I use it.

it doesn't change anyones teams when the teams are odd even when the timer happens

pawn Код:
SetTimer("ChangeTeam" ,120000,true);
Thanks
Reply
#2

Replace
pawn Код:
SetTimer("ChangeTeam" ,120000,true);
With
pawn Код:
SetTimerEx("ChangeTeam" ,120000,true, "i", playerid);
Reply
#3

But the SetTimer("ChangeTeam" ,120000,true); went under public OnGameModeInit()

and the new Timer wont work under ongamemode because of the playerid?

So where should I put the new one?
Reply
#4

I'm guessing under OnPlayerConnect
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)