This speedometer displays player's speed in km/h and mph correctly only if the player is travelling along the x-axis, y-axis or z-axis. The display goes way off when player travels diagonally on the map. Can someone help me make the display more accurately when player isn't travelling along the axes?
------------------
"...and may the Force be with you."
-Luke Skywalker
Dark Luke, known for dressed like Vader (But no helmets and computer stuffs on), ignites his green lightsaber, ready to fight against evil and defend the light side.
Zone name: WD_Deedlit
Jedi vs. Sith - Dark Luke's Jedi Knight web site: Informations, addons, etc.
Code:
pulse: testspeedo = GetThingVel(player); vecx = VectorX(testspeedo); vecy = VectorY(testspeedo); vecz = VectorZ(testspeedo); if (vecx < 0) vecx = vecx - (vecx * 2); if (vecy < 0) vecy = vecy - (vecy * 2); if (vecz < 0) vecy = vecz - (vecz * 2); resul = (vecx + vecy + vecz) * 36; //resul = vectornorm(testspeed0); resul2 = resul * 0.62137; print(""); print(""); print(""); printvector(testspeedo); jkstringconcatint(resul); jkstringconcatasciistring(" km/h "); jkstringconcatint(resul2); jkstringconcatasciistring(" mph "); jkstringoutput(); jkstringclear(); return;
------------------
"...and may the Force be with you."
-Luke Skywalker
Dark Luke, known for dressed like Vader (But no helmets and computer stuffs on), ignites his green lightsaber, ready to fight against evil and defend the light side.
Zone name: WD_Deedlit
Jedi vs. Sith - Dark Luke's Jedi Knight web site: Informations, addons, etc.
(Draws his undead great sword out, and with a variety of magical spells, gets ready to fight.
Music composer (presented as Undead Knight and maker of JK SP projects - download soundtrack of Dark Emperor 2 here!
Jedi vs. Sith - Dark Luke's Jedi Knight web site: Informations, addons, etc.
Music composer (presented as Undead Knight and maker of JK SP projects - download soundtrack of Dark Emperor 2 here!
Jedi vs. Sith - Dark Luke's Jedi Knight web site: Informations, addons, etc.