Speeds and distances
#1

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:
Код:
distance = floatsqroot ((oldposX - newposX) * (oldposX - newposX) + (oldposY - newposY) * (oldposY - newposY) + (oldposZ - newposZ) * (oldposZ - newposZ)
Is it in yards, metres or something?

Thanks!
Reply
#2

Its done in meters, i guess "GetPlayerVelocity" gives meters per second I'm not sure though.
Reply
#3

GetPlayerVelocity returns x, y and z which need to be put in some formula to get the speed. I'm not sure if I'm using the right formula for that. Any suggestions?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)