RandomPlayer
#5

Quote:
Originally Posted by Blackazur
Посмотреть сообщение
Full Code:

Код:
		if(ConnectedPlayers() >= 2)
		{
			if(GetPlayersInTeam(TEAM_ZOMBIE) == 0)
			{

			    new p = RandomPlayer();
		    	TogglePlayerControllable(p,0);
		   	 	ResetPlayerWeaponStats(p);
		   	 	PlayerTeam[p] = TEAM_ZOMBIE;
		   	 	SetPlayerSkin(p,134);
			    SetPlayerTeam(p,TEAM_ZOMBIE);
			    SetPlayerColor(p,0x946D18FF);
                SetPlayerHealth(p,150.0);
			    GivePlayerWeaponEx(p,4,1);
			    TogglePlayerControllable(p,1);
			    SendClientMessage(p,COLOR_REDORANGE,"«| You are a Zombie. |»");
			    format(str,144,"«| %s has been randomly set to Zombie. |»",PlayerName[p]);
			    SendClientMessageToAll(COLOR_RED,str);
			}
			else if(GetPlayersInTeam(TEAM_HUMAN) == 0)
			{
			    new p = RandomPlayer();
			    TogglePlayerControllable(p,0);
			    ResetPlayerWeaponStats(p);
		   	 	PlayerTeam[p] = TEAM_HUMAN;
		   	 	SetPlayerSkin(p,285);
		   	 	SetPlayerTeam(p,TEAM_HUMAN);
			    SetPlayerColor(p,0x349532FF);
			    SetPlayerHealth(p,100.0);
     			GivePlayerWeaponEx(p,23,9999);
     			GivePlayerWeaponEx(p,25,9999);
     			GivePlayerWeaponEx(p,29,9999);
     			GivePlayerWeaponEx(p,31,9999);
     			GivePlayerWeaponEx(p,17,5);
			    TogglePlayerControllable(p,1);
			    SendClientMessage(p,COLOR_YELLOW,"«| You are a Human. |»");
			    format(str,144,"«| %s has been randomly set to Human. |»",PlayerName[p]);
			    SendClientMessageToAll(COLOR_CYAN,str);
The reason why it only puts 1 player on the zombie team is because you are comparing it with "0". So instead use < or > sign to distinguish the difference between them and put them on the proper team.
Reply


Messages In This Thread
RandomPlayer - by Blackazur - 02.02.2013, 16:15
Re: RandomPlayer - by T0pAz - 02.02.2013, 16:19
AW: RandomPlayer - by Blackazur - 02.02.2013, 16:24
AW: RandomPlayer - by Blackazur - 02.02.2013, 16:33
Re: AW: RandomPlayer - by T0pAz - 02.02.2013, 16:42
AW: RandomPlayer - by Blackazur - 02.02.2013, 16:45
AW: RandomPlayer - by Blackazur - 02.02.2013, 16:55
AW: RandomPlayer - by Blackazur - 02.02.2013, 17:52
Re: RandomPlayer - by T0pAz - 02.02.2013, 17:54
AW: RandomPlayer - by Blackazur - 02.02.2013, 18:17

Forum Jump:


Users browsing this thread: 1 Guest(s)