SA-MP Forums Archive
Not Allowing Any Teams - 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: Not Allowing Any Teams (/showthread.php?tid=90905)



Not Allowing Any Teams - Memoryz - 11.08.2009

Okay, so I managed to find some teambalancing script, I fixed the errors, and customized it to fit my gamemode.

Now, when my server is empty, and then I join,I choose any team and it says This team is full, even tho there isnt anyone in the server!

So, is there a way to add an exception that if the team has 0 players, it overrides the script from stopping you spawn on that team?

Here is my code (No code stealers please, srsly)

Код:
public OnPlayerRequestSpawn(playerid)
{
  new tcount[2];
  for(new i=0; i<GetMaxPlayers(); i++)
  {
    if(IsPlayerConnected(i))
    {
      tcount[gClass[playerid]] ++;
      if(tcount[gClass[playerid]] > tcount[!gClass[playerid]])
      {
        SendClientMessage(playerid, RED, "This team is full, please choose another team!");
        return 0;
      }
    }
  }
  return 1;
}





Re: Not Allowing Any Teams - Memoryz - 11.08.2009

*BUMP*
Was on fourth page.


Re: Not Allowing Any Teams - Memoryz - 11.08.2009

*BUMP*


Re: Not Allowing Any Teams - Joe Staff - 11.08.2009

first off
pawn Код:
if(tcount[gClass[playerid]] > tcount[!gClass[playerid]])
That works for you?

And if it does then change it to this.
pawn Код:
if((tcount[gClass[playerid]] > tcount[!gClass[playerid]])&&tcount[gClass[playerid]])



Re: Not Allowing Any Teams - Memoryz - 11.08.2009

Yes, I call it gClass, not Gteam, it works perfectly, im not going to go back and change it just because someone doesn't thing its proper >.<

Nope, changing it to the thing you put, it still says Please choose the other team, even tho their isn't anyone on any team.