pawn Код:
#if defined USE_STATS
dcmd_stats(playerid,params[])
{
new string[128], pDeaths, player1, h, m, s;
if(!strlen(params)) player1 = playerid;
else player1 = strval(params);
if(!IsPlayerConnected(player1)) return SendClientMessage(playerid, red, "Player Not Connected!");
TotalGameTime(player1, h, m, s);
if(PlayerInfo[player1][Deaths] == 0) pDeaths = 1; else pDeaths = PlayerInfo[player1][Deaths];
format(string, sizeof(string), "> Username: %s", PlayerName2(player1));
SendClientMessage(playerid, green, string);
format(string, sizeof(string), "> Kills: %d", PlayerInfo[player1][Kills]);
SendClientMessage(playerid, green, string2);
format(string, sizeof(string), "> Deaths: %d", PlayerInfo[player1][Deaths]);
SendClientMessage(playerid, green, string2);
format(string, sizeof(string), "> Ratio: %0.2f", Float:PlayerInfo[player1][Kills]/Float:pDeaths);
SendClientMessage(playerid, green, string2);
format(string, sizeof(string), "> Money: %d", GetPlayerMoney(player1));
SendClientMessage(playerid, green, string2);
format(string, sizeof(string), "> Score: %d", GetPlayerScore(player1));
SendClientMessage(playerid, green, string2);
format(string, sizeof(string), "> Time: %d hours %d minutes %d seconds", h, m, s);
SendClientMessage(playerid, green, string2);
}
#endif