/stats mit Dialog auf 2 Seiten umschreiben

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 Community.
    Heute brauche ich wieder mal Hilfe was den /stats Befehl angeht.
    Momentan habe ich diesen Befehl bereits als Dialog, jedoch ungeordnet und unübersichtlich.


    Mein Wunsch ist es, den Dialog auf 2 Seiten zu bekommen.
    Sprich man tippt /stats ein, und dann erscheint die erste Seite des Dialogs, dann steht unten Seite 2 oder Abbrechen
    Ich denke ihr wisst worauf ich hinaus will.


    Leider habe ich folgendes Problem.
    Wie geht das?
    Ich habe wieder mal keine Ahnung und hoffe hier kann mir jemand helfen.


    SCREEN DES INGAME DIALOGS: http://abload.de/image.php?img=sa-mp-0133oid7.png


    Danke im Voraus
    MfG Tobi

  • Du nimmst die hälfte der sachen raus- aus dem sting. Und erstellst unter OnDialogResponse einfach ein 2ten showPlayeDialog wenn ich mich nicht irre.
    Ohne genauen code können wir dir auch nicht genau helfen.


    MFG

    Mit freundlichen Grüßen
    [color=#696969][i][b]Maxi
    [tabmenu]
    [tab='Signatur!']

    [tab='Mein Computer System']

    • Gehäuse Delux SH891 Midi-Tower (ATX) schwarz
    • Netzteil 650 Watt Corsair VS650
    • Festplatte 1000GB SATA III 7200upm
    • Mainboard AM3 Gigabyte GA-970A-UD3P (Chipsatz:AMD 970/SB950/ATX)
    • NVIDIA Geforce GTX 770 Gainward Phantom
    • 8192MB DDR3 Single Channel 1600MHz
    • Prozessor AM3+ (FX-Serie) AMD FX-8350 8x 4.0 GHz


    [tab='Meine Handys']

    • HTC ONE M8
    • Samsung S3 mini
    • Vll bald HTC ONE M7


    [tab='Mein Steam Account = 1']

  • Hier der Code:




    new whostats[48];
    if (targetid == playerid) whostats = "Deine";
    else if(targetid != playerid) format(whostats, sizeof(whostats), "%s's", PlayerName(targetid));



    format(whostats, sizeof(whostats), "%s Statistiken", whostats);



    format(string, sizeof(string), "Level: %d ~ Geschlecht: %s ~ Alter: %d ~ Geld: $%d ~ Konto: $%d ~ Bank PIN: %d ~ Nummer: %d ~ Job: %s (%d)\n", plevel, gender, age, wallet, bank, bankpin, number, job, joblevel);



    format(string, sizeof(string), "%sSpielstunden: %d ~ Warnings: %d ~ Upgrade Points: %d ~ Spawn Armor: %d ~ Respekt: %d/%d ~ Straftaten: %d ~ Times Arrested: %d\n", string, hours, warns, upgradepoints, spawnhealth, exp, expamount, crimes, arrests);


    new smallstr[64];
    format(string, sizeof(string), "%sOrganization: %s ~ Rank: %s (%d) ~ Products: %d ~ Wanted Level: %d ~ \n", string, GetPlayerFactionName(targetid), GetPlayerRank(targetid), rank, prods, wantedlevel);
    #if defined COOKIE_SYSTEM
    format(smallstr, sizeof(smallstr), "Cookies: %d ~ ", cookies);
    strcat(string, smallstr);
    #endif
    #if defined GIFT_SYSTEM
    format(smallstr, sizeof(smallstr), "Gifts: %d ~ ", gifts);
    strcat(string, smallstr);
    #endif
    #if defined REWARD_SYSTEM
    format(smallstr, sizeof(smallstr), "Reward Tokens: %d ~ ", PlayerInfo[targetid][pRewardTokens]);
    strcat(string, smallstr);
    #endif
    format(smallstr, sizeof(smallstr), "Channel: %d khz\n", wtc);
    strcat(string, smallstr);



    format(string, sizeof(string), "%sHealth: %.0f ~ Armor: %.0f ~ %s: %s ~ Cocaine: %dg ~ Weed: %dg ~ Material Packages: %d ~ Drug Packages: %d ~ Materials: %d\n", string, health, armor, marriage, PlayerInfo[targetid][pMarriedTo], cocaine, weed, packages, drugpackages, materials);



    format(string, sizeof(string), "%sVIP Rank: %s (%d) ~ Bills: $%d ~ Ropes: %d ~ Cigars: %d ~ Cans of Sprunk: %d ~ Spraycans: %d ~ Heroin: %dg ~ Meth: %dg\n", string, viprank, PlayerInfo[targetid][pDonateRank], bills, ropes, cigars, sprunk, spraycans, heroin, meth);



    new divisiontext[32], divisiontag[12];
    if (PlayerInfo[targetid][pDivision] == 0) divisiontext = "None", divisiontag = "N/A";
    if (PlayerInfo[targetid][pDivision] >= 1) format(divisiontext, 32, DivisionInfo[PlayerInfo[targetid][pMember]][PlayerInfo[targetid][pDivision]][divisionName]), format(divisiontag, 12, DivisionInfo[PlayerInfo[targetid][pMember]][PlayerInfo[targetid][pDivision]][divisionTag]);


    new vehicles;
    for (new i = 1; i <= MAX_OWNED_CARS; i++)
    {
    if (VehicleKeys[targetid] != 0) vehicles++;
    }


    new yesno[10];
    if (iPod[targetid] == 0) yesno = "No";
    if (iPod[targetid] == 1) yesno = "Yes";


    format(string, sizeof(string), "%sDivision: %s (%s) ~ Vehicles: %d/%d ~ iPod: %s ~ Total Wealth: $%d ~ Date Registered: %s %d, %d @ d:d:d\n", string, divisiontext, divisiontag, vehicles, MAX_OWNED_CARS, yesno, wallet + bank, GetMonth(PlayerInfo[targetid][pRegisterDate][2]), PlayerInfo[targetid][pRegisterDate][1], PlayerInfo[targetid][pRegisterDate][3], PlayerInfo[targetid][pRegisterDate][4], PlayerInfo[targetid][pRegisterDate][5], PlayerInfo[targetid][pRegisterDate][6]);



    if (PlayerInfo[playerid][pAdmin] > 0) // How come this wasn't added?
    {
    format(string, sizeof(string), "%sAdmin Level: %d ~ House Keys: %d/%d ~ Garage Keys: %d/%d ~ Business Keys: %d/%d ~ Interior: %d ~ World: %d ~ Jail: %s (%d sec)", string, admin, housekey, HouseKey2[targetid], garagekey, GarageKey2[targetid], bizkey, BizKey2[targetid], interior, virtualworld, jailtype, jailtime);
    }


    ShowPlayerDialog(playerid, 1337, DIALOG_STYLE_MSGBOX, whostats, string, "Ok", "");
    }
    return 1;
    }


  • Testen kann ich es nicht, da das nur der halbe Code ist, aber es sollte so passen:


    Oben unter die Includes:
    #define STATS_DIALOG1 13337
    #define STATS_DIALOG2 13338
    new p_StatsTarget[MAX_PLAYERS];


    Dein /stats Befehl:
    new whostats[48];
    if (targetid == playerid) whostats = "Deine";
    else if(targetid != playerid) format(whostats, sizeof(whostats), "%s's", PlayerName(targetid));



    format(whostats, sizeof(whostats), "%s Statistiken", whostats);



    format(string, sizeof(string), "Level: %d ~ Geschlecht: %s ~ Alter: %d ~ Geld: $%d ~ Konto: $%d ~ Bank PIN: %d ~ Nummer: %d ~ Job: %s (%d)\n", plevel, gender, age, wallet, bank, bankpin, number, job, joblevel);



    format(string, sizeof(string), "%sSpielstunden: %d ~ Warnings: %d ~ Upgrade Points: %d ~ Spawn Armor: %d ~ Respekt: %d/%d ~ Straftaten: %d ~ Times Arrested: %d\n", string, hours, warns, upgradepoints, spawnhealth, exp, expamount, crimes, arrests);


    new smallstr[64];
    format(string, sizeof(string), "%sOrganization: %s ~ Rank: %s (%d) ~ Products: %d ~ Wanted Level: %d ~ \n", string, GetPlayerFactionName(targetid), GetPlayerRank(targetid), rank, prods, wantedlevel);
    #if defined COOKIE_SYSTEM
    format(smallstr, sizeof(smallstr), "Cookies: %d ~ ", cookies);
    strcat(string, smallstr);
    #endif
    #if defined GIFT_SYSTEM
    format(smallstr, sizeof(smallstr), "Gifts: %d ~ ", gifts);
    strcat(string, smallstr);
    #endif
    #if defined REWARD_SYSTEM
    format(smallstr, sizeof(smallstr), "Reward Tokens: %d ~ ", PlayerInfo[targetid][pRewardTokens]);
    strcat(string, smallstr);
    #endif
    format(smallstr, sizeof(smallstr), "Channel: %d khz\n", wtc);
    strcat(string, smallstr);


    p_StatsTarget[playerid] = targetid;
    ShowPlayerDialog(playerid, STATS_DIALOG1, DIALOG_STYLE_MSGBOX, whostats, string, "Abbr.", "Seite 2");
    }
    return 1;
    }


    Bei OnDialogResponse:
    if(dialogid == STATS_DIALOG1)
    {
    if(!response)
    {
    new targetid = p_StatsTarget[playerid];

    new whostats[48];
    if (targetid == playerid) whostats = "Deine";
    else if(targetid != playerid) format(whostats, sizeof(whostats), "%s's", PlayerName(targetid));
    format(whostats, sizeof(whostats), "%s Statistiken", whostats);


    new string[1024];
    format(string, sizeof(string), "Health: %.0f ~ Armor: %.0f ~ %s: %s ~ Cocaine: %dg ~ Weed: %dg ~ Material Packages: %d ~ Drug Packages: %d ~ Materials: %d\n", health, armor, marriage, PlayerInfo[targetid][pMarriedTo], cocaine, weed, packages, drugpackages, materials);



    format(string, sizeof(string), "%sVIP Rank: %s (%d) ~ Bills: $%d ~ Ropes: %d ~ Cigars: %d ~ Cans of Sprunk: %d ~ Spraycans: %d ~ Heroin: %dg ~ Meth: %dg\n", string, viprank, PlayerInfo[targetid][pDonateRank], bills, ropes, cigars, sprunk, spraycans, heroin, meth);



    new divisiontext[32], divisiontag[12];
    if (PlayerInfo[targetid][pDivision] == 0) divisiontext = "None", divisiontag = "N/A";
    if (PlayerInfo[targetid][pDivision] >= 1) format(divisiontext, 32, DivisionInfo[PlayerInfo[targetid][pMember]][PlayerInfo[targetid][pDivision]][divisionName]), format(divisiontag, 12, DivisionInfo[PlayerInfo[targetid][pMember]][PlayerInfo[targetid][pDivision]][divisionTag]);


    new vehicles;
    for (new i = 1; i <= MAX_OWNED_CARS; i++)
    {
    if (VehicleKeys[targetid] != 0) vehicles++;
    }


    new yesno[10];
    if (iPod[targetid] == 0) yesno = "No";
    if (iPod[targetid] == 1) yesno = "Yes";


    format(string, sizeof(string), "%sDivision: %s (%s) ~ Vehicles: %d/%d ~ iPod: %s ~ Total Wealth: $%d ~ Date Registered: %s %d, %d @ %d:%d:%d\n", string, divisiontext, divisiontag, vehicles, MAX_OWNED_CARS, yesno, wallet + bank, GetMonth(PlayerInfo[targetid][pRegisterDate][2]), PlayerInfo[targetid][pRegisterDate][1], PlayerInfo[targetid][pRegisterDate][3], PlayerInfo[targetid][pRegisterDate][4], PlayerInfo[targetid][pRegisterDate][5], PlayerInfo[targetid][pRegisterDate][6]);



    if (PlayerInfo[playerid][pAdmin] > 0) // How come this wasn't added?
    {
    format(string, sizeof(string), "%sAdmin Level: %d ~ House Keys: %d/%d ~ Garage Keys: %d/%d ~ Business Keys: %d/%d ~ Interior: %d ~ World: %d ~ Jail: %s (%d sec)", string, admin, housekey, HouseKey2[targetid], garagekey, GarageKey2[targetid], bizkey, BizKey2[targetid], interior, virtualworld, jailtype, jailtime);
    }
    ShowPlayerDialog(playerid, STATS_DIALOG2, DIALOG_STYLE_MSGBOX, whostats, string, "Seite 1", "Abbr.");
    return 1;
    }
    }


    if(dialogid == STATS_DIALOG2)
    {
    if(response)
    {
    new targetid = p_StatsTarget[playerid];

    new whostats[48];
    if (targetid == playerid) whostats = "Deine";
    else if(targetid != playerid) format(whostats, sizeof(whostats), "%s's", PlayerName(targetid));



    format(whostats, sizeof(whostats), "%s Statistiken", whostats);

    new string[1024];
    format(string, sizeof(string), "Level: %d ~ Geschlecht: %s ~ Alter: %d ~ Geld: $%d ~ Konto: $%d ~ Bank PIN: %d ~ Nummer: %d ~ Job: %s (%d)\n", plevel, gender, age, wallet, bank, bankpin, number, job, joblevel);



    format(string, sizeof(string), "%sSpielstunden: %d ~ Warnings: %d ~ Upgrade Points: %d ~ Spawn Armor: %d ~ Respekt: %d/%d ~ Straftaten: %d ~ Times Arrested: %d\n", string, hours, warns, upgradepoints, spawnhealth, exp, expamount, crimes, arrests);


    new smallstr[64];
    format(string, sizeof(string), "%sOrganization: %s ~ Rank: %s (%d) ~ Products: %d ~ Wanted Level: %d ~ \n", string, GetPlayerFactionName(targetid), GetPlayerRank(targetid), rank, prods, wantedlevel);
    #if defined COOKIE_SYSTEM
    format(smallstr, sizeof(smallstr), "Cookies: %d ~ ", cookies);
    strcat(string, smallstr);
    #endif
    #if defined GIFT_SYSTEM
    format(smallstr, sizeof(smallstr), "Gifts: %d ~ ", gifts);
    strcat(string, smallstr);
    #endif
    #if defined REWARD_SYSTEM
    format(smallstr, sizeof(smallstr), "Reward Tokens: %d ~ ", PlayerInfo[targetid][pRewardTokens]);
    strcat(string, smallstr);
    #endif
    format(smallstr, sizeof(smallstr), "Channel: %d khz\n", wtc);
    strcat(string, smallstr);


    ShowPlayerDialog(playerid, STATS_DIALOG1, DIALOG_STYLE_MSGBOX, whostats, string, "Abbr.", "Seite 2");
    }
    }