team balance not working
#1

Код:
    new CountTerrorist, CountArmy;
    for(new p = 0; p < GetMaxPlayers(); p++)
     {
       if (GetPlayerTeam(p) == TEAM_TERRORIST) CountTerrorist++;
       else if (GetPlayerTeam(p) == TEAM_ARMY) CountArmy++;
     }
    if ((CountTerrorist > CountArmy) && GetPlayerTeam(playerid) == TEAM_TERRORIST)
    {
      SendClientMessage(playerid,COLOR_RED, "Terrorist is full. please choose Army.");
      GameTextForPlayer(playerid, "~r~Terrorist is full ~n~ ~b~Please Chooose Army", 3000, 5);
      return 0;
    }
    else if ((CountArmy > CountTerrorist) && GetPlayerTeam(playerid) == TEAM_ARMY)
    {
      SendClientMessage(playerid,COLOR_RED, "Army is full. please choose Terrorist.");
      GameTextForPlayer(playerid, "~b~Army is full ~n~ ~b~Please Chooose Terrorist", 3000, 5);
      return 0;
    }
help please, thats not working
Reply
#2

no help?
Reply
#3

That code is shit, to be honest.

Do this that way, whenever player joins and he's choosing his team (let's say he chosen team CS) just add +1 to this team, but before that do a check (if statement) is that team full or not.

So basically, do a check when player is trying to choose a team, I don't know why you're using loops there.
Reply
#4

someone to help me fix this balancer?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)