Not Allowing Any Teams
#1

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


Reply
#2

*BUMP*
Was on fourth page.
Reply
#3

*BUMP*
Reply
#4

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]])
Reply
#5

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)