23.02.2011, 17:09
hi,
theres sth. wrong with this team balance code.
If there are 2 members in the police team and i wanna join the other team it says team full but this team is empty and the other team is bigger. So wheres the problem.
It seems correct to me
theres sth. wrong with this team balance code.
If there are 2 members in the police team and i wanna join the other team it says team full but this team is empty and the other team is bigger. So wheres the problem.
It seems correct to me
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
new Count1, Count2;
for(new p = 0; p < GetMaxPlayers(); p++)
{
if (GetPlayerTeam(p) == TEAM_POLICE) Count1++;
else if (GetPlayerTeam(p) == TEAM_TERRORISTS) Count2++;
}
if ((Count1 > Count2) && GetPlayerTeam(playerid) == TEAM_TERRORISTS)
{
GameTextForPlayer(playerid, "~r~This team is full!", 600, 5);
PlayerPlaySound(playerid,1055,0, 0, 0);
return 0;
}
else if ((Count2 > Count1) && GetPlayerTeam(playerid) == TEAM_POLICE)
{
GameTextForPlayer(playerid, "~r~This team is full!", 600, 5);
PlayerPlaySound(playerid,1055,0, 0, 0);
return 0;
}
}