08.04.2010, 22:19
Hey, i have a team balancer.. i have 5 teams and i want the teams to be balanced
can u take a look at my script and tell me if it will work/
http://pastebin.com/s0BM97vW
can u take a look at my script and tell me if it will work/
http://pastebin.com/s0BM97vW
Код:
new Count1, Count2, Count3, Count4, Count5; for(new p = 0; p < GetMaxPlayers(); p++) { if (GetPlayerTeam(p) == TEAM_USA) Count1++; else if (GetPlayerTeam(p) == TEAM_GERMANY) Count2++; else if (GetPlayerTeam(p) == TEAM_TALIBAN) Count3++; else if (GetPlayerTeam(p) == TEAM_RUSSIA) Count4++; else if (GetPlayerTeam(p) == TEAM_JAPAN) Count5++; } if ((Count1 > Count2 > Count3 > Count4 > Count5) && GetPlayerTeam(playerid) == TEAM_USA) { SendClientMessage(playerid,COLOR_RED, "[SERVER] Please choose another team so match will be balanced."); return 0; } else if ((Count2 > Count1 > Count3 > Count4 > Count5) && GetPlayerTeam(playerid) == TEAM_GERMANY) { SendClientMessage(playerid,COLOR_RED, "[SERVER] Please choose another team so match will be balanced."); return 0; } else if ((Count3 > Count2 > Count4 > Count1 > Count5) && GetPlayerTeam(playerid) == TEAM_TALIBAN) { SendClientMessage(playerid,COLOR_RED, "[SERVER] Please choose another team so match will be balanced."); return 0; } else if ((Count4 > Count5 > Count2 > Count1) && GetPlayerTeam(playerid) == TEAM_RUSSIA) { SendClientMessage(playerid,COLOR_RED, "[SERVER] Please choose another team so match will be balanced."); return 0; } else if ((Count5 > Count1 > Count4 > Count3 > Count2) && GetPlayerTeam(playerid) == TEAM_JAPAN) { SendClientMessage(playerid,COLOR_RED, "[SERVER] Please choose another team so match will be balanced."); return 0; } return 1; }