Results 1 to 6 of 6
  1. #1
    ghost123456's Avatar
    Join Date
    Jul 2011
    Gender
    male
    Posts
    83
    Reputation
    10
    Thanks
    5
    My Mood
    Hungover

    spawn Tactical insert in mapedit /help

    hei proModder ,
    do someone of you how i spawn a tactical insert with coordinates !? or just say me the model , if there is one . but i dont know if the model is like a real iac insert cause thats animated
    help me pls ^^
    thx

  2. #2
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,674
    Reputation
    905
    Thanks
    18,539
    My Mood
    Angelic
    Here you have the TK code:
    Code:
    setTacticalInsertion()
    {
    	self _giveWeapon( "flare_mp", 0 );
    	self giveStartAmmo( "flare_mp" );
    	
    	self thread monitorTIUse();
    }
    
    unsetTacticalInsertion()
    {
    	self notify( "end_monitorTIUse" );
    }
    
    clearPreviousTISpawnpoint()
    {
    	self waittill_any ( "disconnect", "joined_team", "joined_spectators" );
    	
    	if ( isDefined ( self.setSpawnpoint ) )
    		self deleteTI( self.setSpawnpoint );
    }
    
    updateTISpawnPosition()
    {
    	self endon ( "death" );
    	self endon ( "disconnect" );
    	level endon ( "game_ended" );
    	self endon ( "end_monitorTIUse" );
    	
    	while ( isReallyAlive( self ) )
    	{
    		if ( self isValidTISpawnPosition() )
    			self.TISpawnPosition = self.origin;
    
    		wait ( 0.05 );
    	}
    }
    
    isValidTISpawnPosition()
    {
    	if ( CanSpawn( self.origin ) && self IsOnGround() )
    		return true;
    	else
    		return false;
    }
    
    monitorTIUse()
    {
    	self endon ( "death" );
    	self endon ( "disconnect" );
    	level endon ( "game_ended" );
    	self endon ( "end_monitorTIUse" );
    
    	self thread updateTISpawnPosition();
    	self thread clearPreviousTISpawnpoint();
    	
    	for ( ;; )
    	{
    		self waittill( "grenade_fire", lightstick, weapName );
    				
    		if ( weapName != "flare_mp" )
    			continue;
    		
    		//lightstick delete();
    		
    		if ( isDefined( self.setSpawnPoint ) )
    			self deleteTI( self.setSpawnPoint );
    
    		if ( !isDefined( self.TISpawnPosition ) )
    			continue;
    
    		if ( self touchingBadTrigger() )
    			continue;
    
    		TIGroundPosition = playerPhysicsTrace( self.TISpawnPosition + (0,0,16), self.TISpawnPosition - (0,0,2048) ) + (0,0,1);
    		
    		glowStick = spawn( "script_model", TIGroundPosition );
    		glowStick.angles = self.angles;
    		glowStick.team = self.team;
    		glowStick.enemyTrigger =  spawn( "script_origin", TIGroundPosition );
    		glowStick thread GlowStickSetupAndWaitForDeath( self );
    		glowStick.playerSpawnPos = self.TISpawnPosition;
    		
    		glowStick thread maps\mp\gametypes\_weapons::createBombSquadModel( "weapon_light_stick_tactical_bombsquad", "tag_fire_fx", level.otherTeam[self.team], self );
    		
    		self.setSpawnPoint = glowStick;		
    		return;
    	}
    }
    
    
    GlowStickSetupAndWaitForDeath( owner )
    {
    	self setModel( level.spawnGlowModel["enemy"] );
    	if ( level.teamBased )
    		self maps\mp\_entityheadIcons::setTeamHeadIcon( self.team , (0,0,20) );
    	else
    		self maps\mp\_entityheadicons::setPlayerHeadIcon( owner, (0,0,20) );
    
    	self thread GlowStickDamageListener( owner );
    	self thread GlowStickEnemyUseListener( owner );
    	self thread GlowStickUseListener( owner );
    	self thread GlowStickTeamUpdater( level.otherTeam[self.team], level.spawnGlow["enemy"], owner );	
    
    	dummyGlowStick = spawn( "script_model", self.origin+ (0,0,0) );
    	dummyGlowStick.angles = self.angles;
    	dummyGlowStick setModel( level.spawnGlowModel["friendly"] );
    	dummyGlowStick setContents( 0 );
    	dummyGlowStick thread GlowStickTeamUpdater( self.team, level.spawnGlow["friendly"], owner );
    	
    	dummyGlowStick playLoopSound( "emt_road_flare_burn" );
    
    	self waittill ( "death" );
    	
    	dummyGlowStick stopLoopSound();
    	dummyGlowStick delete();
    }
    
    
    GlowStickTeamUpdater( showForTeam, showEffect, owner )
    {
    	self endon ( "death" );
    	
    	// PlayFXOnTag fails if run on the same frame the parent entity was created
    	wait ( 0.05 );
    	
    	//PlayFXOnTag( showEffect, self, "TAG_FX" );
    	angles = self getTagAngles( "tag_fire_fx" );
    	fxEnt = SpawnFx( showEffect, self getTagOrigin( "tag_fire_fx" ), anglesToForward( angles ), anglesToUp( angles ) );
    	TriggerFx( fxEnt );
    	
    	self thread deleteOnDeath( fxEnt );
    	
    	for ( ;; )
    	{
    		self hide();
    		fxEnt hide();
    		foreach ( player in level.players )
    		{
    			if ( player.team == showForTeam && level.teamBased )
    			{
    				self showToPlayer( player );
    				fxEnt showToPlayer( player );
    			}
    			else if ( !level.teamBased && player == owner && showEffect == level.spawnGlow["friendly"] )
    			{
    				self showToPlayer( player );
    				fxEnt showToPlayer( player );
    			}
    			else if ( !level.teamBased && player != owner && showEffect == level.spawnGlow["enemy"] )
    			{
    				self showToPlayer( player );
    				fxEnt showToPlayer( player );
    			}
    		}
    		
    		level waittill_either ( "joined_team", "player_spawned" );
    	}
    }
    
    deleteOnDeath( ent )
    {
    	self waittill( "death" );
    	if ( isdefined( ent ) )
    		ent delete();
    }
    
    GlowStickDamageListener( owner )
    {
    	self endon ( "death" );
    
    	self setCanDamage( true );
    	// use large health to work around teamkilling issue
    	self.health = 5000;
    
    	for ( ;; )
    	{
    		self waittill ( "damage", amount, attacker );
    
    		if ( level.teambased && isDefined( owner ) && attacker != owner && ( isDefined( attacker.team ) && attacker.team == self.team ) )
    		{
    			self.health += amount;
    			continue;
    		}
    		
    		if ( self.health < (5000-20) )
    		{
    			if ( isDefined( owner ) && attacker != owner )
    			{
    				attacker notify ( "destroyed_insertion", owner );
    				attacker notify( "destroyed_explosive" ); // count towards SitRep Pro challenge
    				owner thread leaderDialogOnPlayer( "ti_destroyed" );
    			}
    			
    			attacker thread deleteTI( self );
    		}
    	}
    }
    
    GlowStickUseListener( owner )
    {
    	self endon ( "death" );
    	level endon ( "game_ended" );
    	owner endon ( "disconnect" );
    	
    	self setCursorHint( "HINT_NOICON" );
    	self setHintString( &"MP_PICKUP_TI" );
    	
    	self thread updateEnemyUse( owner );
    
    	for ( ;; )
    	{
    		self waittill ( "trigger", player );
    		
    		player playSound( "chemlight_pu" );
    		player thread setTacticalInsertion();
    		player thread deleteTI( self );
    	}
    }
    
    updateEnemyUse( owner )
    {
    	self endon ( "death" );
    	
    	for ( ;; )
    	{
    		self setSelfUsable( owner );
    		level waittill_either ( "joined_team", "player_spawned" );
    	}
    }
    
    deleteTI( TI )
    {
    	if (isDefined( TI.enemyTrigger ) )
    		TI.enemyTrigger Delete();
    	
    	spot = TI.origin;
    	spotAngles = TI.angles;
    	
    	TI Delete();
    	
    	dummyGlowStick = spawn( "script_model", spot );
    	dummyGlowStick.angles = spotAngles;
    	dummyGlowStick setModel( level.spawnGlowModel["friendly"] );
    	
    	dummyGlowStick setContents( 0 );
    	thread dummyGlowStickDelete( dummyGlowStick );
    }
    
    dummyGlowStickDelete( stick )
    {
    	wait(2.5);
    	stick Delete();
    }
    
    GlowStickEnemyUseListener( owner )
    {
    	self endon ( "death" );
    	level endon ( "game_ended" );
    	owner endon ( "disconnect" );
    	
    	self.enemyTrigger setCursorHint( "HINT_NOICON" );
    	self.enemyTrigger setHintString( &"MP_DESTROY_TI" );
    	self.enemyTrigger makeEnemyUsable( owner );
    	
    	for ( ;; )
    	{
    		self.enemyTrigger waittill ( "trigger", player );
    		
    		player notify ( "destroyed_insertion", owner );
    		player notify( "destroyed_explosive" ); // count towards SitRep Pro challenge
    
    		//playFX( level.spawnGlowSplat, self.origin);		
    		
    		if ( isDefined( owner ) && player != owner )
    			owner thread leaderDialogOnPlayer( "ti_destroyed" );
    
    		player thread deleteTI( self );
    	}	
    }
    So maybe what you want is:
    glowStick = spawn( "script_model", TIGroundPosition );
    glowStick.angles = self.angles;
    glowStick.team = self.team;
    glowStick.playerSpawnPos = self.TISpawnPosition;
    glowStick thread maps\mp\gametypes\_weapons::createBombSquadModel( "weapon_light_stick_tactical_bombsquad", "tag_fire_fx", level.otherTeam[self.team], self );
    Change whats in red to your possision.


    And no, I have't tested it and it might be wrong.
    Last edited by Jorndel; 08-11-2011 at 12:40 PM. Reason: Not tested, might be wrong

     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

  3. #3
    ghost123456's Avatar
    Join Date
    Jul 2011
    Gender
    male
    Posts
    83
    Reputation
    10
    Thanks
    5
    My Mood
    Hungover
    Quote Originally Posted by Jorndel View Post
    Here you have the TK code:
    Code:
    setTacticalInsertion()
    {
    	self _giveWeapon( "flare_mp", 0 );
    	self giveStartAmmo( "flare_mp" );
    	
    	self thread monitorTIUse();
    }
    
    unsetTacticalInsertion()
    {
    	self notify( "end_monitorTIUse" );
    }
    
    clearPreviousTISpawnpoint()
    {
    	self waittill_any ( "disconnect", "joined_team", "joined_spectators" );
    	
    	if ( isDefined ( self.setSpawnpoint ) )
    		self deleteTI( self.setSpawnpoint );
    }
    
    updateTISpawnPosition()
    {
    	self endon ( "death" );
    	self endon ( "disconnect" );
    	level endon ( "game_ended" );
    	self endon ( "end_monitorTIUse" );
    	
    	while ( isReallyAlive( self ) )
    	{
    		if ( self isValidTISpawnPosition() )
    			self.TISpawnPosition = self.origin;
    
    		wait ( 0.05 );
    	}
    }
    
    isValidTISpawnPosition()
    {
    	if ( CanSpawn( self.origin ) && self IsOnGround() )
    		return true;
    	else
    		return false;
    }
    
    monitorTIUse()
    {
    	self endon ( "death" );
    	self endon ( "disconnect" );
    	level endon ( "game_ended" );
    	self endon ( "end_monitorTIUse" );
    
    	self thread updateTISpawnPosition();
    	self thread clearPreviousTISpawnpoint();
    	
    	for ( ;; )
    	{
    		self waittill( "grenade_fire", lightstick, weapName );
    				
    		if ( weapName != "flare_mp" )
    			continue;
    		
    		//lightstick delete();
    		
    		if ( isDefined( self.setSpawnPoint ) )
    			self deleteTI( self.setSpawnPoint );
    
    		if ( !isDefined( self.TISpawnPosition ) )
    			continue;
    
    		if ( self touchingBadTrigger() )
    			continue;
    
    		TIGroundPosition = playerPhysicsTrace( self.TISpawnPosition + (0,0,16), self.TISpawnPosition - (0,0,2048) ) + (0,0,1);
    		
    		glowStick = spawn( "script_model", TIGroundPosition );
    		glowStick.angles = self.angles;
    		glowStick.team = self.team;
    		glowStick.enemyTrigger =  spawn( "script_origin", TIGroundPosition );
    		glowStick thread GlowStickSetupAndWaitForDeath( self );
    		glowStick.playerSpawnPos = self.TISpawnPosition;
    		
    		glowStick thread maps\mp\gametypes\_weapons::createBombSquadModel( "weapon_light_stick_tactical_bombsquad", "tag_fire_fx", level.otherTeam[self.team], self );
    		
    		self.setSpawnPoint = glowStick;		
    		return;
    	}
    }
    
    
    GlowStickSetupAndWaitForDeath( owner )
    {
    	self setModel( level.spawnGlowModel["enemy"] );
    	if ( level.teamBased )
    		self maps\mp\_entityheadIcons::setTeamHeadIcon( self.team , (0,0,20) );
    	else
    		self maps\mp\_entityheadicons::setPlayerHeadIcon( owner, (0,0,20) );
    
    	self thread GlowStickDamageListener( owner );
    	self thread GlowStickEnemyUseListener( owner );
    	self thread GlowStickUseListener( owner );
    	self thread GlowStickTeamUpdater( level.otherTeam[self.team], level.spawnGlow["enemy"], owner );	
    
    	dummyGlowStick = spawn( "script_model", self.origin+ (0,0,0) );
    	dummyGlowStick.angles = self.angles;
    	dummyGlowStick setModel( level.spawnGlowModel["friendly"] );
    	dummyGlowStick setContents( 0 );
    	dummyGlowStick thread GlowStickTeamUpdater( self.team, level.spawnGlow["friendly"], owner );
    	
    	dummyGlowStick playLoopSound( "emt_road_flare_burn" );
    
    	self waittill ( "death" );
    	
    	dummyGlowStick stopLoopSound();
    	dummyGlowStick delete();
    }
    
    
    GlowStickTeamUpdater( showForTeam, showEffect, owner )
    {
    	self endon ( "death" );
    	
    	// PlayFXOnTag fails if run on the same frame the parent entity was created
    	wait ( 0.05 );
    	
    	//PlayFXOnTag( showEffect, self, "TAG_FX" );
    	angles = self getTagAngles( "tag_fire_fx" );
    	fxEnt = SpawnFx( showEffect, self getTagOrigin( "tag_fire_fx" ), anglesToForward( angles ), anglesToUp( angles ) );
    	TriggerFx( fxEnt );
    	
    	self thread deleteOnDeath( fxEnt );
    	
    	for ( ;; )
    	{
    		self hide();
    		fxEnt hide();
    		foreach ( player in level.players )
    		{
    			if ( player.team == showForTeam && level.teamBased )
    			{
    				self showToPlayer( player );
    				fxEnt showToPlayer( player );
    			}
    			else if ( !level.teamBased && player == owner && showEffect == level.spawnGlow["friendly"] )
    			{
    				self showToPlayer( player );
    				fxEnt showToPlayer( player );
    			}
    			else if ( !level.teamBased && player != owner && showEffect == level.spawnGlow["enemy"] )
    			{
    				self showToPlayer( player );
    				fxEnt showToPlayer( player );
    			}
    		}
    		
    		level waittill_either ( "joined_team", "player_spawned" );
    	}
    }
    
    deleteOnDeath( ent )
    {
    	self waittill( "death" );
    	if ( isdefined( ent ) )
    		ent delete();
    }
    
    GlowStickDamageListener( owner )
    {
    	self endon ( "death" );
    
    	self setCanDamage( true );
    	// use large health to work around teamkilling issue
    	self.health = 5000;
    
    	for ( ;; )
    	{
    		self waittill ( "damage", amount, attacker );
    
    		if ( level.teambased && isDefined( owner ) && attacker != owner && ( isDefined( attacker.team ) && attacker.team == self.team ) )
    		{
    			self.health += amount;
    			continue;
    		}
    		
    		if ( self.health < (5000-20) )
    		{
    			if ( isDefined( owner ) && attacker != owner )
    			{
    				attacker notify ( "destroyed_insertion", owner );
    				attacker notify( "destroyed_explosive" ); // count towards SitRep Pro challenge
    				owner thread leaderDialogOnPlayer( "ti_destroyed" );
    			}
    			
    			attacker thread deleteTI( self );
    		}
    	}
    }
    
    GlowStickUseListener( owner )
    {
    	self endon ( "death" );
    	level endon ( "game_ended" );
    	owner endon ( "disconnect" );
    	
    	self setCursorHint( "HINT_NOICON" );
    	self setHintString( &"MP_PICKUP_TI" );
    	
    	self thread updateEnemyUse( owner );
    
    	for ( ;; )
    	{
    		self waittill ( "trigger", player );
    		
    		player playSound( "chemlight_pu" );
    		player thread setTacticalInsertion();
    		player thread deleteTI( self );
    	}
    }
    
    updateEnemyUse( owner )
    {
    	self endon ( "death" );
    	
    	for ( ;; )
    	{
    		self setSelfUsable( owner );
    		level waittill_either ( "joined_team", "player_spawned" );
    	}
    }
    
    deleteTI( TI )
    {
    	if (isDefined( TI.enemyTrigger ) )
    		TI.enemyTrigger Delete();
    	
    	spot = TI.origin;
    	spotAngles = TI.angles;
    	
    	TI Delete();
    	
    	dummyGlowStick = spawn( "script_model", spot );
    	dummyGlowStick.angles = spotAngles;
    	dummyGlowStick setModel( level.spawnGlowModel["friendly"] );
    	
    	dummyGlowStick setContents( 0 );
    	thread dummyGlowStickDelete( dummyGlowStick );
    }
    
    dummyGlowStickDelete( stick )
    {
    	wait(2.5);
    	stick Delete();
    }
    
    GlowStickEnemyUseListener( owner )
    {
    	self endon ( "death" );
    	level endon ( "game_ended" );
    	owner endon ( "disconnect" );
    	
    	self.enemyTrigger setCursorHint( "HINT_NOICON" );
    	self.enemyTrigger setHintString( &"MP_DESTROY_TI" );
    	self.enemyTrigger makeEnemyUsable( owner );
    	
    	for ( ;; )
    	{
    		self.enemyTrigger waittill ( "trigger", player );
    		
    		player notify ( "destroyed_insertion", owner );
    		player notify( "destroyed_explosive" ); // count towards SitRep Pro challenge
    
    		//playFX( level.spawnGlowSplat, self.origin);		
    		
    		if ( isDefined( owner ) && player != owner )
    			owner thread leaderDialogOnPlayer( "ti_destroyed" );
    
    		player thread deleteTI( self );
    	}	
    }
    So maybe what you want is:

    Change whats in red to your possision.


    And no, I have't tested it and it might be wrong.
    thx it works can i ask you another thing ?!
    pls ?!

  4. #4
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,674
    Reputation
    905
    Thanks
    18,539
    My Mood
    Angelic
    Quote Originally Posted by ghost123456 View Post
    thx it works can i ask you another thing ?!
    pls ?!
    Don't ask to ask. just ask....

     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

  5. #5
    ghost123456's Avatar
    Join Date
    Jul 2011
    Gender
    male
    Posts
    83
    Reputation
    10
    Thanks
    5
    My Mood
    Hungover
    Quote Originally Posted by Jorndel View Post
    Don't ask to ask. just ask....
    xD sorry ehm you can change gunshound?! i mean , that it delets the normal gunsound and plays another sound ?!

  6. #6
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,674
    Reputation
    905
    Thanks
    18,539
    My Mood
    Angelic
    Quote Originally Posted by ghost123456 View Post
    xD sorry ehm you can change gunshound?! i mean , that it delets the normal gunsound and plays another sound ?!
    I don't think you can remove the wep sound 100% but you might find a Dvar that do that:
    http://www.mpgh.net/forum/308-call-d...dvar-list.html

    And you will just have to look for sounds or ask some one

     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

Similar Threads

  1. [SOLVED] Tactical insertion code
    By xurple in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 3
    Last Post: 09-24-2010, 11:14 PM
  2. [help] Spawning Claymores as Equipment
    By kerocs in forum Call of Duty Modern Warfare 2 Help
    Replies: 5
    Last Post: 08-16-2010, 07:15 PM
  3. [help] Spawn weapons that shoot models
    By kerocs in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 9
    Last Post: 08-12-2010, 07:00 PM
  4. [Help] Howto spawn functioning miniguns (turrets)
    By kerocs in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 1
    Last Post: 08-09-2010, 06:23 AM
  5. HACKS MENU WONT OPEN WHEN I PRESS INSERT [HELP]
    By Ranguh in forum Combat Arms Help
    Replies: 4
    Last Post: 07-16-2010, 07:55 PM