02.07.2013, 08:46
pawn Код:
CMD:stats(playerid,params[])
{
new money = PlayerInfo[pID][pCash];
new deaths = PlayerInfo[pID][pDeaths];
new kills = PlayerInfo[pID][pKills];
new vip = PlayerInfo[pID][pVip];
new warn = PlayerInfo[pID][pWarns];
new string[200];
new name[MAX_PLAYER_NAME],pID;
if(sscanf(params,"u",pID)) return SendClientMessage(playerid,0xCCCCCCAA,"/stats [id]");
if(!IsPlayerConnected(pID)) return SendClientMessage(playerid,COLOR_WHITE,"Player not connected.");
if(pID == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_WHITE,"Invalid Player ID");
GetPlayerName(pID,name,sizeof(name));
format(string,sizeof(string),"%s's Stats",name);
format(string,sizeof(string),"| Money: %d | Kills: %d | Deaths: %d | Ratio: %0.2f | VIP: %d | Warns: %d| ",money,kills,deaths,Float:kills/Float:deaths,vip,warn);
SendClientMessage(playerid,COLOR_WHITE,string);
return 1;
}