Textdraws verschwinden hin und wieder

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
  • Hallo, ich habe ein problem mit meinen textdraws


    also wenn man länger rumfährt oder geht verschwindet einfach ein textdraw immer ein anderes.
    wenn man stirbt verschwinden gleich alle oder nur 3 usw



    new Text:Textdraw0_Want[MAX_PLAYERS];
    new Text:Textdrawanf_Want[MAX_PLAYERS];
    new Text:Textdraw1_Want[MAX_PLAYERS];
    new Text:Textdraw2_Want[MAX_PLAYERS];
    new Text:Textdraw3_Want[MAX_PLAYERS];
    new Text:Textdraw4_Want[MAX_PLAYERS];
    new Text:Textdraw5_Want[MAX_PLAYERS];
    new Text:Textdraw6_Want[MAX_PLAYERS];
    also ich habe bei onplayerspawn

    new gwant = Playerinfo[playerid][Want_Gewalt];
    new stowant = Playerinfo[playerid][Want_STVO];
    new swant = Playerinfo[playerid][Want_Sonstige];
    new nnewgewalt[512],nnewstvo[512],nnewsonstige[512];
    format(nnewgewalt,sizeof(nnewgewalt),"%i",gwant);
    format(nnewstvo,sizeof(nnewstvo),"%i",stowant);
    format(nnewsonstige,sizeof(nnewsonstige),"%i",swant);


    Textdraw0_Want[playerid] = TextDrawCreate(516.000000, 101.000000, "_");
    TextDrawBackgroundColor(Textdraw0_Want[playerid], 255);
    TextDrawFont(Textdraw0_Want[playerid], 1);
    TextDrawLetterSize(Textdraw0_Want[playerid], 0.469999, 1.200000);
    TextDrawColor(Textdraw0_Want[playerid], -1);
    TextDrawSetOutline(Textdraw0_Want[playerid], 0);
    TextDrawSetProportional(Textdraw0_Want[playerid], 1);
    TextDrawSetShadow(Textdraw0_Want[playerid], 1);
    TextDrawSetSelectable(Textdraw0_Want[playerid], 0);


    Textdrawanf_Want[playerid] = TextDrawCreate(516.000000, 101.000000, "Wanteds");
    TextDrawBackgroundColor(Textdrawanf_Want[playerid], 255);
    TextDrawFont(Textdrawanf_Want[playerid], 1);
    TextDrawLetterSize(Textdrawanf_Want[playerid], 0.469999, 1.200000);
    TextDrawColor(Textdrawanf_Want[playerid], -1);
    TextDrawSetOutline(Textdrawanf_Want[playerid], 0);
    TextDrawSetProportional(Textdrawanf_Want[playerid], 1);
    TextDrawSetShadow(Textdrawanf_Want[playerid], 1);
    TextDrawSetSelectable(Textdrawanf_Want[playerid], 0);


    Textdraw1_Want[playerid] = TextDrawCreate(529.000000, 120.000000, "Mord:");
    TextDrawBackgroundColor(Textdraw1_Want[playerid], 255);
    TextDrawFont(Textdraw1_Want[playerid], 1);
    TextDrawLetterSize(Textdraw1_Want[playerid], 0.289999, 1.100000);
    TextDrawColor(Textdraw1_Want[playerid], -1);
    TextDrawSetOutline(Textdraw1_Want[playerid], 0);
    TextDrawSetProportional(Textdraw1_Want[playerid], 1);
    TextDrawSetShadow(Textdraw1_Want[playerid], 1);
    TextDrawSetSelectable(Textdraw1_Want[playerid], 0);


    Textdraw2_Want[playerid] = TextDrawCreate(559.000000, 120.000000, nnewgewalt);
    TextDrawBackgroundColor(Textdraw2_Want[playerid], 255);
    TextDrawFont(Textdraw2_Want[playerid], 1);
    TextDrawLetterSize(Textdraw2_Want[playerid], 0.289999, 1.100000);
    TextDrawColor(Textdraw2_Want[playerid], -1);
    TextDrawSetOutline(Textdraw2_Want[playerid], 0);
    TextDrawSetProportional(Textdraw2_Want[playerid], 1);
    TextDrawSetShadow(Textdraw2_Want[playerid], 1);
    TextDrawSetSelectable(Textdraw2_Want[playerid], 0);


    Textdraw3_Want[playerid] = TextDrawCreate(528.000000, 136.000000, "STVO:");
    TextDrawBackgroundColor(Textdraw3_Want[playerid], 255);
    TextDrawFont(Textdraw3_Want[playerid], 1);
    TextDrawLetterSize(Textdraw3_Want[playerid], 0.289999, 1.100000);
    TextDrawColor(Textdraw3_Want[playerid], -1);
    TextDrawSetOutline(Textdraw3_Want[playerid], 0);
    TextDrawSetProportional(Textdraw3_Want[playerid], 1);
    TextDrawSetShadow(Textdraw3_Want[playerid], 1);
    TextDrawSetSelectable(Textdraw3_Want[playerid], 0);


    Textdraw4_Want[playerid] = TextDrawCreate(559.000000, 136.000000, nnewstvo);
    TextDrawBackgroundColor(Textdraw4_Want[playerid], 255);
    TextDrawFont(Textdraw4_Want[playerid], 1);
    TextDrawLetterSize(Textdraw4_Want[playerid], 0.289999, 1.100000);
    TextDrawColor(Textdraw4_Want[playerid], -1);
    TextDrawSetOutline(Textdraw4_Want[playerid], 0);
    TextDrawSetProportional(Textdraw4_Want[playerid], 1);
    TextDrawSetShadow(Textdraw4_Want[playerid], 1);
    TextDrawSetSelectable(Textdraw4_Want[playerid], 0);


    Textdraw5_Want[playerid] = TextDrawCreate(515.000000, 150.000000, "Sonstige:");
    TextDrawBackgroundColor(Textdraw5_Want[playerid], 255);
    TextDrawFont(Textdraw5_Want[playerid], 1);
    TextDrawLetterSize(Textdraw5_Want[playerid], 0.289999, 1.100000);
    TextDrawColor(Textdraw5_Want[playerid], -1);
    TextDrawSetOutline(Textdraw5_Want[playerid], 0);
    TextDrawSetProportional(Textdraw5_Want[playerid], 1);
    TextDrawSetShadow(Textdraw5_Want[playerid], 1);
    TextDrawSetSelectable(Textdraw5_Want[playerid], 0);


    Textdraw6_Want[playerid] = TextDrawCreate(559.000000, 150.000000, nnewsonstige);
    TextDrawBackgroundColor(Textdraw6_Want[playerid], 255);
    TextDrawFont(Textdraw6_Want[playerid], 1);
    TextDrawLetterSize(Textdraw6_Want[playerid], 0.289999, 1.100000);
    TextDrawColor(Textdraw6_Want[playerid], -1);
    TextDrawSetOutline(Textdraw6_Want[playerid], 0);
    TextDrawSetProportional(Textdraw6_Want[playerid], 1);
    TextDrawSetShadow(Textdraw6_Want[playerid], 1);
    TextDrawSetSelectable(Textdraw6_Want[playerid], 0);


    TextDrawShowForPlayer(playerid, Textdraw0_Want[playerid]);
    TextDrawShowForPlayer(playerid, Textdrawanf_Want[playerid]);
    TextDrawShowForPlayer(playerid, Textdraw1_Want[playerid]);
    TextDrawShowForPlayer(playerid, Textdraw2_Want[playerid]);
    TextDrawShowForPlayer(playerid, Textdraw3_Want[playerid]);
    TextDrawShowForPlayer(playerid, Textdraw4_Want[playerid]);
    TextDrawShowForPlayer(playerid, Textdraw5_Want[playerid]);
    TextDrawShowForPlayer(playerid, Textdraw6_Want[playerid]);


    Bitte um hilfe

  • Aber bedenke auch, dass du PlayerTextDraws unter OnPlayerConnect oder so erstellen musst, denn unter
    OnGameModeInit würden sie nicht erstellt werden, da in dem Zeitpunkt die User nicht auf dem Server sind.


    Das würde auch garnicht gehen, da unter OnGameModeInit kein playerid definiert ist. Nur so am Rande ;)