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??? |
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 ?
|
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.
|
what if the ground is nto an entitiy?
|
The world is entity 0. Anything else you could land on would be some other type of entity. It will generate a pfn_touch.
|
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. |
an example would be?
|
| All times are GMT -4. The time now is 19:20. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.