29.11.2013, 17:49
Here you go, Using zcmd
player with Id 0 = team 0
Id 1 = team 1
id 2 = team 0
id 3 = team 1 and so on
pawn Код:
CMD:balanceteams(playerid, params[])
{
new TotalPlayers = 0;
new A=0, B=1;
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
switch (i)
{
case A: SetPlayerTeam(playerid, 1); // First team
case B: SetPlayerTeam(playerid, 2); // Second team
}
}
A += 2;
B += 2;
}
return 1;
}
Id 1 = team 1
id 2 = team 0
id 3 = team 1 and so on