29.06.2013, 17:17
maybe this example help you.
pawn Code:
new team1 = 6; // exm team 1 has 6 players
new team2 = 10; // exm team 2 heas 10 players
new timer;
public OnFilterScriptInit()
{
timer = SetTimer("balanceteams", 1000, 1);
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public balanceteams()
{
if (team1 > team2)
{
team2++;
team1--;
}
if (team1 < team2)
{
team2--;
team1++;
}
if(team1 == team2)
{
KillTimer(timer);
}
return 1;
}