18.10.2011, 17:01
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)) {
TotalGameTime(player1, h, m, s);
if(PlayerInfo[player1][Deaths] == 0) pDeaths = 1; else pDeaths = PlayerInfo[player1][Deaths];
format(string, sizeof(string), "| {FC0303}%s{00FF19}'s Stats \n
{00FF19}Player Kills: {00FF19}Pistol: {00CEFC}%d \n
{00FF19}Player Deaths: {00CEFC}%d \n{00FF19}Player Ratio: %0.2f \n
{00FF19}Player Money: {00CEFC}$%d \n{00FF19}Player Time: \n
{00CEFC}%d{FC0303}*{00FF19}hrs \n{00CEFC}%d{FC0303}*{00FF19}mins \n
{00CEFC}%d{FC0303}*{00FF19}secs |",
PlayerName2(player1),
PlayerInfo[player1][Kills],
PlayerInfo[playerid][SKILL_PISTOL],
PlayerInfo[player1][Deaths],
Float:PlayerInfo[player1][Kills]/Float:pDeaths,GetPlayerMoney(player1), h, m, s);
return ShowPlayerDialog(playerid, 758, 0, "Player Stats", string, "Ok", "");
} else return SendClientMessage(playerid, red, "Player Not Connected!");
}