SA-MP Forums Archive
whats wrong with this Auto Balance code - 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: whats wrong with this Auto Balance code (/showthread.php?tid=266362)



whats wrong with this Auto Balance code - handerson - 04.07.2011

Quote:

public OnPlayerRequestSpawn(playerid)
{

new Count1, Count2;
for(new p = 0; p < GetMaxPlayers(); p++)
... {
if (GetPlayerTeam(p) == TEAM_POLISI) Count1++;
else if (GetPlayerTeam(p) == TEAM_TERORIS) Count2++;
}
if ((Count1 > Count2) && GetPlayerTeam(playerid) == TEAM_TERORIS)
{
GameTextForPlayer(playerid, "~r~This team is full!", 600, 5);
PlayerPlaySound(playerid,1055,0, 0, 0);
return 0;
}
else if ((Count2 < Count1) && GetPlayerTeam(playerid) == TEAM_POLISI)
{
GameTextForPlayer(playerid, "~r~This team is full!", 600, 5);
PlayerPlaySound(playerid,1055,0, 0, 0);
return 0;
}
}

it doesnt work
but i got no eror