Detect jump?

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Elgan
Site Admin
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

Detect jump?

Post by Elgan »

hello im trying to detect if someone presses jump


im failing though:(

any ideas?

Code: Select all


plane_jump:
	local.player=parm.other
	//local.t=0
	//while(local.t==1)
	//{


//iprintln "keep"
		if(local.player.stufftext==("+moveup"))
		{
			iprintln "bail out"
			//local.t=1

		}
	//wait .1
	//}
end
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

try

Post by tltrude »

Don't know if it will work, but try this.

if(local.player.stufftext == "moveup")

Although, I'm pretty sure you should be looking for something to do with the players "legstate", or "leg_state".
Tom Trude,

Image
Elgan
Site Admin
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

Post by Elgan »

it doesnt work:(, for now ill use use+fire to bail out:)

the question still remains though;)
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

bombs

Post by tltrude »

This line is for setting bomb triggers in objective games.

while ( (Isalive local.player) && (local.player cansee self level.bombusefov level.bomb_use_distance) && (local.player.useheld == 1) )

It makes sure the player is looking at the trigger and that he is holding the use key down (there is a 6 second counter with the stopwatch in the while loop). The counter resets to 0 if the player dies, looks away, or lets go of the use key before the bomb is set. That is in the global/obj_dm.scr script, btw.
Tom Trude,

Image
Post Reply