15.01.2011, 21:07
Not tested but should work:
pawn Код:
dcmd_stats(playerid,params[]) {
new string[128], pDeaths, player1, h, m, s;
if(!strlen(params)) player1 = playerid;
else player1 = strval(params);
if(IsPlayerConnected(player1)) {
TotalGameTime(player1, h, m, s);
if(PlayerInfo[player1][Deaths] == 0) pDeaths = 1; else pDeaths = PlayerInfo[player1][Deaths];
format(string, sizeof(string), "| %s's Stats: Kills: %d \nDeaths: %d \nRatio: %0.2f \nMoney: $%d \nTime: %d hrs %d mins %d secs |",PlayerName2(player1), PlayerInfo[player1][Kills], PlayerInfo[player1][Deaths], Float:PlayerInfo[player1][Kills]/Float:pDeaths,GetPlayerMoney(player1), h, m, s);
return ShowPlayerDialog(playerid, 758, DIALOG_STYLE_LIST, string, "Ok", "");
} else return SendClientMessage(playerid, red, "Player Not Connected!");
}