26.01.2014, 06:14
Opah
here is the right one
pawn Код:
CMD:stats(playerid,params[])
{
new targetid;
new name[MAX_PLAYER_NAME],string[190];
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
if(sscanf(params, "u", targetid)) return SendClientMessage(playerid,COLOR_GREY,"Syntax: /stats [playerid]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid,COLOR_RED,"Player is not online");
format(string, sizeof(string), "[------------------------------ %s ------------------------------]",name);
SendClientMessage(playerid,COLOR_GREEN,string);
format(string, sizeof(string), "Kills : %d Deaths : %d Suicides : %d Ratio : %.f",pInfo[targetid][Kills],pInfo[targetid][Deaths],pInfo[targetid][Suicides],pInfo[targetid][Kills]/pInfo[targetid][Deaths]);
SendClientMessage(playerid,COLOR_RED,string);
format(string, sizeof(string), "Money : %i Score : %d Rank : %d",pInfo[targetid][Money],pInfo[targetid][Scores],pInfo[targetid][Rank]+1);
SendClientMessage(playerid,COLOR_RED,string);
format(string, sizeof(string), "Play Time : %d Hours, %d Minutes, %d Seconds .",pInfo[targetid][Hour],pInfo[targetid][Min],pInfo[targetid][Sec]);
SendClientMessage(playerid,COLOR_RED,string);
format(string, sizeof(string), "Admin : %s Admin Level : %d",pInfo[targetid][AdminLevel]?("Yes"):("No"),pInfo[targetid][AdminLevel]);
SendClientMessage(playerid,COLOR_RED,string);
format(string, sizeof(string), "VIP : %s VIP Level : %d",pInfo[targetid][VIPLevel]?("Yes"):("No"),pInfo[targetid][VIPLevel]);
SendClientMessage(playerid,COLOR_RED,string);
return 1;
}