Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds
Watch MODSonair

Members Online

»
0 Active | 57 Guests
Online:

LATEST FORUM THREADS

»
Mohaa maps on Cod2?
CoD2 MP Mapping

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 4
Category: CoD4 Scripting
Scripting and coding with Call of Duty 4.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: Stop script when dead
SliZe
General Member
Since: Apr 18, 2008
Posts: 21
Last: Aug 21, 2010
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Tuesday, Aug. 10, 2010 07:19 am
Hay everyone!

Im making a script and i want it to end when the player who pressed the trigger is dead. How?

-SliZe
Share |
SliZe
General Member
Since: Apr 18, 2008
Posts: 21
Last: Aug 21, 2010
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Saturday, Aug. 21, 2010 08:56 am
BUMP!

Anyone know? PLZ respond
Share |
Xylozi
General Member
Since: Jul 12, 2008
Posts: 218
Last: Mar 1, 2012
[view latest posts]
Level 4
Im a fan of MODSonair
Category: CoD4 Scripting
Posted: Saturday, Aug. 21, 2010 09:46 am
Please post the script. You will need to use:

Code:
self endon( "death" );
Share |
SliZe
General Member
Since: Apr 18, 2008
Posts: 21
Last: Aug 21, 2010
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Saturday, Aug. 21, 2010 11:41 am
Thanks Xylozi!

Script:
Code:
Speed_Cola();

{
	trigger = getent ( "speed_cola" , "targetname" );

	while(1)
	{
	trigger waittill ( "trigger", user );
        
        if( GetDvar( "g_gametype" ) == "zom" ) // Check that the mod gametype is running
        {
            if( isDefined( self.coins ) && self.coins >= 250 )
            {
                self thread zombie\_hud::UpdateCoins( self.coins, 250, "take" );
				{

				user setclientDvar( "g_speed", 250 );
					player iprintlnbold ( "^1You do now have ^2SUPER SPEED^1!" )
				}
			}
		}
	}
}
Share |
Xylozi
General Member
Since: Jul 12, 2008
Posts: 218
Last: Mar 1, 2012
[view latest posts]
Level 4
Im a fan of MODSonair
Category: CoD4 Scripting
Posted: Saturday, Aug. 21, 2010 12:40 pm
This will work:

Code:

Speed_Cola()
{
	trigger = getEnt( "speed_cola" , "targetname" );

	while(1)
	{
		trigger waittill( "trigger", user );
        
        if( GetDvar( "g_gametype" ) == "zom" ) // Check that the mod gametype is running
        {
            if( isDefined( user.coins ) && user.coins >= 250 )
            {
                user thread zombie\_hud::UpdateCoins( self.coins, 250, "take" );
				user setMoveSpeedScale( 1.5 );	// 1 is default
				user iprintlnbold ( "^1You do now have ^2SUPER SPEED^1!" )
			}
		}
	}
}
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 Scripting

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»