[CS:GO] Calculate jump distance(long jump)
Is it possible to calculate the distance only starting from the red line (https://prnt.sc/tmv7qq), if someone is running in the white part and jumps before the red line only calculates the distance between the red line and land position, something like this: https://previews.123rf.com/images/ar...ustration-.jpg
|
Re: [CS:GO] Calculate jump distance(long jump)
|
Re: [CS:GO] Calculate jump distance(long jump)
Quote:
I don't know if i was clear, english isn't my first language and thank you for the response. |
Re: [CS:GO] Calculate jump distance(long jump)
You can calculate the trajectory and then trace it against a solid surface.
Here is a small explanation https://translate.google.com/transla...st%2F131931%2F Read the description below the image with jumping mario. Use TR_TraceRay to get an intersection point with a solid surface. The information you need is in these properties: m_angAbsRotation - player angle m_vecAbsOrigin - player position m_vecAbsVelocity - player velocity m_flGravity - gravity m_flFriction - friction GetGameTime() - engine time To get the jump moment hook PlayerRunCmd and check if IN_JUMP button is pressed. Alternatively you can use m_hGroundEntity property. It is only valid when player is on the ground. If the surface is curved, use TR_TraceHull, it will give a more precise result. And one more thing - players can change their trajectory while in the fly. To make sure it doesn't happen, return Plugin_Handle in PlayerRunCmd. |
All times are GMT -4. The time now is 20:58. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.