28.01.2011, 16:11
hi,
sorry for this question but i just dont have the possibility to test this code with more than 2 players.
Would this code work?
This code shall prevent one team to get overbalanced.
sorry for this question but i just dont have the possibility to test this code with more than 2 players.
Would this code work?
This code shall prevent one team to get overbalanced.
pawn Код:
new Count1, Count2;
for(new p = 0; p < GetMaxPlayers(); p++)
{
if (GetPlayerTeam(p) == TEAM_POLICE) Count1++;
else if (GetPlayerTeam(p) == TEAM_TERRORISTS) Count2++;
}
if ((Count1 > Count2) && GetPlayerTeam(playerid) == TEAM_TERRORISTS)
{
GameTextForPlayer(playerid, "~r~This team is full!", 600, 5);
return 0;
}
else if ((Count2 > Count1) && GetPlayerTeam(playerid) == TEAM_POLICE)
{
GameTextForPlayer(playerid, "~r~This team is full!", 600, 5);
return 0;
}