Whats wrong with this Auto Balance
#1

Код:
new Count1, Count2;

public OnPlayerRequestSpawn(playerid)
{
   if ((Count1 > Count2) && GetPlayerTeam(playerid) == TEAM_TERRORIST)
   {
      GameTextForPlayer(playerid, "~r~This team is full!", 600, 5);
      PlayerPlaySound(playerid,1055,0, 0, 0);
      return 0;
   }
   else if((Count2 < Count1) && GetPlayerTeam(playerid) == TEAM_KOPASSUS)
   {
      GameTextForPlayer(playerid, "~r~This team is full!", 600, 5);
      PlayerPlaySound(playerid,1055,0, 0, 0);
      return 0;
   }
   SetPlayerToTeamColour(playerid);
   if( GetPlayerTeam( playerid ) == TEAM_KOPASSUS ) Count1++;
   else if( GetPlayerTeam( playerid ) == TEAM_TERRORIST ) Count2++;
   return 1;
}

public OnPlayerDisconnect
{
 if( GetPlayerTeam( playerid ) == TEAM_KOPASSUS ) Count1--;
 else if( GetPlayerTeam( playerid ) == TEAM_TERRORIST ) Count2--;
return 1;
}
my server still could spawn 2 player with the same team,,,
Reply


Messages In This Thread
Whats wrong with this Auto Balance - by handerson - 05.07.2011, 04:29
Re: Whats wrong with this Auto Balance - by Bakr - 05.07.2011, 04:32
Re: Whats wrong with this Auto Balance - by handerson - 05.07.2011, 04:45
Re: Whats wrong with this Auto Balance - by Bakr - 05.07.2011, 04:48
Re: Whats wrong with this Auto Balance - by handerson - 05.07.2011, 05:18
Re: Whats wrong with this Auto Balance - by Bakr - 05.07.2011, 05:36

Forum Jump:


Users browsing this thread: 4 Guest(s)