Results 1 to 1 of 1
  1. #1
    justwanttodown's Avatar
    Join Date
    Nov 2013
    Gender
    male
    Posts
    1
    Reputation
    10
    Thanks
    0

    Unhappy Switching Teams Properly

    I am making a Kill The King mod and it worked fine in all of my tests in private matches.
    BUT in public matches the team switching doesn't really work like I want it.

    Here are some things that are pretty weird:

    - Enemies show up as teammates and teammates show up as enemies in a mixed order.
    - The scoreboard and mini-map do not update after switching.
    - Sentry guns are confused.
    - The player models are wrong.
    - You spawn at the original spawn place. So if you got switched you spawn at your enemies.

    Here's the code I wrote to set the player to the right team:

    Code:
    onspawn()
    {
    	self endon( "death" );
    	self endon( "disconnect" );
    
    	self takeAllWeapons();
    	self clearPerks();
    
    	if( self.type == "undefined" )
    	{
    		if( level.teamsset == 1 )
    		{
    			self.type = "assassin";
    			self.weapon = "cheytac_mp";
    		}
    		else
    		{
    			level waittill( "teamset" );
    		}
    		
    	}
    
    	if( self.type == "king" )
    	{
    		if( self.team != "allies" )
    		{
    			self maps\mp\gametypes\_menus::addToTeam( "allies", true );
    			self.team = "allies";
    			self notify("menuresponse", game["menu_team"], "allies");
    		}
    		self.maxhealth = 400;
    		self.health = 400;
    	}
    
    	if( self.type == "assassin" )
    	{
    		if( self.team != "axis" )
    		{
    			self maps\mp\gametypes\_menus::addToTeam( "axis", true );
    			self.team = "axis";
    			self notify("menuresponse", game["menu_team"], "axis");
    		}
    	}
    
    	if( self.type == "guard" )
    	{
    		if( self.team != "allies" )
    		{
    			self maps\mp\gametypes\_menus::addToTeam( "allies", true );
    			self.team = "allies";
    			self notify("menuresponse", game["menu_team"], "allies");
    		}
    	}
    
    	self giveWeapon( self.weapon, 0, false );
    	wait ( 0.05 );
    	self switchToWeapon( self.weapon, 0, false );
    }
    Last edited by justwanttodown; 11-04-2013 at 03:21 AM.

Similar Threads

  1. [Help Request] Switching Teams
    By henkspamadres in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 6
    Last Post: 06-05-2013, 02:05 PM
  2. Glitch How To Switch Teams In Dragon Mode
    By xxpwnedbymex in forum Mission Against Terror Discussions
    Replies: 3
    Last Post: 11-23-2012, 03:42 AM
  3. Force switching teams
    By prisma in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 3
    Last Post: 10-11-2010, 02:34 PM
  4. [SOLVED] [REQUEST] Switch team hack?
    By BananaBoy223 in forum Call of Duty Modern Warfare 2 Help
    Replies: 4
    Last Post: 06-20-2010, 06:14 AM
  5. Aimbot/switch teams
    By HACK! in forum CrossFire Hacks & Cheats
    Replies: 18
    Last Post: 08-12-2009, 04:40 PM