AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   measure jumping distance, possible?? (https://forums.alliedmods.net/showthread.php?t=10288)

CheChin 02-14-2005 04:00

measure jumping distance, possible??
 
I'm trying to figure out a way to do just this.
I figured it would be possible to use the jumping button to mark the start point, but have yet to figure out a way to detect the landing. If there aren't any modules that support this yet, how hard would it be to make one? There must be some sort of variable in CS that changes. I mean, sound does only play when you're on the ground, so... Hmm.. Anyone???

TotalNoobScripter 02-14-2005 11:10

you might be able to register the +jump command, get a users orgin, then somehow hook it to see if a player is on the ground, get the origin, and compare distances... but I do not know how to hook it when someone lands. I think it has somethign with like FL_ONGROUND ?

Geesu 02-14-2005 13:08

you could hook the pfn function, vexds I think? It's in engine now. It's the function where 2 models touch each other, and you could see when the player model touches the ground.

TotalNoobScripter 02-14-2005 14:28

what if the ground is nto an entitiy?

XxAvalanchexX 02-14-2005 22:59

The world is entity 0. Anything else you could land on would be some other type of entity. It will generate a pfn_touch.

Twilight Suzuka 02-16-2005 11:02

better yet, use register_touch for a player, and *. When they jump, catch using pre_think, it registers HL time (get_hltime() ), and then when they laand, by the touch, it compares the two, makes sure it isnt like a frame (which means you simply havent jumped yet), and then marks the spot with a simple glowing entity, or better yet, effect.

And then it gets the distance between those points (which yo'd store), and outpu thow far you jumped.

Simple really.

TotalNoobScripter 02-16-2005 18:41

an example would be?


All times are GMT -4. The time now is 19:20.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.