My team balancer is bugged
#1

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:
  • Criminals team is full
  • I try to choose skin on criminals team, it doesn't show the skin, it gets stuck on the last usable skin, and sends me the message
  • I spawn as a skin I can't see but I know is on the criminals team, it spawns me at the last usable skin's spawn, with that skin, but sets my team to criminals
Anybody got any idea why that is happening?
Reply
#2

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


Forum Jump:


Users browsing this thread: 1 Guest(s)