Convert MPH to KM/H
#1

i would like to know how to convert that system to KM/H

Код:
stock Float:GetPlayerSpeed(playerid)
{
	static Float:velocity[3];

	if (IsPlayerInAnyVehicle(playerid))
	    GetVehicleVelocity(GetPlayerVehicleID(playerid), velocity[0], velocity[1], velocity[2]);
	else
	    GetPlayerVelocity(GetPlayerVehicleID(playerid), velocity[0], velocity[1], velocity[2]);

	return floatsqroot((velocity[0] * velocity[0]) + (velocity[1] * velocity[1]) + (velocity[2] * velocity[2])) * 100.0;
}
Reply
#2

1mph= 1.609344kph
It's enough to know how to solve this?
Reply
#3

Quote:
Originally Posted by Dayrion
Посмотреть сообщение
1mph= 1.609344kph
It's enough to know how to solve this?
i'm trying but i don't thing that enough rsrs i'm a begginer
Reply
#4

You would be able to do this conversion easily, if you went or if you're going to school obviously.

I have 100 apples and I want to convert these apples to bananas, a banana equals to 2 apples. So what do I do?
100 apples x 2 bananas = 200 bananas

I'm pretty sure you could do the conversion of what you want. Good luck!
Reply
#5

Quote:
Originally Posted by iWindows
Посмотреть сообщение
i'm trying but i don't thing that enough rsrs i'm a begginer
divide
Reply
#6

Could use this

PHP код:
GetPlayerSpeed(playeridbool:kmh false)
{
    new 
Float:VxFloat:VyFloat:VzFloat:rtn;
    if(
IsPlayerInAnyVehicle(playerid)) GetVehicleVelocity(GetPlayerVehicleID(playerid), VxVyVz); else GetPlayerVelocity(playeridVxVyVz);
    
rtn floatsqroot(floatabs(floatpower(Vx Vy Vz2)));
    return 
kmh floatround(rtn 100 1.61) : floatround(rtn 100);

set it to true to use kph
Reply
#7

How old are you? 7? cuz this is something an 8 y/o would be able to solve. god damn it this new generation can't do a simple multiply by 1.61 and they expect to somehow have their server succeed.
Seriously this was purely a ****** and a multiply away from you, and you decided to make a forum help topic about it, how lazy can you be.

And NO, you are not a beginner or a newbie or w/e, you are a useless guy who wants stuff to be spoon-fed to him, and refuses to search about his problem and try to solve it himself.
If you think I'm being rude or harsh, I don't give a flying duck, change your lifestyle, stop being a couch potato.
Reply
#8

stock Float:GetPlayerSpeed(playerid)
{
static Float:velocity[3];

if (IsPlayerInAnyVehicle(playerid))
GetVehicleVelocity(GetPlayerVehicleID(playerid), velocity[0], velocity[1], velocity[2]);
else
GetPlayerVelocity(GetPlayerVehicleID(playerid), velocity[0], velocity[1], velocity[2]);

return floatsqroot((velocity[0] * velocity[0]) + (velocity[1] * velocity[1]) + (velocity[2] * velocity[2])) * 100.0*1.609344;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)