Problem mit /stats dialog

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
  • Abend, bei meinem /stats dialog wird nur der erste Satz angezeigt (stats of "XXX")


    Warum wir das andere zeug nicht angezeigt ("Kills, death ect.? )


    if(strcmp(cmdtext,"/stats",true)==0)
    {
    new name[MAX_PLAYER_NAME], string[256], string2[256],string3[256];
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "| Stats of[%s] |", name);
    format(string2, sizeof(string2), "[Kills: %d] [Deaths: %d] [Ratio: %0.2f] ",Player[playerid][Kills], Player[playerid][Deaths],Float:Player[playerid][Kills]/Float:Player[playerid][Deaths]);
    format(string3, sizeof(string3), "[Cash: %d] [Score: %d] [Adminlevel: %d]",GetPlayerMoney(playerid),GetPlayerScore(playerid),Player[playerid][admin]);
    ShowPlayerDialog(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, "Informationen", string, "Schließen", "");
    return 1;
    }

  • So sollte es richtig sein!


    if(strcmp(cmdtext,"/stats",true)==0)
    {
    new name[MAX_PLAYER_NAME], string[256], string2[256],string3[256],allstring[228];
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "| Stats of[%s] |", name);
    format(string2, sizeof(string2), "[Kills: %d] [Deaths: %d] [Ratio: %0.2f] ",Player[playerid][Kills], Player[playerid][Deaths],Float:Player[playerid][Kills]/Float:Player[playerid][Deaths]);
    format(string3, sizeof(string3), "[Cash: %d] [Score: %d] [Adminlevel: %d]",GetPlayerMoney(playerid),GetPlayerScore(playerid),Player[playerid][admin]);
    format(allstring,228,"%s %s %s",string,string1,string3);
    ShowPlayerDialog(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, "Informationen", allstring, "Schließen", "");
    return 1;
    }

  • die Losung so ist besser
    if(strcmp(cmdtext,"/stats",true)==0)
    {
    new name[MAX_PLAYER_NAME], string[500];
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "%s| Stats of[%s] |",string, name);
    format(string, sizeof(string), "%s[Kills: %d] [Deaths: %d] [Ratio: %0.2f] ",string,Player[playerid][Kills], Player[playerid][Deaths],Float:Player[playerid][Kills]/Float:Player[playerid][Deaths]);
    format(string, sizeof(string), "%s[Cash: %d] [Score: %d] [Adminlevel: %d]",string,GetPlayerMoney(playerid),GetPlayerScore(playerid),Player[playerid][admin]);
    ShowPlayerDialog(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, "Informationen", string, "Schließen", "");
    return 1;
    }

  • hatte was vergessen
    if(strcmp(cmdtext,"/stats",true)==0)
    {
    new name[MAX_PLAYER_NAME], string[500];
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "%s| Stats of[%s] |\n\n",string, name);
    format(string, sizeof(string), "%s[Kills: %d] [Deaths: %d] [Ratio: %0.2f] \n",string,Player[playerid][Kills], Player[playerid][Deaths],Float:Player[playerid][Kills]/Float:Player[playerid][Deaths]);
    format(string, sizeof(string), "%s[Cash: %d] [Score: %d] [Adminlevel: %d]\n",string,GetPlayerMoney(playerid),GetPlayerScore(playerid),Player[playerid][admin]);
    ShowPlayerDialog(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, "Informationen", string, "Schließen", "");
    return 1;
    }