06.04.2011, 20:48
pawn Код:
dcmd_stats(playerid, cmdtext[])
{
new player1, tmp[256];
new playername[MAX_PLAYER_NAME];
new string[256], idx;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
ShowScore(playerid);
return 1;
}
player1 = strval(tmp);
if(IsPlayerConnected(player1))
{
GetPlayerName(player1, playername, sizeof(playername));
format(playername,sizeof playername,"%s's status.",playername);
format(string,sizeof(string),"Kills:\t\t%d\nDeaths:\t%d\nRatio:\t\t%0.2f\nMoney:\t$%d\n",PlayerInfo[player1][kills], PlayerInfo[player1][deaths],Float:PlayerInfo[player1][deaths]/Float:PlayerInfo[player1][deaths],GetPlayerMoney(player1));
ShowPlayerDialog(playerid,1337,DIALOG_STYLE_MSGBOX,playername,string,"Ok","Close");
return 1;
}
else
{
SendClientMessage(playerid, COLOR_LRED, "ERROR: Player is not connected.");
return 1;
}
}