Tacho Problem, updatet nicht (Zustand)

  • Tacho Problem, updatet nicht (Zustand)

    Hey,
    ich habe ein Problem mit meinem Tacho, und zwar zeigt er nur 1.00, obwohl es ja 100.00 sein muss. (Zustand). Außerdem updatet er nicht.
    Hier der Code:
    [pwn]forward UpdateTacho();
    #define TACHOTIMER 1000
    public UpdateTacho()
    {
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
    {
    new Float:Entfernung, Float:Geschwindigkeit, veh, Float:health;
    GetVehiclePos(GetPlayerVehicleID(i), X1, Y1[i], Z1[i]);
    veh = GetPlayerVehicleID(i);
    health = GetVehicleHealth(veh,health);
    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/1000)) * 3.6;
    new Tachostring[256];
    format(Tachostring, sizeof(Tachostring), "Geschw.: %d Km/h~n~Zustand: %.2f~n~Fahrzeug: %s", floatround(Geschwindigkeit),health,Fahrzeugname[GetVehicleModel(GetPlayerVehicleID(i))-400]);
    TextDrawSetString(Tacho[i], Tachostring);
    GetVehiclePos(GetPlayerVehicleID(i), X2[i], Y2[i], Z2[i]);
    TextDrawShowForPlayer(i, Tacho[i]);
    }
    else
    {
    TextDrawHideForPlayer(i, Tacho[i]);
    }
    }
    return 1;
    }[/pwn]

    Was ist daran falsch?

    Mfg Maksimo007