19.09.2012, 08:54
Only the last format show in dialog box.. What should I do?
pawn Код:
COMMAND:stats(playerid,params[])
{
new string[250], pDeaths, player1, player, h, m, s;
if(sscanf(params, "r", player))
{
player1 = playerid;
}
else
{
player1 = player;
}
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), "{FEFEFE}PT Score: %d\n", string, GetPlayerScore(player1));
format(string, sizeof(string), "{FEFEFE}DM Score: %d\n", string, PlayerInfo[player1][Kills]);
format(string, sizeof(string), "{FEFEFE}Total Deaths: %d\n", string, PlayerInfo[player1][Deaths]);
format(string, sizeof(string), "{FEFEFE}K/D Ratio: %0.2f\n", string, Float:PlayerInfo[player1][Kills]/Float:pDeaths);
format(string, sizeof(string), "{FEFEFE}Money: $%d\n", string, GetPlayerMoney(player1));
format(string, sizeof(string), "{FEFEFE}VIP Level: %d\n", string, PlayerInfo[player1][VIPLevel]);
format(string, sizeof(string), "{FEFEFE}Time Login: %d hours %d minutes %d seconds\n", string, h,m,s);
format(string, sizeof(string), "{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), "{FEFEFE}PT Score: %d\n", string, GetPlayerScore(player1));
format(string, sizeof(string), "{FEFEFE}DM Score: %d\n", string, PlayerInfo[player1][Kills]);
format(string, sizeof(string), "{FEFEFE}Total Deaths: %d\n", string, PlayerInfo[player1][Deaths]);
format(string, sizeof(string), "{FEFEFE}K/D Ratio: %0.2f\n", string, Float:PlayerInfo[player1][Kills]/Float:pDeaths);
format(string, sizeof(string), "{FEFEFE}Money: $%d\n", string, GetPlayerMoney(player1));
format(string, sizeof(string), "{FEFEFE}Time Login: %d hours %d minutes %d seconds\n", string, h,m,s);
format(string, sizeof(string), "{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;
}