Tacho zeigt Textdraw Geschwindigkeit und Zustand nicht an wieso?

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
  • new Text:Tacho[7];
    new Text:PlayerTacho[MAX_PLAYERS][5];
    new PlayerTachoShowed[MAX_PLAYERS];


    Tacho[0] = TextDrawCreate(470.000000, 382.000000, "Zustand:");
    TextDrawBackgroundColor(Tacho[0], 255);
    TextDrawFont(Tacho[0], 2);
    TextDrawLetterSize(Tacho[0],0.209999, 1.100000);
    TextDrawColor(Tacho[0], -1);
    TextDrawSetOutline(Tacho[0], 0);
    TextDrawSetProportional(Tacho[0], 1);
    TextDrawSetShadow(Tacho[0], 1);

    Tacho[1] = TextDrawCreate(469.000000, 360.000000, "Geschwindigkeit:");
    TextDrawBackgroundColor(Tacho[1], 255);
    TextDrawFont(Tacho[1], 2);
    TextDrawLetterSize(Tacho[1], 0.209999, 1.100000);
    TextDrawColor(Tacho[1], -1);
    TextDrawSetOutline(Tacho[1], 0);
    TextDrawSetProportional(Tacho[1], 1);
    TextDrawSetShadow(Tacho[1], 1);

    Tacho[2] = TextDrawCreate(470.000000, 371.000000, "Tank:");
    TextDrawBackgroundColor(Tacho[2], 255);
    TextDrawFont(Tacho[2], 1);
    TextDrawLetterSize(Tacho[2], 0.209999, 1.100000);
    TextDrawColor(Tacho[2], -1);
    TextDrawSetOutline(Tacho[2], 0);
    TextDrawSetProportional(Tacho[2], 1);
    TextDrawSetShadow(Tacho[2], 1);
    TextDrawSetSelectable(Tacho[2], 0);

    Tacho[3] = TextDrawCreate(469.000000, 348.000000, "Besitzer:");
    TextDrawBackgroundColor(Tacho[3], 255);
    TextDrawFont(Tacho[3], 1);
    TextDrawLetterSize(Tacho[3], 0.209999, 1.100000);
    TextDrawColor(Tacho[3], -1);
    TextDrawSetOutline(Tacho[3], 0);
    TextDrawSetProportional(Tacho[3], 1);
    TextDrawSetShadow(Tacho[3], 1);
    TextDrawSetSelectable(Tacho[3], 0);


    Tacho[6] = TextDrawCreate(470.000000, 393.000000, "Fahrzeug:");
    TextDrawBackgroundColor(Tacho[6], 255);
    TextDrawFont(Tacho[6], 1);
    TextDrawLetterSize(Tacho[6], 0.209999, 1.100000);
    TextDrawColor(Tacho[6], -1);
    TextDrawSetOutline(Tacho[6], 0);
    TextDrawSetProportional(Tacho[6], 1);
    TextDrawSetShadow(Tacho[6], 1);
    TextDrawSetSelectable(Tacho[6], 0);


    Tacho[4] = TextDrawCreate(650.000000, 350.000000, "_");
    TextDrawBackgroundColor(Tacho[4], 255);
    TextDrawFont(Tacho[4], 1);
    TextDrawLetterSize(Tacho[4], 0.400000, 6.299999);
    TextDrawColor(Tacho[4], -1);
    TextDrawSetOutline(Tacho[4], 0);
    TextDrawSetProportional(Tacho[4], 1);
    TextDrawSetShadow(Tacho[4], 1);
    TextDrawUseBox(Tacho[4], 1);
    TextDrawBoxColor(Tacho[4], 255);
    TextDrawTextSize(Tacho[4], 462.000000, 30.000000);
    TextDrawSetSelectable(Tacho[4], 0);


    for(new t;t<sizeof(Tacho);t++)
    TextDrawShowForPlayer(playerid,Tacho[t]);
    new text[64];
    format(text,sizeof(text),"%s",AutoName[GetVehicleModel(Fahrzeug)-400]);
    /*PlayerTacho[playerid][0] = TextDrawCreate(175.000000, 393.000000,text);
    TextDrawBackgroundColor(PlayerTacho[playerid][0], 255);
    TextDrawFont(PlayerTacho[playerid][0], 2);
    TextDrawLetterSize(PlayerTacho[playerid][0], 0.240000, 1.100000);
    TextDrawColor(PlayerTacho[playerid][0], -1);
    TextDrawSetOutline(PlayerTacho[playerid][0], 0);
    TextDrawSetProportional(PlayerTacho[playerid][0], 1);
    TextDrawSetShadow(PlayerTacho[playerid][0], 1);
    TextDrawShowForPlayer(playerid,PlayerTacho[playerid][0]);*/

    PlayerTacho[playerid][0] = TextDrawCreate(508.000000, 394.000000,text);
    TextDrawBackgroundColor(PlayerTacho[playerid][0], 255);
    TextDrawFont(PlayerTacho[playerid][0], 1);
    TextDrawLetterSize(PlayerTacho[playerid][0], 0.239999, 1.100000);
    TextDrawColor(PlayerTacho[playerid][0], -1);
    TextDrawSetOutline(PlayerTacho[playerid][0], 0);
    TextDrawSetProportional(PlayerTacho[playerid][0], 1);
    TextDrawSetShadow(PlayerTacho[playerid][0], 1);
    TextDrawSetSelectable(PlayerTacho[playerid][0], 0);
    TextDrawShowForPlayer(playerid,PlayerTacho[playerid][0]);
    /*PlayerTacho[playerid][1] = TextDrawCreate(201.000000, 359.000000, "0 km/h");
    TextDrawBackgroundColor(PlayerTacho[playerid][1], 255);
    TextDrawFont(PlayerTacho[playerid][1], 2);
    TextDrawLetterSize(PlayerTacho[playerid][1], 0.240000, 1.100000);
    TextDrawColor(PlayerTacho[playerid][1], -1);
    TextDrawSetOutline(PlayerTacho[playerid][1], 0);
    TextDrawSetProportional(PlayerTacho[playerid][1], 1);
    TextDrawSetShadow(PlayerTacho[playerid][1], 1);
    TextDrawShowForPlayer(playerid,PlayerTacho[playerid][1]);*/

    PlayerTacho[playerid][1] = TextDrawCreate(531.000000, 360.000000, "0 km/h");
    TextDrawBackgroundColor(PlayerTacho[playerid][1], 255);
    TextDrawFont(PlayerTacho[playerid][1], 1);
    TextDrawLetterSize(PlayerTacho[playerid][1], 0.239999, 1.100000);
    TextDrawColor(PlayerTacho[playerid][1], -1);
    TextDrawSetOutline(PlayerTacho[playerid][1], 0);
    TextDrawSetProportional(PlayerTacho[playerid][1], 1);
    TextDrawSetShadow(PlayerTacho[playerid][1], 1);
    TextDrawSetSelectable(PlayerTacho[playerid][1], 0);
    TextDrawShowForPlayer(playerid,PlayerTacho[playerid][1]);



    if(MaxTank[GetVehicleModel(Fahrzeug)-400] != -255)
    format(text,sizeof(text),"%d / %d Liter",Tank[Fahrzeug],MaxTank[GetVehicleModel(Fahrzeug)-400]);
    else
    format(text,sizeof(text),"N/A Liter");
    /*PlayerTacho[playerid][2] = TextDrawCreate(163.000000, 370.000000,text);
    TextDrawBackgroundColor(PlayerTacho[playerid][2], 255);
    TextDrawFont(PlayerTacho[playerid][2], 2);
    TextDrawLetterSize(PlayerTacho[playerid][2], 0.240000, 1.100000);
    TextDrawColor(PlayerTacho[playerid][2], -1);
    TextDrawSetOutline(PlayerTacho[playerid][2], 0);
    TextDrawSetProportional(PlayerTacho[playerid][2], 1);
    TextDrawSetShadow(PlayerTacho[playerid][2], 1);
    TextDrawShowForPlayer(playerid,PlayerTacho[playerid][2]);*/

    PlayerTacho[playerid][2] = TextDrawCreate(493.000000, 371.000000,text);
    TextDrawBackgroundColor(PlayerTacho[playerid][2], 255);
    TextDrawFont(PlayerTacho[playerid][2], 1);
    TextDrawLetterSize(PlayerTacho[playerid][2], 0.239999, 1.100000);
    TextDrawColor(PlayerTacho[playerid][2], -1);
    TextDrawSetOutline(PlayerTacho[playerid][2], 0);
    TextDrawSetProportional(PlayerTacho[playerid][2], 1);
    TextDrawSetShadow(PlayerTacho[playerid][2], 1);
    TextDrawSetSelectable(PlayerTacho[playerid][2], 0);
    TextDrawShowForPlayer(playerid,PlayerTacho[playerid][2]);


    new Float:vHealth;
    GetVehicleHealth(Fahrzeug,vHealth);
    floatround(vHealth);
    format(text,sizeof(text),"%d%%",floatround(floatdiv(vHealth,10)));
    /*PlayerTacho[playerid][3] = TextDrawCreate(173.000000, 381.000000,text);
    TextDrawBackgroundColor(PlayerTacho[playerid][3], 255);
    TextDrawFont(PlayerTacho[playerid][3], 2);
    TextDrawLetterSize(PlayerTacho[playerid][3], 0.240000, 1.100000);
    TextDrawColor(PlayerTacho[playerid][3], -1);
    TextDrawSetOutline(PlayerTacho[playerid][3], 0);
    TextDrawSetProportional(PlayerTacho[playerid][3], 1);
    TextDrawSetShadow(PlayerTacho[playerid][3], 1);
    TextDrawShowForPlayer(playerid,PlayerTacho[playerid][3]);*/

    PlayerTacho[playerid][3] = TextDrawCreate(503.000000, 382.000000,text);
    TextDrawBackgroundColor(PlayerTacho[playerid][3], 255);
    TextDrawFont(PlayerTacho[playerid][3], 1);
    TextDrawLetterSize(PlayerTacho[playerid][3], 0.239999, 1.100000);
    TextDrawColor(PlayerTacho[playerid][3], -1);
    TextDrawSetOutline(PlayerTacho[playerid][3], 0);
    TextDrawSetProportional(PlayerTacho[playerid][3], 1);
    TextDrawSetShadow(PlayerTacho[playerid][3], 1);
    TextDrawSetSelectable(PlayerTacho[playerid][3], 0);
    TextDrawShowForPlayer(playerid,PlayerTacho[playerid][3]);


    /* ---- */
    new Owner[64];
    format(Owner,sizeof(Owner),"Staatsfahrzeug");
    for(new fc;fc<sizeof(FactionCars);fc++){
    if(FactionCars[fc][fVehid] >= 400 && FactionCars[fc][fVehid] <= 611 && !FactionCars[fc][fTowed]){
    if(Fahrzeug == FactionCars[fc][fCarid]){
    format(Owner,sizeof(Owner),Factions[FactionCars[fc][fFaction][0]]);
    break;
    }
    }
    }
    ForAllPlayers(i){
    if(IsPlayerConnected(i) && SpielerInfo[i][sEingeloggt]){
    for(new slot;slot<3;slot++){
    if(SpielerAuto[i][slot][saVehid] >= 400 && SpielerAuto[i][slot][saVehid] <= 611){
    if(Fahrzeug == SpielerAuto[i][slot][saCarid]){
    format(Owner,sizeof(Owner),SpielerInfo[i][sName]);
    break;
    }
    }
    }
    }
    }
    /* PlayerTacho[playerid][4] = TextDrawCreate(04.000000, 348.000000,Owner);
    TextDrawAlignment(PlayerTacho[playerid][4], 2);
    TextDrawBackgroundColor(PlayerTacho[playerid][4], 255);
    TextDrawFont(PlayerTacho[playerid][4], 2);
    TextDrawLetterSize(PlayerTacho[playerid][4], 0.239999, 1.100000);
    TextDrawColor(PlayerTacho[playerid][4], -1);
    TextDrawSetOutline(PlayerTacho[playerid][4], 1);
    TextDrawSetProportional(PlayerTacho[playerid][4], 1);
    TextDrawShowForPlayer(playerid,PlayerTacho[playerid][4]);*/

    PlayerTacho[playerid][4] = TextDrawCreate(504.000000, 348.000000,Owner);
    TextDrawBackgroundColor(PlayerTacho[playerid][4], 255);
    TextDrawFont(PlayerTacho[playerid][4], 1);
    TextDrawLetterSize(PlayerTacho[playerid][4], 0.239999, 1.100000);
    TextDrawColor(PlayerTacho[playerid][4], -1);
    TextDrawSetOutline(PlayerTacho[playerid][4], 0);
    TextDrawSetProportional(PlayerTacho[playerid][4], 1);
    TextDrawSetShadow(PlayerTacho[playerid][4], 1);
    TextDrawSetSelectable(PlayerTacho[playerid][4], 0);
    TextDrawShowForPlayer(playerid,PlayerTacho[playerid][4]);
    PlayerTachoShowed[playerid] = true;
    }
    else if(newstate != PLAYER_STATE_DRIVER && oldstate == PLAYER_STATE_DRIVER && PlayerTachoShowed[playerid])
    {
    PlayerTachoShowed[playerid] = false;
    TextDrawHideForPlayer(playerid,Tacho[5]);
    TextDrawHideForPlayer(playerid,Tacho[4]);
    TextDrawHideForPlayer(playerid,Tacho[0]);
    TextDrawHideForPlayer(playerid,Tacho[1]);
    TextDrawHideForPlayer(playerid,Tacho[2]);
    TextDrawHideForPlayer(playerid,Tacho[3]);
    TextDrawHideForPlayer(playerid,Tacho[6]);
    TextDrawDestroy(PlayerTacho[playerid][0]);
    TextDrawDestroy(PlayerTacho[playerid][1]);
    TextDrawDestroy(PlayerTacho[playerid][2]);
    TextDrawDestroy(PlayerTacho[playerid][3]);
    TextDrawDestroy(PlayerTacho[playerid][4]);


    SCREEN:

    Bitte um Hilfe warum wird Geschwindigkeit:
    Zustand:
    nicht angezeigt ..


    //EDIT: WENN ICH DAS TEXTDRAW GESCHWINDIGKEIT JEDOCH IRGENDWO OBEN IN DEN BILDSCHIRM SETZTE WIRD ES ANGEZEIGT
    //EDIT: Liegt es vil. daran das ich ein textdraw habe das schon über das bild geht wo das tacho ist auch wenn es nicht angezeigt ist
    oder sowas?


    Bild woanders geschwindigkeit:

    Bild woanders textdraw bereits an der stelle (aber eig übers ganze tacho :o)

    2 Mal editiert, zuletzt von Synchron ()

  • Dass die zwei Textdraws nicht angezeigt werden kann daran liegen, dass du die Box als letztes erstellst, sprich sie wird einfach auf die anderen drauf gesetzt, somit sind die nicht angezeigten Textdraws hinter der Box.
    Erstelle das Textdraw mit der Box als erstes, dann sollte es klappen.