18.12.2011, 15:52
pawn Код:
//OnPlayerRequestSpawn
CountPolice = 0; // Remove this
CountTerrorists = 0; // Remove this
foreach (Player, i)
{
if(gTeam[i] == TEAM_POLICE)
{
CountPolice++;
}
if(gTeam[i] == TEAM_TERRORISTS)
{
CountTerrorists++;
}
}
if(gTeam[playerid] == TEAM_POLICE && CountPolice > CountTerrorists)
{
SendClientMessage(playerid, 0xE100E1FF, "Join the other team!");
GameTextForPlayer(playerid, "full!", 2000, 5);
ForceClassSelection(playerid);
return 0;
}
if(gTeam[playerid] == TEAM_TERRORISTS && CountPolice < CountTerrorists)
{
SendClientMessage(playerid, 0xE100E1FF, "Join the other team!");
GameTextForPlayer(playerid, "full!", 2000, 5);
ForceClassSelection(playerid);
return 0;
}
if(gTeam[playerid] == TEAM_POLICE && CountPolice == CountTerrorists)
{
SendClientMessage(playerid, 0xE100E1FF, "Welcome to the 'Police' team!");
GameTextForPlayer(playerid, "~b~Police", 2000, 5);
return 0;
}
if(gTeam[playerid] == TEAM_TERRORISTS && CountPolice == CountTerrorists)
{
SendClientMessage(playerid, 0xE100E1FF, "Welcome to the 'Terrorists' team!");
GameTextForPlayer(playerid, "~r~Terrorists", 2000, 5);
return 0;
}