Teambalancer & NextMap help.
#1

Yes, I know there are loads of topics about it but it did not worked for me.


I have two teams; TEAM_HOBO 0 and TEAM_RICH 1
Код:
static gTeam[MAX_PLAYERS];
Help please?


Another question.

If one team has for example 20 kills, the server must switch to the next map. How to do that?
Reply
#2

Bump, would be nice if I wake up tomorrow and find an answer

Reply
#3

Bump

P.S: I have read the rules
Reply
#4

I would ask on the post regarding the gteam system.
Reply
#5

Link?
Reply
#6

Код:
for(new p = 0; p < GetMaxPlayers(); p++)
{
  if (gTeam[p] == TEAM_HOBO)
  {
    count1++;
      }
  else if (gTeam[p] == TEAM_RICH)
  {
    count2++;
  }
}
	if ((count1 > count2) && gTeam[playerid] == TEAM_HOBO)
  return SendClientMessage(playerid, COLOR_RED, "You've been switched to the other team to keep the teams even!");
  else if ((count2 > count1) && gTeam[playerid] == TEAM_RICH)
  return SendClientMessage(playerid, COLOR_RED, "You've been switched to the other team to keep the teams even!");
  return 1;
}
I came so far but now they will still be able to spawn, how can I disable that and force them to the other team?

If I try it gives me errors.
Reply
#7

pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    for(new p = 0; p < GetMaxPlayers(); p++)
    {
        if(IsPlayerConnected(p))
        {
            if (gTeam[p] == TEAM_HOBO)
            {
                count1++;
            }
            else if (gTeam[p] == TEAM_RICH)
            {
                count2++;
            }
        }
    }
    if ((count1 > count2) && gTeam[playerid] == TEAM_HOBO)
    {
        SendClientMessage(playerid, COLOR_RED, "Choose another team to keep the teams even!");
        return 0;
    }
    else if ((count2 > count1) && gTeam[playerid] == TEAM_RICH)
    {
        SendClientMessage(playerid, COLOR_RED, "Choose another team to keep the teams even!");
        return 0;
    }
    return 1;
}
Reply
#8

Tried that but now it always says hobo team is full and me and my other 2 friends have to join Rich team..


Summary : Doesn't works.
Reply
#9

Do you have IsPlayerConnected(p) ?
Reply
#10

I copied the thing you gave me, it compiles with no errors but it doesn't works.

We are forced to join the other team.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)