SA-MP Forums Archive
From KM to M - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: From KM to M (/showthread.php?tid=507721)



From KM to M - Skibi184 - 18.04.2014

hi, i found this code but it tells mileage in KM. How to change it to M?

Код:
new Float:Milleage[MAX_VEHICLES];
Код:
new Float:ST[4], vehicleid;

vehicleid = GetPlayerVehicleID(playerid);
	
	GetVehicleVelocity(vehicleid,ST[0],ST[1],ST[2]);
	ST[3] = floatsqroot(floatpower(floatabs(ST[0]), 2.0) + floatpower(floatabs(ST[1]), 2.0) + floatpower(floatabs(ST[2]), 2.0)) * 179.28625;

	Milleage[vehicleid] += ST[3]/2000;



Re: From KM to M - StuartD - 18.04.2014

I'm guessing M means Miles?

If so, take your the kilometers of the vehicle. KM and times it by 0.62137, that will make it miles.

mi = km * 0.62137


Re: From KM to M - Skibi184 - 19.04.2014

Ops. said it wrong, I meant meters


Re: From KM to M - Skibi184 - 19.04.2014

From KM to Meters


Re: From KM to M - [ABK]Antonio - 19.04.2014

Not sure why you'd want to...but it's * 1000


Re: From KM to M - Skibi184 - 19.04.2014

[ABK]Antonio, thank you, I gave you some reputation for helping me