22.12.2009, 09:45
Try this (not tested, i'm at work.. cannot test right now)
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
if ( CountA > CountB && CountA > CountC && GetPlayerTeam(playerid) == TEAM_A)
{
SendMsg(playerid, 5000, "~b~NOTICE: ~w~This team is full!");
return 0;
}
else if ( CountB > CountA && CountB > CountC && GetPlayerTeam(playerid) == TEAM_B)
{
SendMsg(playerid, 5000, "~b~NOTICE: ~w~This team is full!");
return 0;
}
else if ( CountC > CountA && CountC > CountB && GetPlayerTeam(playerid) == TEAM_C)
{
SendMsg(playerid, 5000, "~b~NOTICE: ~w~This team is full!");
return 0;
}
else return 1;
}
OnPlayerDeath and OnplayerDisconnect;
if (GetPlayerTeam(playerid) == TEAM_A)
{
CountA--;
}
else if (GetPlayerTeam(playerid) == TEAM_B)
{
CountB--;
}
else if (GetPlayerTeam(playerid) == TEAM_C)
{
CountC--;
}
OnPlayerSpawn;
if (GetPlayerTeam(playerid) == TEAM_A)
{
CountA++;
}
else if (GetPlayerTeam(playerid) == TEAM_B)
{
CountB++;
}
else if (GetPlayerTeam(playerid) == TEAM_C)
{
CountC++;
}