If team is full --> Switch team
#17

Quote:
Originally Posted by Naxix
It should prevent players from spawning.
Hmm.. Not working for me :/.

Btw, I want that like it balances the team .. Too if your already playing

E/: Whole OnPlayerRequestClass:

Quote:

public OnPlayerRequestClass(playerid,classid)
{

new Count1, Count2;
for(new i = 0; i < GetMaxPlayers(); i++)
{
if(PlayerTeam[playerid] == 0) Count1++;
else if (PlayerTeam[playerid] == 1) Count2++;
}
if ((Count1 > Count2) && PlayerTeam[playerid] == 1)
{
SendClientMessage(playerid,COLOR_RED, "Balancing teams. Choose Another Team");
return 0;
}
else if ((Count2 > Count1) && PlayerTeam[playerid] == 0)
{
SendClientMessage(playerid,COLOR_RED, "[BALANCER] Balancing teams. Choose Another Team");
return 0;
}

SetPlayerPos(playerid,299.9177,2741.7598,42.9127);
SetPlayerFacingAngle(playerid,198.9686);
SetPlayerCameraPos(playerid,306.3498,2727.6697,37. 0493);
SetPlayerCameraLookAt(playerid,299.9177,2741.7598, 42.9127);
if(classid == 0)
{
PlayerTeam[playerid] = 0;
SetPlayerTeam(playerid,0);
}
else if(classid == 1)
{
PlayerTeam[playerid] = 1;
SetPlayerTeam(playerid,1);
}

return 1;
}

Reply


Messages In This Thread
If team is full --> Switch team - by rbN. - 05.05.2010, 17:38
Re: If team is full --> Switch team - by Naxix - 05.05.2010, 17:58
Re: If team is full --> Switch team - by rbN. - 05.05.2010, 18:10
Re: If team is full --> Switch team - by Naxix - 05.05.2010, 18:11
Re: If team is full --> Switch team - by rbN. - 05.05.2010, 18:15
Re: If team is full --> Switch team - by Naxix - 05.05.2010, 18:16
Re: If team is full --> Switch team - by rbN. - 05.05.2010, 18:17
Re: If team is full --> Switch team - by Naxix - 05.05.2010, 18:18
Re: If team is full --> Switch team - by rbN. - 05.05.2010, 18:19
Re: If team is full --> Switch team - by Naxix - 05.05.2010, 18:23
Re: If team is full --> Switch team - by rbN. - 05.05.2010, 18:25
Re: If team is full --> Switch team - by Naxix - 05.05.2010, 18:29
Re: If team is full --> Switch team - by rbN. - 05.05.2010, 18:40
Re: If team is full --> Switch team - by Naxix - 05.05.2010, 18:43
Re: If team is full --> Switch team - by rbN. - 05.05.2010, 18:48
Re: If team is full --> Switch team - by Naxix - 05.05.2010, 18:49
Re: If team is full --> Switch team - by rbN. - 05.05.2010, 19:06
Re: If team is full --> Switch team - by Naxix - 05.05.2010, 19:20
Re: If team is full --> Switch team - by rbN. - 05.05.2010, 19:42

Forum Jump:


Users browsing this thread: 3 Guest(s)