25.07.2013, 13:32
Beacause i want to calculate the number at all team in game and i use 1 loop on a loop it's too much
PHP код:
new COUNTMYTEAM,CountOtherTeam[MAX_PLAYERS],MAXINTEAM;
foreach(new i : Player)
{
if(gLogged[i])
{
if(PlayerInfo[i][pTeamId] > 0 && GetPlayerTeam(i) == CLAN+PlayerInfo[i][pTeamId])
{
if(PlayerInfo[i][pTeamId] == PlayerInfo[playerid][pTeamId]) COUNTMYTEAM++;
foreach(new e : Player)
{
if(gLogged[e])
{
if(PlayerInfo[e][pTeamId] == PlayerInfo[i][pTeamId] && PlayerInfo[e][pTeamId] != PlayerInfo[playerid][pTeamId]) CountOtherTeam[e]++;
if(MAXINTEAM< CountOtherTeam[e]) MAXINTEAM= CountOtherTeam[e];
}
}
}
}
}
if(COUNTMYTEAM > 1)
{
// code...
}
return 1;