team balance issue
#1

hi,

i have this team balance but its bugged.

pawn Код:
public OnPlayerRequestSpawn(playerid)
{


CountPolice = 0;
CountTerrorists = 0;

//print1
new stringg[128];
format(stringg,sizeof(stringg),"   police: %d      terrorist: %d",CountPolice,CountTerrorists);
SendClientMessage(playerid, 0xE100E1FF, stringg);


    foreach (Player, i)
    {
        if(gTeam[i] == TEAM_POLICE)
        {
            CountPolice++;
        }
        if(gTeam[i] == TEAM_TERRORISTS)
        {
            CountTerrorists++;
        }
    }

//print2
new stringg[128];
format(stringg,sizeof(stringg),"   police: %d      terrorist: %d",CountPolice,CountTerrorists);
SendClientMessage(playerid, 0xE100E1FF, stringg);



        if(gTeam[playerid] == TEAM_POLICE && CountPolice > CountTerrorists)
        {
            SendClientMessage(playerid, 0xE100E1FF, "join other team");
            GameTextForPlayer(playerid, "full!", 2000, 5);
            return 0;
        }
        if(gTeam[playerid] == TEAM_TERRORISTS && CountPolice < CountTerrorists)
        {
            SendClientMessage(playerid, 0xE100E1FF, "join other team");
            GameTextForPlayer(playerid, "full!", 2000, 5);
            return 0;
        }

return 1;
}
The looping and counting of the team members works but not the if statement.
print1 shows team police = 0 and team terror = 0. thats right cause it is resettet before a new looping begins as u can see in the code.
prin2 shows the right team count as well this time with the looping count.
if print2 shows e.g. 0:1 it doesnt let me spawn on both teams. always writing its full on both teams why?
The looping works as the print shows but not the if statements...

i hope u can help me.
Reply


Messages In This Thread
team balance issue - by PawnoQ - 18.12.2011, 13:52
Re: team balance issue - by §с†¶e®РµРe - 18.12.2011, 15:07
Re: team balance issue - by PawnoQ - 18.12.2011, 15:15
Re: team balance issue - by Gamer_Z - 18.12.2011, 15:18
Re: team balance issue - by §с†¶e®РµРe - 18.12.2011, 15:20
Re: team balance issue - by PawnoQ - 18.12.2011, 15:36
Re: team balance issue - by Thresholdold - 18.12.2011, 15:43
Re: team balance issue - by PawnoQ - 18.12.2011, 15:47
Re: team balance issue - by Thresholdold - 18.12.2011, 15:52
Re: team balance issue - by suhrab_mujeeb - 18.12.2011, 17:23

Forum Jump:


Users browsing this thread: 1 Guest(s)