Ein kleiner beispiel
public OnPlayerRequestSpawn(playerid){
new team1count = GetPlayersCountInTeam(1);
new team2count = GetPlayersCountInTeam(2);
switch(GetPlayerTeam(playerid))
{
case 1: {
if(team1count-1 > team2count)
{
new str[100];
format(str,100,"Team voll bllalbllbala( T1: %d |T2: %d )",team1count-1,team2count);
SendClientMessage(playerid, -1, str );
return 0;
}
}
case 2: {
if(team2count-1 > team1count)
{
new str[100];
format(str,100,"Team voll bllalbllbala ( T1: %d |T2: %d )",team1count,team2count-1);
SendClientMessage(playerid, -1, str );
return 0;
}
}
}return 1;
}
stock GetPlayersCountInTeam(teamid)
{
new playercount = 0;
for(new x = 0; x < MAX_PLAYERS; x ++)
{
if(GetPlayerState(x) == PLAYER_STATE_NONE) continue;
if(GetPlayerTeam(x) != teamid) continue;
playercount++;
}
return playercount;
}