driver2 Posted October 12, 2009 Share Posted October 12, 2009 Hi, I would like to know how the units in MTA translate to units like meters? I found some information about GTA units, however I couldn't find information about what MTA uses. It probably uses the same as GTA, but it would still be nice if someone could make a definite statement about that. Also, being somewhat related, how does the value from getElementVelocity() translate to something like kph or mph? Thanks for your help. Greetings Link to comment
Gamesnert Posted October 12, 2009 Share Posted October 12, 2009 Yes, MTA uses the same coordinates. (1 unit == 1 meter) Converting it to km/h or mph can be done by a calculation used in most speedometers on https://community.multitheftauto.com/. For as far as I can remember, it was not that complicated. Link to comment
AcidbRain Posted October 13, 2009 Share Posted October 13, 2009 Taking an example from the getplayerspeed resource: if (mode == "MPH" or mode == 1) then return math.floor(getDistanceBetweenPoints3D(0,0,0,getElementVelocity(vehicle)) * 100) end if (mode == "KMH" or mode == 2) then return math.floor(getDistanceBetweenPoints3D(0,0,0,getElementVelocity(vehicle)) * 100 * 1.61) end This code assumes that the output of the getElementVelocity function is in miles per hour (or more precisely, in hundred miles per hour). Why should the function output in mph while the unit system is metric, is a question left to the games developers. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now