Der Tacho geht nicht weiter als 11 KMH egal wie schnell ich fahre
public TachoTimer()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
{
new Float:Entfernung, Float:Geschwindigkeit;
GetVehiclePos(GetPlayerVehicleID(i), X1[i], Y1[i], Z1[i]);
Entfernung = floatsqroot(floatpower(floatabs(floatsub(X1[i], X2[i])), 2)+floatpower(floatabs(floatsub(Y1[i], Y2[i])), 2)+floatpower(floatabs(floatsub(Z1[i], Z2[i])), 2));
Geschwindigkeit = (Entfernung / (TACHOTIMER/250)) * 0.9;
new Tachostring[20];
format(Tachostring, sizeof(Tachostring), "Km/h: %d", floatround(Geschwindigkeit));
TextDrawSetString(Tacho[i], Tachostring);
GetVehiclePos(GetPlayerVehicleID(i), X2[i], Y2[i], Z2[i]);
TextDrawShowForPlayer(i, Tacho[i]);
}
else
{
TextDrawHideForPlayer(i, Tacho[i]);
}
}
return 1;
}
SetTimer("TachoTimer",TACHOTIMER,1);
Tacho[i] = TextDrawCreate(300, 370, "Km/h:---");
#define TACHOTIMER 250