Changing mph to kmh
#1

Hello im using GTA RP edit and i want to change mph into kmh but then i'll get one little minor thing that looks weird.. As most peoples knows the max speed of 80 km/h isnt really high, but how do i edit it to be correct..
This is how it looks alike:

Код:
						if(gSpeedo[i] == 2)
						{
							if(distance <10)
							{
								format(string, 256, "~n~~n~~n~~n~~n~~n~~n~~g~mph :  ~w~%.0f",distance);
							}
							if(distance > 10 && distance < 100)
							{
								format(string, 256, "~n~~n~~n~~n~~n~~n~~n~~g~mph : ~w~%.0f",distance);
							}
							if(distance > 100)
							{
								format(string, 256, "~n~~n~~n~~n~~n~~n~~n~~g~mph : ~w~%.0f",distance);
							}
							GameTextForPlayer(i, string, 2000, 5);
						}
						if(distance > maxspeed && PlayerInfo[i][pAdmin] < 1)
						{
							new tmpcar = GetPlayerVehicleID(i);
							if(!IsAPlane(tmpcar))
							{
								GetPlayerName(i, plname, sizeof(plname));
								format(string, 256, "[ADMIN] [%d]%s %.0f mph",i,plname,distance);
								ABroadCast(COLOR_YELLOW,string,1);
							}
						}
					}
				}
Reply
#2

Show the part where you have distance = ... or something like that.
Reply
#3

public StoppedVehicle()
{
new Float,Float:y,Float:z;
new Float:distance,value;
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInAnyVehicle(i))
{
new VID;
VID = GetPlayerVehicleID(i);
GetPlayerPos(i, x, y, z);
distance = floatsqroot(floatpower(floatabs(floatsub(x,SavePla yerPos[i][LastX])),2)+floatpower(floatabs(floatsub(y,SavePlayerPos[i][LastY])),2)+floatpower(floatabs(floatsub(z,SavePlayerPos[i][LastZ])),2));
value = floatround(distance * 3600);
if(UpdateSeconds > 1)
{
value = floatround(value / UpdateSeconds);
}
if(SpeedMode)
{
}
if(value == 0)
{
Gas[VID]++;
}
SavePlayerPos[i][LastX] = x;
SavePlayerPos[i][LastY] = y;
SavePlayerPos[i][LastZ] = z;
}
}
}
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)