<Textdraw Update Score Level ID usw.

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, und zwar habe ich bei TutNichts ein Textdraw Bestellt das sich Updated, doch leider Funktioniert es nicht sowie ich wollte, und habe mir nun selbst eins gemacht.
    Da ich das Recht als Kunde habe es ja zu Veröffentlichen tu ich das jetzt auch.


    Screen:


    PAWN:
    #include <a_samp>


    new Text:Textdraws[8][MAX_PLAYERS];
    forward updateTextdraws(playerid);


    public OnFilterScriptInit()
    {
    print(" Weihnachtsferien's - Textdraws");


    for(new x; x <= GetMaxPlayers(); x++) {
    Textdraws[7][x] = TextDrawCreate(501.000000,230.000000,"test");
    TextDrawUseBox(Textdraws[7][x],1);
    TextDrawBoxColor(Textdraws[7][x],0x000000ff);
    TextDrawTextSize(Textdraws[7][x],611.000000,7.000000);
    TextDrawAlignment(Textdraws[7][x],0);
    TextDrawBackgroundColor(Textdraws[7][x],0x000000ff);
    TextDrawFont(Textdraws[7][x],3);
    TextDrawLetterSize(Textdraws[7][x],0.899999,7.299995);
    TextDrawColor(Textdraws[7][x],0x000000ff);
    TextDrawSetOutline(Textdraws[7][x],1);
    TextDrawSetProportional(Textdraws[7][x],1);
    TextDrawSetShadow(Textdraws[7][x],1);

    Textdraws[0][x] = TextDrawCreate(505.000000,232.000000,"Spielerinformationen");
    TextDrawAlignment(Textdraws[0][x],0);
    TextDrawBackgroundColor(Textdraws[0][x],0x000000ff);
    TextDrawLetterSize(Textdraws[0][x],0.199999,0.899999);
    TextDrawFont(Textdraws[0][x],2);
    TextDrawColor(Textdraws[0][x],0xffffffff);
    TextDrawSetOutline(Textdraws[0][x],1);
    TextDrawSetProportional(Textdraws[0][x],1);
    TextDrawSetShadow(Textdraws[0][x],1);


    Textdraws[1][x] = TextDrawCreate(505.000000,244.000000," "); // ID
    TextDrawAlignment(Textdraws[1][x],0);
    TextDrawBackgroundColor(Textdraws[1][x],0x000000ff);
    TextDrawFont(Textdraws[1][x],2);
    TextDrawLetterSize(Textdraws[1][x],0.199999,0.699999);
    TextDrawColor(Textdraws[1][x],0xffffffff);
    TextDrawSetOutline(Textdraws[1][x],1);
    TextDrawSetProportional(Textdraws[1][x],1);
    TextDrawSetShadow(Textdraws[1][x],1);


    Textdraws[2][x] = TextDrawCreate(505.000000,253.000000," "); // Name
    TextDrawAlignment(Textdraws[2][x],0);
    TextDrawBackgroundColor(Textdraws[2][x],0x000000ff);
    TextDrawFont(Textdraws[2][x],2);
    TextDrawLetterSize(Textdraws[2][x],0.199999,0.699999);
    TextDrawColor(Textdraws[2][x],0xffffffff);
    TextDrawSetOutline(Textdraws[2][x],1);
    TextDrawSetProportional(Textdraws[2][x],1);
    TextDrawSetShadow(Textdraws[2][x],1);


    Textdraws[3][x] = TextDrawCreate(505.000000,262.000000," "); // Ping
    TextDrawAlignment(Textdraws[3][x],0);
    TextDrawBackgroundColor(Textdraws[3][x],0x000000ff);
    TextDrawFont(Textdraws[3][x],2);
    TextDrawLetterSize(Textdraws[3][x],0.199999,0.699999);
    TextDrawColor(Textdraws[3][x],0xffffffff);
    TextDrawSetOutline(Textdraws[3][x],1);
    TextDrawSetProportional(Textdraws[3][x],1);
    TextDrawSetShadow(Textdraws[3][x],1);


    Textdraws[4][x] = TextDrawCreate(505.000000,271.000000," "); // Spielzeit
    TextDrawAlignment(Textdraws[4][x],0);
    TextDrawBackgroundColor(Textdraws[4][x],0x000000ff);
    TextDrawFont(Textdraws[4][x],2);
    TextDrawLetterSize(Textdraws[4][x],0.199999,0.699999);
    TextDrawColor(Textdraws[4][x],0xffffffff);
    TextDrawSetOutline(Textdraws[4][x],1);
    TextDrawSetProportional(Textdraws[4][x],1);
    TextDrawSetShadow(Textdraws[4][x],1);


    Textdraws[5][x] = TextDrawCreate(505.000000,280.000000," "); // Spieler
    TextDrawAlignment(Textdraws[5][x],0);
    TextDrawBackgroundColor(Textdraws[5][x],0x000000ff);
    TextDrawFont(Textdraws[5][x],2);
    TextDrawLetterSize(Textdraws[5][x],0.199999,0.699999);
    TextDrawColor(Textdraws[5][x],0xffffffff);
    TextDrawSetOutline(Textdraws[5][x],1);
    TextDrawSetProportional(Textdraws[5][x],1);
    TextDrawSetShadow(Textdraws[5][x],1);


    Textdraws[6][x] = TextDrawCreate(505.000000,289.000000," "); // Admins auf dem Server
    TextDrawAlignment(Textdraws[6][x],0);
    TextDrawBackgroundColor(Textdraws[6][x],0x000000ff);
    TextDrawFont(Textdraws[6][x],2);
    TextDrawLetterSize(Textdraws[6][x],0.199999,0.699999);
    TextDrawColor(Textdraws[6][x],0xffffffff);
    TextDrawSetOutline(Textdraws[6][x],1);
    TextDrawSetProportional(Textdraws[6][x],1);
    TextDrawSetShadow(Textdraws[6][x],1);
    }
    return 1;
    }



    public OnPlayerConnect(playerid)
    {
    SetPVarInt(playerid, "Spielzeit", gettime());
    SetTimerEx("updateTextdraws", 60000, true, "u", playerid);
    TextDrawShowForPlayer(playerid, Textdraws[7][playerid]);
    TextDrawShowForPlayer(playerid, Textdraws[0][playerid]);
    TextDrawShowForPlayer(playerid, Textdraws[1][playerid]);
    TextDrawShowForPlayer(playerid, Textdraws[2][playerid]);
    TextDrawShowForPlayer(playerid, Textdraws[3][playerid]);
    TextDrawShowForPlayer(playerid, Textdraws[4][playerid]);
    TextDrawShowForPlayer(playerid, Textdraws[5][playerid]);
    TextDrawShowForPlayer(playerid, Textdraws[6][playerid]);
    return 1;
    }


    public updateTextdraws(playerid) {
    new value[100];
    format(value, 100, "ID: %d", playerid);
    TextDrawSetString(Textdraws[1][playerid], value);
    format(value, 100, "Name: %s", getName(playerid));
    TextDrawSetString(Textdraws[2][playerid], value);
    format(value, 100, "Ping: %d", GetPlayerPing(playerid));
    TextDrawSetString(Textdraws[3][playerid], value);
    format(value, 100, "Spielzeit: %d min", ((gettime() - GetPVarInt(playerid, "Spielzeit")) / 60));
    TextDrawSetString(Textdraws[4][playerid], value);
    format(value, 100, "Spieler: %d/%d", countPlayers(), GetMaxPlayers());
    TextDrawSetString(Textdraws[5][playerid], value);
    format(value, 100, "Admins: %d", getAdminCount());
    TextDrawSetString(Textdraws[6][playerid], value);
    }


    stock getName(playerid) {
    new name[24];
    GetPlayerName(playerid, name, sizeof(name));
    return name;
    }


    stock countPlayers() {
    new varCount = 0;
    for(new x; x <= GetMaxPlayers(); x++) {
    if(IsPlayerConnected(x)) {
    varCount++;
    }
    }
    return varCount;
    }


    stock getAdminCount() {
    new varCount = 0;
    for(new x; x <= GetMaxPlayers(); x++) {
    if(IsPlayerAdmin(x)) {
    varCount++;
    }
    }
    return varCount;
    }

  • Der Texdraw an sich ist jetzt nicht der schönste da könnte man einiges mehr am Design rausholen.
    Von den Anzeigen her, abgesehen vom Design, ist es eher für einen Freeroamserver nützlich - mMn.
    Aber ist ganz in Ordnung. :p