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

Members Online

»
0 Active | 102 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP 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 2
Category: CoD2 Scripting
Scripting and coding with Call of Duty 2.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: Power Jump
r00t_
General Member
Since: Dec 15, 2010
Posts: 51
Last: May 16, 2011
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Thursday, May. 12, 2011 03:12 am
Here's the code for making someone jump extra high.
Code:
jump()
{
	level.boostjump = 700;
	self.health += level.boostjump;
	eInflictor = self;
	eAttacker = self;
	iDamage = level.boostjump;
	iDFlags = 0;
	sMeansOfDeath = "MOD_PROJECTILE";
	sWeapon = "panzershreck_mp";
	vPoint = ( self.origin+(0,0,-1) );
	vDir = (0,0,1);
	sHitLoc = "none";
	psOffsetTime = 0;
	self finishPlayerDamage( eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, psOffsetTime );
	wait 0.05;	
}
Call it like this:
Code:
self thread jump();

CREDIT TO BRAX (at least that's who I think made this...)

I made this thread because I myself thought it was very frustrating looking for it around google and modsonline. So here it is for the noobs[thumbs_up]
Share |
r00t_
General Member
Since: Dec 15, 2010
Posts: 51
Last: May 16, 2011
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Thursday, May. 12, 2011 03:35 am
Hmm it seems on further testing, I think I may have left something out. Because everytime I die, the height of my jump seems to get doubled. Maybe somebody can help [duh]
Share |
Ni3ls
General Member
Since: Nov 7, 2008
Posts: 256
Last: Sep 9, 2017
[view latest posts]
Level 5
Category: CoD2 Scripting
Posted: Thursday, May. 12, 2011 07:00 am
I had the same problem in DM. I can only let it working in my SD server and zombie server. Maybe u need to make another check, that makes a chcek if ur on the ground.Thats how i fixed it for zom and sd. I didnt continue with dm
Share |
BraX
General Member
Since: Apr 29, 2008
Posts: 413
Last: May 26, 2012
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Thursday, May. 12, 2011 12:06 pm
I've simplified this function later, it is better now.

Code:
bounce( pos, power )
{
	oldhp = self.health;
	self.health = self.health + power;
	self finishPlayerDamage( self, self, power, 0, "MOD_PROJECTILE", "none", undefined, pos, "none", 0 );
	self.health = oldhp;
}


Usage:
Code:
player = self;
player bounce( vectorNormalize( player.origin - (player.origin - (0,0,20)) ), 200 );


edited on May. 12, 2011 08:07 am by BraX
Share |
IzNoGoD
General Member
Since: Nov 29, 2008
Posts: 694
Last: Nov 10, 2012
[view latest posts]
Level 6
Category: CoD2 Scripting
Posted: Thursday, May. 12, 2011 12:37 pm
Code:
bounce( pos, power )
{
	self.health = self.health + power;
	self finishPlayerDamage( self, self, power, 0, "MOD_PROJECTILE", "none", undefined, pos, "none", 0 );
}


Usage:
Code:
player bounce( (0,0,1),200);


Even further simplified

Use something like this to call it:
Code:

do_stuff()
{
	self endon("disconnect");
	self endon("spawned");
	self endon("killed_player");
	while(true)
	{
		while(self isonground())
			wait 0.05;
		self bounce( (0,0,1),200);
		while(!self isonground())
			wait 0.05;
	}
}
Share |
BraX
General Member
Since: Apr 29, 2008
Posts: 413
Last: May 26, 2012
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Thursday, May. 12, 2011 02:17 pm
IzNoGoD writes...
Quote:
Code:
bounce( pos, power )
{
	self.health = self.health + power;
	self finishPlayerDamage( self, self, power, 0, "MOD_PROJECTILE", "none", undefined, pos, "none", 0 );
}


You shouldn't remove health part from this function, ive notied that sometimes players had more health after jump before ive added self.health = oldhp;.
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 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

»