\n implementieren

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,
    meine Frage ist folgende:
    Ich habe einen String definiert(HouseInfo[HouseNr][InfoText]), indem kommt beispielsweise \n vor.
    Jedoch wird das bei Create3DTextLabel nicht übernommen.
    format(strg, sizeof(strg), "{FFFF00}Information:\n{FFFFFF}%s",HouseInfo[HouseNr][InfoText]);
    Create3DTextLabel(strg,COLOR_LIGHTBLUE,HouseXCoords, HouseYCoords, HouseZCoords+0.5,10.0,0);


    Gruß
    Atrox



    Edit: Y_Less hat mir geholfen :)
    #include <a_samp>


    ReColour(text[])
    {
    new
    pos = -1;
    while ((pos = strfind(text, "(", false, pos + 1)) != -1)
    {
    new
    c = pos + 1,
    n = 0,
    ch;
    // Note that the order of these is important!
    while ((ch = text[code=c]) && n != 6)
    {
    if (!('a' <= ch <= 'f' || 'A' <= ch <= 'F' || '0' <= ch <= '9'))
    {
    break;
    }
    ++c;
    ++n;
    }
    if (n == 6 && ch == ')')
    {
    text[pos] = '{';
    text[code=c] = '}';
    }
    }
    }

    Kalcor: "... it makes the game look like it's not GTA. This mod is called San Andreas Multiplayer. It's not a custom game engine which you can script..."

    Einmal editiert, zuletzt von Atrox ()

  • Das ist kein Textdraw.
    Wie meinst du, dass der Cursor an den Anfang gesetzt wird?

    Kalcor: "... it makes the game look like it's not GTA. This mod is called San Andreas Multiplayer. It's not a custom game engine which you can script..."