Post your scripting questions / solutions here
Moderator: Moderators
Elgan
Site Admin
Posts: 890 Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:
Post
by Elgan » Fri May 28, 2004 7:58 pm
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
tltrude
Chuck Norris
Posts: 4774 Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:
Post
by tltrude » Fri May 28, 2004 11:48 pm
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,
Elgan
Site Admin
Posts: 890 Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:
Post
by Elgan » Fri May 28, 2004 11:57 pm
it doesnt work:(, for now ill use use+fire to bail out:)
the question still remains though;)
tltrude
Chuck Norris
Posts: 4774 Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:
Post
by tltrude » Sat May 29, 2004 12:14 am
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,