SA-MP Forums Archive
Teambalancer & NextMap help. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Teambalancer & NextMap help. (/showthread.php?tid=122880)



Teambalancer & NextMap help. - [dN]Eagle - 23.01.2010

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?


Re: Teambalancer & NextMap help. - [dN]Eagle - 23.01.2010

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




Re: Teambalancer & NextMap help. - [dN]Eagle - 24.01.2010

Bump

P.S: I have read the rules


Re: Teambalancer & NextMap help. - mansonh - 24.01.2010

I would ask on the post regarding the gteam system.


Re: Teambalancer & NextMap help. - [dN]Eagle - 24.01.2010

Link?


Re: Teambalancer & NextMap help. - [dN]Eagle - 24.01.2010

Код:
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.



Re: Teambalancer & NextMap help. - MadeMan - 24.01.2010

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;
}



Re: Teambalancer & NextMap help. - [dN]Eagle - 24.01.2010

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.


Re: Teambalancer & NextMap help. - MadeMan - 24.01.2010

Do you have IsPlayerConnected(p) ?


Re: Teambalancer & NextMap help. - [dN]Eagle - 24.01.2010

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.