21.02.2012, 19:59
Hello everybody.I created my own Team balance and its not working i dont see any problem maybe you will see.
pawn Код:
new swatcount;//Global Variable
new terrorcount;//Global Variable
public OnPlayerDisconnect(playerid, reason)
{
if(GetPlayerTeam(playerid) == 1)
{
terrorcount--;
}
else if(GetPlayerTeam(playerid) == 2)
{
swatcount--;
}
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
SetPlayerInterior(playerid, 0);
if(GetPlayerSkin(playerid) == 121)
{
SetPlayerTeam(playerid, 1);
SetPlayerColor(playerid,0xFF4600FF);
terrorcount++;
}
if(GetPlayerSkin(playerid) == 285)
{
SetPlayerTeam(playerid, 2);
SetPlayerColor(playerid,0x0091FFFF);
swatcount++;
}
if((terrorcount > swatcount) && (GetPlayerTeam(playerid) == 1))
{
GameTextForPlayer(playerid,"~r~Team Full choose other",2000,3);
return 0;
}
if((terrorcount < swatcount) && (GetPlayerTeam(playerid) == 2))
{
GameTextForPlayer(playerid,"~r~Team Full choose other",2000,3);
return 0;
}
return 1;
}