Make this dialog to....
#10

Try this...
pawn Код:
COMMAND:stats(playerid,params[])
{
    new string[400], player1, pDeaths, h, m, s;

    if(sscanf(params, "u", player1))
    {
        player1 = playerid;
    }

    if(IsPlayerConnected(player1))
    {
        TotalGameTime(player1, h, m, s);
        if(PlayerInfo[player1][Deaths] == 0)
        {
            pDeaths = 1;
        }
        else
        {
            pDeaths = PlayerInfo[player1][Deaths];
        }
        #if USE_VIP_SYSTEM == true
        format(string, sizeof(string), "{FEFEFE}Stats of the Player: %s\n\n", GetName(playerid));
        format(string, sizeof(string), "%s{FEFEFE}PT Score: %d\n", string, GetPlayerScore(player1));
        format(string, sizeof(string), "%s{FEFEFE}DM Score: %d\n", string, PlayerInfo[player1][Kills]);
        format(string, sizeof(string), "%s{FEFEFE}Total Deaths: %d\n", string, PlayerInfo[player1][Deaths]);
        format(string, sizeof(string), "%s{FEFEFE}K/D Ratio: %0.2f\n", string, PlayerInfo[player1][Kills] / pDeaths);
        format(string, sizeof(string), "%s{FEFEFE}Money: $%d\n", string, GetPlayerMoney(player1));
        format(string, sizeof(string), "%s{FEFEFE}VIP Level: %d\n", string, PlayerInfo[player1][VIPLevel]);
        format(string, sizeof(string), "%s{FEFEFE}Time Login: %d hours %d minutes %d seconds\n", string, h,m,s);
        format(string, sizeof(string), "%s{FEFEFE}Register Date: %s\n", string, PlayerInfo[player1][RegDate]);
        #else
        format(string, sizeof(string), "{FEFEFE}Stats of the Player: %s\n\n", GetName(player1));
        format(string, sizeof(string), "%s{FEFEFE}PT Score: %d\n", string, GetPlayerScore(player1));
        format(string, sizeof(string), "%s{FEFEFE}DM Score: %d\n", string, PlayerInfo[player1][Kills]);
        format(string, sizeof(string), "%s{FEFEFE}Total Deaths: %d\n", string, PlayerInfo[player1][Deaths]);
        format(string, sizeof(string), "%s{FEFEFE}K/D Ratio: %0.2f\n", string, PlayerInfo[player1][Kills] / pDeaths);
        format(string, sizeof(string), "%s{FEFEFE}Money: $%d\n", string, GetPlayerMoney(player1));
        format(string, sizeof(string), "%s{FEFEFE}Time Login: %d hours %d minutes %d seconds\n", string, h,m,s);
        format(string, sizeof(string), "%s{FEFEFE}Register Date: %s\n", string, PlayerInfo[player1][RegDate]);
        #endif
        ShowPlayerDialog(playerid, STATS_DIALOG, DIALOG_STYLE_MSGBOX, "Player Statistics", string, "Close", "");
    }
    else
    {
        SendClientMessage(playerid, WHITE, "{FF0000}>> Player is not connected");
    }
    return 1;
}
I would recommend you use strcat instead of using multiple 'format' lines.
Reply


Messages In This Thread
Make this dialog to.... - by kbalor - 19.09.2012, 07:12
Re: Make this dialog to.... - by XtremeR - 19.09.2012, 08:08
Re: Make this dialog to.... - by kbalor - 19.09.2012, 08:12
Re: Make this dialog to.... - by XtremeR - 19.09.2012, 08:14
Re: Make this dialog to.... - by MarkoN - 19.09.2012, 08:20
Re: Make this dialog to.... - by XtremeR - 19.09.2012, 08:24
Re: Make this dialog to.... - by Glint - 19.09.2012, 08:28
Re: Make this dialog to.... - by MarkoN - 19.09.2012, 08:29
Re: Make this dialog to.... - by kbalor - 19.09.2012, 08:54
Re: Make this dialog to.... - by clarencecuzz - 19.09.2012, 09:13

Forum Jump:


Users browsing this thread: 2 Guest(s)