From KM to M
#1

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;
Reply
#2

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
Reply
#3

Ops. said it wrong, I meant meters
Reply
#4

From KM to Meters
Reply
#5

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)