24.05.2015, 11:11
Hello, why this code won't work? just the first line works the others not.
Stock TeamRedSwitch:
Код:
if(playerOnline >= 2 && GetTeamPlayersAlive(TEAM_RED) == 0) TeamRedSwitch(); else if(playerOnline >= 4 && GetTeamPlayersAlive(TEAM_RED) == 1) TeamRedSwitch(); else if(playerOnline >= 6 && GetTeamPlayersAlive(TEAM_RED) == 2) TeamRedSwitch(); else if(playerOnline >= 8 && GetTeamPlayersAlive(TEAM_RED) == 3) TeamRedSwitch();
Код:
stock TeamRedSwitch() { new count = 0; new Random = Iter_Random(Player); foreach(Player, i) { if(team[i] == TEAM_BLUE) count++; if(count == Iter_Count(Player)) { SetPlayerTeam(playerid,TEAM_RED); } } return 1; }