Player walk distance
I have one good idea, and i need to get player walk distance, but how get it?
|
Re: Player walk distance
What do you mean player walk distance?
Distance from one origin to another? If so you can use get_distance for integers or get_distance_f for float. |
Re: Player walk distance
How often do you want to check for distance moved? Just create a constantly looping set_task or thinking entity, create a static variable that holds the origin from last call, global variable that holds the total walk distance and use get_distance_f. Something like this:
PHP Code:
|
Re: Player walk distance
I want to get it always when player is on ground. I don't know, but maybe should get with FwdPreFrame_Post ? Can you give me example?
|
Re: Player walk distance
I have no idea what FwdPreFrame_Post is, but just use the code I posted, it's enough for what you want to do. Think is called unnecessarily too often.
|
Re: Player walk distance
This will display distance walked and reset to 0 when the player either presses jump or is not on the ground for whatever reason (walks off ledge etc).
If this isn't what you want, it can be tweaked.
PHP Code:
|
Re: Player walk distance
Quote:
Look, with this code, i get distance when 1) Player walk with button W + SHITF 2) Player walk only with button W 3) Player walk when are SQUAT 4) Player walk when SQUAT + SHITF 5) Player swimming? If yes, so everything okay! But i have another question, when player surfing or use bhop still get distance? |
Re: Player walk distance
1) Player walk with button W + SHITF - Good
2) Player walk only with button W - Good 3) Player walk when are SQUAT - Good 4) Player walk when SQUAT + SHITF - Good 5) Player swimming? - I dont know, check to see if FL_ONGROUND is set when swimming. If so then good. If yes, so everything okay! But i have another question, when player surfing or use bhop still get distance? - Surfing idk, see response #5 above. bhop no because he is off the ground. |
| All times are GMT -4. The time now is 09:42. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.