11.08.2009, 00:12
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)
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;
}

