Speedometer issue
#1

Uh, I join the server and enter a vehicle, everything is working fine, the speedo is working fine, for others that come it is not working, just showing 000(the default textdraw).


Код:
forward Speedometer(playerid);
public Speedometer(playerid)
{
	new vehicleid,Float:speed_x,Float:speed_y,Float:speed_z,Float:final_speed,speed_string[256],final_speed_int;
	vehicleid = GetPlayerVehicleID(playerid);
	//new Float:vehicle_health,final_vehicle_health,health_string[256];
	if(vehicleid != 0)
	{
		GetVehicleVelocity(vehicleid,speed_x,speed_y,speed_z);
		final_speed = floatsqroot(((speed_x*speed_x)+(speed_y*speed_y))+(speed_z*speed_z))*250.666667; // 250.666667 = kmph  // 199,4166672= mph
		final_speed_int = floatround(final_speed,floatround_round);
		format(speed_string,256,"%i",final_speed_int);
		TextDrawSetString(speedo0[playerid], speed_string);
	}
	else
	{
		TextDrawSetString(speedo0[playerid], " ");
		TextDrawSetString(speedo1[playerid], " ");
	}
    return 1;
}
OnPlayerEnterVehicle
Код:
TextDrawShowForPlayer(playerid, speedo0[playerid]);
	TextDrawShowForPlayer(playerid, speedo1[playerid]);
	TextDrawShowForPlayer(playerid, speedo2[playerid]);
 	TextDrawShowForPlayer(playerid, speedo3[playerid]);
Why
Reply


Messages In This Thread
Speedometer issue - by AndreiWow - 02.01.2017, 19:55
Re: Speedometer issue - by Freaksken - 02.01.2017, 21:26
Re: Speedometer issue - by AndreiWow - 03.01.2017, 01:39
Re: Speedometer issue - by KillerStrike23 - 03.01.2017, 02:41
Respuesta: Speedometer issue - by Whillyrez - 03.01.2017, 03:20
Re: Speedometer issue - by Freaksken - 03.01.2017, 04:41
Re: Speedometer issue - by AndreiWow - 03.01.2017, 08:06
Re: Speedometer issue - by Banditul18 - 03.01.2017, 09:01
Re: Speedometer issue - by Sew_Sumi - 03.01.2017, 09:46
Re: Speedometer issue - by AndreiWow - 03.01.2017, 10:27

Forum Jump:


Users browsing this thread: 1 Guest(s)