stock ErmittleGeschwindigkeit(playerid,bool:kmhb) {
new Float:x,Float:y,Float:z,Float:rtn;
if(IsPlayerInAnyVehicle(playerid)) GetVehicleVelocity(GetPlayerVehicleID(playerid),x,y,z); else GetPlayerVelocity(playerid,x,y,z);
rtn = floatsqroot(x*x+y*y+z*z);
return kmhb?floatround(rtn * 55 * 1.61):floatround(rtn * 100);
Ich bin mir nicht sicher ob das da festgelegt ist, wann sich der Tacho aktualisiert, ansonsten hätte ich noch das:
{
if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i) && !IsANoTachoVehicle(GetPlayerVehicleID(i)))
{
GetPlayerPos(i, Speedo_X, Speedo_Y, Speedo_Z);
GetPlayerVehicleID(i);
GetVehicleHealth(GetPlayerVehicleID(i), Speedo_HP);
new str1[256],str2[256],str3[256],str4[256];
if(SpeedoON[i] == 0)
{
TextDrawShowForPlayer(i, box[i]); TextDrawShowForPlayer(i, fahrzeug[i]); TextDrawShowForPlayer(i, kmh[i]);
TextDrawShowForPlayer(i, hoehe[i]); TextDrawShowForPlayer(i, zustand[i]);
SpeedoON[i] = 1;
}
new Float:speed_x,Float:speed_y,Float:speed_z,Float:final_speed,final_speed_int;
new veh = GetPlayerVehicleID(i);
GetVehicleVelocity(veh, speed_x, speed_y, speed_z);
final_speed = floatsqroot(((speed_x*speed_x)+(speed_y*speed_y))+(speed_z*speed_z))*120.0; // 136.666667 = kmph // 85.4166672= mph
final_speed_int = floatround(final_speed,floatround_round);
new kmh_anzahl = final_speed_int;
Was müsste ich ändern, damit er sich öfter aktualisiert?
VIELEN DANK FÜR EURE HILFE!