16.09.2011, 13:01
So lately I've been working a lot with distances, and speeds in SAMP, but I never manage to get the precise speed and distance travelled. I tried using GetTickCount () and few physics formulas for getting the speed and/or distance, but it never matches.
So what I want to ask is. How do I use the x, y and z velocity from GetVehicleVelocity? What's the formula to get "real life" speed, doesn't matter in which units.
Also, distance. Which units do I get that number in. Formula I (and everyone else) is:
Is it in yards, metres or something?
Thanks!
So what I want to ask is. How do I use the x, y and z velocity from GetVehicleVelocity? What's the formula to get "real life" speed, doesn't matter in which units.
Also, distance. Which units do I get that number in. Formula I (and everyone else) is:
Код:
distance = floatsqroot ((oldposX - newposX) * (oldposX - newposX) + (oldposY - newposY) * (oldposY - newposY) + (oldposZ - newposZ) * (oldposZ - newposZ)
Thanks!