SA-MP Forums Archive
My team balancer is bugged - 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: My team balancer is bugged (/showthread.php?tid=141878)



My team balancer is bugged - biltong - 15.04.2010

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
  SetupPlayerForClassSelection(playerid);
  SetPlayerTeamFromClass(playerid,classid);
    if(classid == 4 || classid == 5 || classid == 6 || classid == 7 || classid == 8 || classid == 9 || classid == 10 || classid == 11 || classid == 12)
    {
        GameTextForPlayer(playerid,"~b~Cops",1000,6);
        if(num_TEAM_COPS > num_TEAM_CRIMINALS)
        {
            SendClientMessage(playerid, CRIMINALS_COLOR, "There are too many players on Team Cops, please go to Team Criminals.");
            return 0;
        }
    }
    else if(classid == 0 || classid == 1 || classid == 2 || classid == 3)
    {
        GameTextForPlayer(playerid,"~r~Criminals",1000,6);
        if(num_TEAM_COPS < num_TEAM_CRIMINALS)
        {
            SendClientMessage(playerid, CRIMINALS_COLOR, "There are too many players on Team Criminals, please go to Team Cops.");
            return 0;
        }
    }
    return 1;
}
If a player tries to select a skin from criminals and criminals is full, it doesn't show the skin but it shows the message, and I can still choose that team but get stuck with a cops skin.

In other words: Anybody got any idea why that is happening?


Re: My team balancer is bugged - biltong - 15.04.2010

Thanks for making me realise where I failed, I put it under OnPlayerRequestClass not OnPlayerRequestSpawn >.<