Textdraw wird nicht angezeigt

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
  • Guten Tag,


    ich habe soeben ein "InfoTextdraw" erstellt was dem Spieler jegliche Infos anzeigen soll wie z.B. Bankguthaben, Uhrzeit etc..


    Nur leider funktioniert es nicht so wie ich das will.


    Hier meine Codes:


    //Statistikbox
    new PlayerText:statsbox3[MAX_PLAYERS];
    new PlayerText:statsbox4[MAX_PLAYERS];
    new PlayerText:statsbox5[MAX_PLAYERS];
    new PlayerText:statsbox6[MAX_PLAYERS];
    new PlayerText:statsbox7[MAX_PLAYERS];
    //new PlayerText:statsbox8[MAX_PLAYERS];
    new PlayerText:statsbox9[MAX_PLAYERS];
    new PlayerText:statsbox10[MAX_PLAYERS];
    new PlayerText:statsbox11[MAX_PLAYERS];
    new PlayerText:statsbox12[MAX_PLAYERS];
    new PlayerText:statsbox13[MAX_PLAYERS];
    new PlayerText:statsbox14[MAX_PLAYERS];



    OnPlayerConnect


    //Statistikbox Textdraw
    statsbox3[playerid] = CreatePlayerTextDraw(playerid,553.000000, 115.000000, "Heisenberg");
    PlayerTextDrawAlignment(playerid,statsbox3[playerid], 2);
    PlayerTextDrawBackgroundColor(playerid,statsbox3[playerid], 220);
    PlayerTextDrawFont(playerid,statsbox3[playerid], 1);
    PlayerTextDrawLetterSize(playerid,statsbox3[playerid], 0.230000, 1.199998);
    PlayerTextDrawColor(playerid,statsbox3[playerid], -1);
    PlayerTextDrawSetOutline(playerid,statsbox3[playerid], 1);
    PlayerTextDrawSetProportional(playerid,statsbox3[playerid], 1);
    PlayerTextDrawUseBox(playerid,statsbox3[playerid], 1);
    PlayerTextDrawBoxColor(playerid,statsbox3[playerid], -678555393);
    PlayerTextDrawTextSize(playerid,statsbox3[playerid], -67.000000, 108.000000);
    PlayerTextDrawSetSelectable(playerid,statsbox3[playerid], 0);


    statsbox4[playerid] = CreatePlayerTextDraw(playerid,610.000000, 129.000000, "~n~~n~~n~~n~~n~~n~~n~~n~");
    PlayerTextDrawBackgroundColor(playerid,statsbox4[playerid], 255);
    PlayerTextDrawFont(playerid,statsbox4[playerid], 1);
    PlayerTextDrawLetterSize(playerid,statsbox4[playerid], 1.139999, 0.699998);
    PlayerTextDrawColor(playerid,statsbox4[playerid], 200);
    PlayerTextDrawSetOutline(playerid,statsbox4[playerid], 0);
    PlayerTextDrawSetProportional(playerid,statsbox4[playerid], 1);
    PlayerTextDrawSetShadow(playerid,statsbox4[playerid], 1);
    PlayerTextDrawUseBox(playerid,statsbox4[playerid], 1);
    PlayerTextDrawBoxColor(playerid,statsbox4[playerid], 150);
    PlayerTextDrawTextSize(playerid,statsbox4[playerid], 496.000000, 16.000000);
    PlayerTextDrawSetSelectable(playerid,statsbox4[playerid], 0);


    statsbox5[playerid] = CreatePlayerTextDraw(playerid,502.000000, 129.000000, "~r~Datum:");
    PlayerTextDrawBackgroundColor(playerid,statsbox5[playerid], 255);
    PlayerTextDrawFont(playerid,statsbox5[playerid], 1);
    PlayerTextDrawLetterSize(playerid,statsbox5[playerid], 0.179997, 1.099997);
    PlayerTextDrawColor(playerid,statsbox5[playerid], -1);
    PlayerTextDrawSetOutline(playerid,statsbox5[playerid], 0);
    PlayerTextDrawSetProportional(playerid,statsbox5[playerid], 1);
    PlayerTextDrawSetShadow(playerid,statsbox5[playerid], 1);
    PlayerTextDrawSetSelectable(playerid,statsbox5[playerid], 0);


    statsbox6[playerid] = CreatePlayerTextDraw(playerid,562.000000, 129.000000, "30.06.2015");
    PlayerTextDrawBackgroundColor(playerid,statsbox6[playerid], 255);
    PlayerTextDrawFont(playerid,statsbox6[playerid], 1);
    PlayerTextDrawLetterSize(playerid,statsbox6[playerid], 0.179997, 1.099997);
    PlayerTextDrawColor(playerid,statsbox6[playerid], -1);
    PlayerTextDrawSetOutline(playerid,statsbox6[playerid], 0);
    PlayerTextDrawSetProportional(playerid,statsbox6[playerid], 1);
    PlayerTextDrawSetShadow(playerid,statsbox6[playerid], 1);
    PlayerTextDrawSetSelectable(playerid,statsbox6[playerid], 0);


    Time = TextDrawCreate(562.000000, 139.000000, "~r~22:35:32");
    TextDrawBackgroundColor(Time, 255);
    TextDrawFont(Time, 1);
    TextDrawLetterSize(Time, 0.179997, 1.099997);
    TextDrawColor(Time, -1);
    TextDrawSetOutline(Time, 0);
    TextDrawSetProportional(Time, 1);
    TextDrawSetShadow(Time, 1);
    TextDrawSetSelectable(Time, 0);


    statsbox7[playerid] = CreatePlayerTextDraw(playerid,502.000000, 139.000000, "~r~Uhrzeit:");
    PlayerTextDrawBackgroundColor(playerid,statsbox7[playerid], 255);
    PlayerTextDrawFont(playerid,statsbox7[playerid], 1);
    PlayerTextDrawLetterSize(playerid,statsbox7[playerid], 0.179997, 1.099997);
    PlayerTextDrawColor(playerid,statsbox7[playerid], -1);
    PlayerTextDrawSetOutline(playerid,statsbox7[playerid], 0);
    PlayerTextDrawSetProportional(playerid,statsbox7[playerid], 1);
    PlayerTextDrawSetShadow(playerid,statsbox7[playerid], 1);
    PlayerTextDrawSetSelectable(playerid,statsbox7[playerid], 0);


    statsbox9[playerid] = CreatePlayerTextDraw(playerid,503.000000, 149.000000, "~y~Payday vor");
    PlayerTextDrawBackgroundColor(playerid,statsbox9[playerid], 255);
    PlayerTextDrawFont(playerid,statsbox9[playerid], 1);
    PlayerTextDrawLetterSize(playerid,statsbox9[playerid], 0.179997, 1.099997);
    PlayerTextDrawColor(playerid,statsbox9[playerid], -1);
    PlayerTextDrawSetOutline(playerid,statsbox9[playerid], 0);
    PlayerTextDrawSetProportional(playerid,statsbox9[playerid], 1);
    PlayerTextDrawSetShadow(playerid,statsbox9[playerid], 1);
    PlayerTextDrawSetSelectable(playerid,statsbox9[playerid], 0);


    statsbox10[playerid] = CreatePlayerTextDraw(playerid,562.000000, 149.000000, "~r~ 45~w~ Minuten");
    PlayerTextDrawBackgroundColor(playerid,statsbox10[playerid], 255);
    PlayerTextDrawFont(playerid,statsbox10[playerid], 1);
    PlayerTextDrawLetterSize(playerid,statsbox10[playerid], 0.179997, 1.099997);
    PlayerTextDrawColor(playerid,statsbox10[playerid], -1);
    PlayerTextDrawSetOutline(playerid,statsbox10[playerid], 0);
    PlayerTextDrawSetProportional(playerid,statsbox10[playerid], 1);
    PlayerTextDrawSetShadow(playerid,statsbox10[playerid], 1);
    PlayerTextDrawSetSelectable(playerid,statsbox10[playerid], 0);


    statsbox11[playerid] = CreatePlayerTextDraw(playerid,503.000000, 159.000000, "~y~Gehalt am Payday");
    PlayerTextDrawBackgroundColor(playerid,statsbox11[playerid], 255);
    PlayerTextDrawFont(playerid,statsbox11[playerid], 1);
    PlayerTextDrawLetterSize(playerid,statsbox11[playerid], 0.179997, 1.099997);
    PlayerTextDrawColor(playerid,statsbox11[playerid], -1);
    PlayerTextDrawSetOutline(playerid,statsbox11[playerid], 0);
    PlayerTextDrawSetProportional(playerid,statsbox11[playerid], 1);
    PlayerTextDrawSetShadow(playerid,statsbox11[playerid], 1);
    PlayerTextDrawSetSelectable(playerid,statsbox11[playerid], 0);


    statsbox12[playerid] = CreatePlayerTextDraw(playerid,562.000000, 159.000000, "~r~20.999~w~$");
    PlayerTextDrawBackgroundColor(playerid,statsbox12[playerid], 255);
    PlayerTextDrawFont(playerid,statsbox12[playerid], 1);
    PlayerTextDrawLetterSize(playerid,statsbox12[playerid], 0.179997, 1.099997);
    PlayerTextDrawColor(playerid,statsbox12[playerid], -1);
    PlayerTextDrawSetOutline(playerid,statsbox12[playerid], 0);
    PlayerTextDrawSetProportional(playerid,statsbox12[playerid], 1);
    PlayerTextDrawSetShadow(playerid,statsbox12[playerid], 1);
    PlayerTextDrawSetSelectable(playerid,statsbox12[playerid], 0);


    statsbox13[playerid] = CreatePlayerTextDraw(playerid,503.000000, 169.000000, "~b~Bankkonto:");
    PlayerTextDrawBackgroundColor(playerid,statsbox13[playerid], 255);
    PlayerTextDrawFont(playerid,statsbox13[playerid], 1);
    PlayerTextDrawLetterSize(playerid,statsbox13[playerid], 0.179997, 1.099997);
    PlayerTextDrawColor(playerid,statsbox13[playerid], -1);
    PlayerTextDrawSetOutline(playerid,statsbox13[playerid], 0);
    PlayerTextDrawSetProportional(playerid,statsbox13[playerid], 1);
    PlayerTextDrawSetShadow(playerid,statsbox13[playerid], 1);
    PlayerTextDrawSetSelectable(playerid,statsbox13[playerid], 0);


    statsbox14[playerid] = CreatePlayerTextDraw(playerid,562.000000, 169.000000, "~r~20.000.000~w~$");
    PlayerTextDrawBackgroundColor(playerid,statsbox14[playerid], 255);
    PlayerTextDrawFont(playerid,statsbox14[playerid], 1);
    PlayerTextDrawLetterSize(playerid,statsbox14[playerid], 0.179997, 1.099997);
    PlayerTextDrawColor(playerid,statsbox14[playerid], -1);
    PlayerTextDrawSetOutline(playerid,statsbox14[playerid], 0);
    PlayerTextDrawSetProportional(playerid,statsbox14[playerid], 1);
    PlayerTextDrawSetShadow(playerid,statsbox14[playerid], 1);
    PlayerTextDrawSetSelectable(playerid,statsbox14[playerid], 0);



    stock LoadStatistik(playerid)
    {
    PlayerTextDrawShow(playerid,statsbox3[playerid]);
    PlayerTextDrawShow(playerid,statsbox4[playerid]);
    PlayerTextDrawShow(playerid,statsbox5[playerid]);
    PlayerTextDrawShow(playerid,statsbox6[playerid]);
    PlayerTextDrawShow(playerid,statsbox7[playerid]);
    // PlayerTextDrawShow(playerid,statsbox8[playerid]);
    PlayerTextDrawShow(playerid,statsbox9[playerid]);
    PlayerTextDrawShow(playerid,statsbox10[playerid]);
    PlayerTextDrawShow(playerid,statsbox11[playerid]);
    PlayerTextDrawShow(playerid,statsbox12[playerid]);
    PlayerTextDrawShow(playerid,statsbox13[playerid]);
    PlayerTextDrawShow(playerid,statsbox14[playerid]);
    //Payday in Minuten
    new paydayin[50];
    format(paydayin,sizeof(paydayin),"~r~%d~w~ Minuten",SpielerInfo[playerid][sPayDay]);
    PlayerTextDrawSetString(playerid, statsbox10[playerid], paydayin);
    //Geld auf der Bank
    new bankg[50];
    format(bankg,sizeof(bankg),"~r~%d~w~$",SpielerInfo[playerid][sBankkonto]);
    PlayerTextDrawSetString(playerid, statsbox14[playerid], bankg);
    //Datum Anzeige
    new Datums[50];
    getdate(Year, Month, Day);
    format(Datums,sizeof(Datums),"%d/%02d/%02d",Day,Month,Year);
    PlayerTextDrawSetString(playerid, statsbox6[playerid], Datums);
    //Geld am Payday
    new PaydayL[50];
    format(PaydayL,sizeof(PaydayL),"~r~%d~w~$",SpielerInfo[playerid][sPayDayGeld]);
    PlayerTextDrawSetString(playerid, statsbox12[playerid], PaydayL);
    //Der Name
    new namee[50];
    format(namee,sizeof(namee),"%s",SpielerInfo[playerid][sName]);
    PlayerTextDrawSetString(playerid, statsbox3[playerid], namee);
    return 1;
    }


    Das zwanzigste was mir anzeigt wird in die Uhrzeit.


    MfG ^^


    //EDIT, Fehler behoben
    //EDIT, zu Quellencode gewechselt

  • erledigt
    Tut, mir leid.. Aber bei der Formatierung wird glaube ich niemand wirklich helfen können.
    Bitte formatiere den Pawn Code nochmal richtig, hier siehst du wie mans richtig macht: Der Pawn BB Code - Die richtige Anwendung


    Hast du mal ausprobiert ob der stock überhaupt aufgerufen wird ? Bzw., ob du ihn überhaupt aufrufst ?


    Und wieso erstellst du einen Globalen Textdraw unter OnplayerConnect ? Da wird der Textdraw doch überschrieben, OnGameModeInit wäre in dem fall sinvoller. (Ich rede vom Textdraw Time)

    3 Mal editiert, zuletzt von Red_Romeo ()

  • Das beantwortet diese Frage immer noch nicht.

    Hast du mal ausprobiert ob der stock überhaupt aufgerufen wird ?


    Dies wäre eine Prima Methode zu überprüfen ob der stock aufgerufen wird:
    printf("LoadStatistik(%d) wurde aufgerufen!", playerid);


    Und jetzt könnte ich emfalls fragen: Wird das Public überhaupt aufgerufen, da man nicht sieht wo du dies aufrufst.

  • Beitrag von AroX ()

    Dieser Beitrag wurde gelöscht, Informationen über den Löschvorgang sind nicht verfügbar.