Results 1 to 2 of 2
  1. #1
    Jayrd's Avatar
    Join Date
    Jul 2014
    Gender
    male
    Posts
    1
    Reputation
    10
    Thanks
    0

    How I can create teleports MW2 MOD

    I would like to help me with my idea, take a few hours on google trying to find something about it, they appear clear ideas but as many people do not know much about modding I find it very difficult to understand. What I'm trying to make is that somewhere in the map has a gate and an output, the X character position in place and then teleport to another location established (and I have the coordinates of the places I want). Thank you

  2. #2
    .Nuze's Avatar
    Join Date
    Dec 2016
    Gender
    male
    Posts
    2
    Reputation
    10
    Thanks
    61
    i know im late af but i thought why not someone out there probably need this xD

    First of all you need to create the first positions you would call it the first gate

    Green = map name
    Red = position

    and yeah that only 2 examples you have to do it with every map.

    Code:
    TeleportPositions()
    {
    	switch( level.CurMap )
    	{
    		case "mp_afghan":											
    			level.teleports["mp_afghan"]    =    [];
    			level.teleports["mp_afghan"][0] = (3968, 1214, 197);	
    		break;
    		
    		case "mp_derail":
    			level.teleports["mp_derail"]    =    [];
    			level.teleports["mp_derail"][0] = (-1371, 2197, 227);	
    			level.teleports["mp_derail"][1] = (1129, 57, 223);		
    		break;
             }
    }

    second step is to create the outcome locations

    this is the same code but instead of level.teleports it is level.locations

    Code:
    TeleportLocation()
    {
    	switch( level.CurMap )
    	{
    		case "mp_afghan":											
    			level.locations["mp_afghan"]    =    [];
    			level.locations["mp_afghan"][0] = (3867, 1408, 347);	 
    		break;
    		
    		case "mp_derail":
    			level.locations["mp_derail"]    =    [];
    			level.locations["mp_derail"][0] = (-1347, 2157, 507);	
    			level.locations["mp_derail"][1] = (1247, 89, 529);		
    		break;
            }
    }
    next step the main code

    Code:
    doTeleport()
    {
    	level endon( "disconnect" );
    	
    	while( isDefined( level.teleports[level.CurMap] ) )
    	{
    		wait 0.01;
    		foreach( player in level.players )
    		{	
    		
    			
    				for( bCount = 0; bCount < level.teleports[level.CurMap].size; bCount++ )
    				{
    	
    					
    					self.pers["Position"] = level.locations[level.CurMap][bCount];
    					if( !isDefined( level.teleports[level.CurMap][bCount] ) )
    						continue;
    					if( isDefined( level.teleports[level.CurMap]["radius"][bCount] ) )
    					{	
    						
    						player.bRadius = level.teleports[level.CurMap]["radius"][bCount];
    					}
    					else
    					{
    						
    						level.teleports[level.CurMap]["radius"][bCount] = 80;
    						player.bRadius = level.teleports[level.CurMap]["radius"][bCount];
    					}
    					if( distance( player.origin, level.teleports[level.CurMap][bCount] ) <= player.bRadius && player.origin[2] - level.teleports[level.CurMap][bCount][2] <= 25 )
    					{
    						self setOrigin( self.pers["Position"] );
    						
    					}	
    			}	
    			
    		}
    	}
    }
    just copy and paste this one and after that the only thing left is to thread everything on onPlayerConnect

    Code:
    level.CurMap = getDvar( "mapname") ;
    self thread TeleportPositions();
    self thread TeleportLocation();
    self thread doTeleport();

Similar Threads

  1. How Do I Change A Mw2 Mod Menu Patch's Controls!
    By Blam86 in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 1
    Last Post: 03-18-2012, 10:44 AM
  2. [Help Request] How Do I Change A Mw2 Mod Menu Patch's Controls!
    By Blam86 in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 1
    Last Post: 03-10-2012, 07:57 AM
  3. How can you create MW2 Mods?
    By telis9852 in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 2
    Last Post: 10-21-2010, 12:45 PM
  4. [Help] how I can create a hack?
    By kulet0 in forum WarRock Discussions
    Replies: 15
    Last Post: 07-16-2010, 09:35 AM
  5. How we can create a hack?
    By ganduira in forum Call of Duty Modern Warfare 2 Help
    Replies: 20
    Last Post: 02-18-2010, 02:54 PM