18.06.2012, 23:29
i need help whit zombies server team balancer
and thanx
sry for my bad english i am eygptin i know franch more tha english
and thanx
sry for my bad english i am eygptin i know franch more tha english
new Count1,Count2;
public OnPlayerSpawn ( playerid ) {
for(new i = 0; i < GetMaxPlayers(); i++)
{
if (gTeam[playerid] == TEAM_RED) Count1++;
else if (gTeam[playerid] == TEAM_GREEN) Count2++;
}
}
public OnPlayerRequestSpawn(playerid)
{
if ((Count1 > Count2) && gTeam[playerid] == TEAM_GREEN)
{
SendClientMessage(playerid,COLOR_RED, "[BALANCER] Balancing teams. Choose Another Team");
return 0;
}
else if ((Count2 > Count1) && gTeam[playerid] == TEAM_RED)
{
SendClientMessage(playerid,COLOR_RED, "[BALANCER] Balancing teams. Choose Another Team");
return 0;
}
return 1;
}