30.05.2014, 07:40
Below the includes
and command:
pawn Код:
#define StatsDialog 1245
pawn Код:
#if defined USE_STATS
CMD:stats(playerid,params[]) {
new string[500], pDeaths, player1, h, m, s;
if(isnull(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];
new string2[128];
format(string2,sizeof(string2),"%s's statistics",PlayerName2(player1));
strcat(string,"Level: %d");
strcat(string,"Kills: %d");
strcat(string,"Deaths: %d");
strcat(string,"Ratio: %0.2f");
strcat(string,"Money: $%d");
strcat(string,"Bank: $%d");
strcat(string,"Time: %d hrs %dmins %d secs");
format(string,sizeof(string),string,
PlayerInfo[player1][Level],PlayerInfo[player1][Kills],PlayerInfo[player1][Deaths],Float:PlayerInfo[player1][Kills]/Float:pDeaths,GetPlayerMoney(playerid1),PlayerInfo[player1][bank],h,m,s);
ShowPlayerDialog(playerid, StatsDialog, DIALOG_STYLE_MSGBOX, string2, string, "Close", "");
format(string,sizeof(string),"");
} else return SendClientMessage(playerid, red, "Player Not Connected!");
}
#endif