Tacho zeig nicht an

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • Hall,
    mein tacho zeigt nicht an wenn ich in ein Fahrzeug steigge kann einer helfen?



    Hier der script:



    public Speedometer()
    {
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
    {
    if(ShowSpeed[i] == 1)
    {
    #define MULTIPLY_SPEED 4
    new Float:x, Float:y, Float:z, Float:Dis, Float:health, string[256];TextDrawDestroy(black[i]); TextDrawDestroy(Speedom[i]);
    GetPlayerPos(i, x, y, z); GetVehicleHealth(GetPlayerVehicleID(i), health); GetPlayerVehicleID(i);
    new VehicleModel = GetVehicleModel(GetPlayerVehicleID(i));
    Dis = floatsqroot(floatpower(floatabs(floatsub(OldCoordsX[i],x)),2) + floatpower(floatabs(floatsub(OldCoordsY[i],y)),2));


    if(VehicleModel==509||VehicleModel==481||VehicleModel==510) {SetVehicleHealth(GetPlayerVehicleID(i), 1000); }
    if(VehicleModel==520||VehicleModel==476||VehicleModel==593||VehicleModel==553||VehicleModel==513||VehicleModel==512||VehicleModel==577||VehicleModel==592||VehicleModel==511||VehicleModel==539||VehicleModel==464||VehicleModel==519)
    {
    new speed = (floatround(Dis)*MULTIPLY_SPEED);


    if( speed == 0 ){
    format(string,sizeof(string),"~B~Vehicle:~n~~w~%s~n~~B~Speed: ~W~%.1f~n~~B~Health: ~W~%.0f%",VehiclesName[GetVehicleModel(GetPlayerVehicleID(i))-400],speed,health/10);
    } else if( speed >= 1 && speed <= 60 ){
    format(string,sizeof(string),"~B~Vehicle:~n~~w~%s~n~~B~Speed: ~W~%.1f~n~~B~Health: ~W~%.0f%",VehiclesName[GetVehicleModel(GetPlayerVehicleID(i))-400],speed,health/10);
    } else if( speed >= 61 && speed <= 120 ){
    format(string,sizeof(string),"~B~Vehicle:~n~~w~%s~n~~B~Speed: ~W~%.1f~n~~B~Health: ~W~%.0f%",VehiclesName[GetVehicleModel(GetPlayerVehicleID(i))-400],speed,health/10);
    } else {
    format(string,sizeof(string),"~B~Vehicle:~n~~w~%s~n~~B~Speed: ~W~%.1f~n~~B~Health: ~W~%.0f%",VehiclesName[GetVehicleModel(GetPlayerVehicleID(i))-400],speed,health/10);
    }


    black[i] = TextDrawCreate(504.000000,379.000000,"_");
    TextDrawUseBox(black[i],1);
    TextDrawBoxColor(black[i],0x00000085);
    TextDrawTextSize(black[i],621.000000,0.000000);
    TextDrawAlignment(black[i],0);
    TextDrawBackgroundColor(black[i],0x000000FF);
    TextDrawFont(black[i],2);
    TextDrawLetterSize(black[i],1.700000,5.250000);
    TextDrawColor(black[i],0xFFFFFFFF);
    TextDrawSetOutline(black[i],1);
    TextDrawSetProportional(black[i],1);
    TextDrawSetShadow(black[i],1);


    Speedom[i] = TextDrawCreate(505.000000,380.000000,string);
    TextDrawUseBox(Speedom[i],1);
    TextDrawBoxColor(Speedom[i],0xFFFFFF85);
    TextDrawTextSize(Speedom[i],620.000000,0.000000);
    TextDrawAlignment(Speedom[i],0);
    TextDrawBackgroundColor(Speedom[i],0x000000FF);
    TextDrawFont(Speedom[i],2);
    TextDrawLetterSize(Speedom[i],0.299999,1.000000);
    TextDrawColor(Speedom[i],0xFFFFFFFF);
    TextDrawSetOutline(Speedom[i],1);
    TextDrawSetProportional(Speedom[i],1);
    TextDrawSetShadow(Speedom[i],1);


    TextDrawShowForPlayer(i, black[i]);
    TextDrawShowForPlayer(i, Speedom[i]);
    OldCoordsX[i] = x; OldCoordsY[i] = y;
    } else { TextDrawDestroy(black[i]); TextDrawDestroy(Speedom[i]); }
    }
    }
    }
    return true;
    }


    Muss irgend wo irgend was bestimmtes hin damit es angezeigt wird???


    Bitte um hilfe


    Danke

    < Beatboxen ist leicht > Beatboxen & Singen/Rappen ist schwerer >

  • Bei:
    OnPlayerStateChance
    bzw. nen timer laufen lassen
    :
    Speedometer();

  • Hab das hier bei OnGameModeInit stehen



    for(new Vehicles = 0; Vehicles < MAX_VEHICLES; Vehicles++)
    {


    //Engine[Vehicles] = 0; or Engine[Vehicles] = random(1);
    }
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    ShowSpeed[i] = 1;
    }
    SetTimer("Speedometer", 1000, true);


    Danke um diene hilfe

    < Beatboxen ist leicht > Beatboxen & Singen/Rappen ist schwerer >