07.07.2013, 14:49
pawn Код:
#define Y(%0) ((%0) ? 1 : 0)
GetPlayerStats(user)
{
new str[1000];
static const YesOrNo[][] = {"No","Yes"};
new Score = GetPlayerScore(user);
new Cash = GetPlayerMoney(user);
new Lvl = AdminLevel[user];
new Army = CanUseArmy[user];
new CIA = CanUseCIA[user];
new RegPla = IsRegularPlayer[user];
new Trust = IsTRP[user];
new C4 = HasC4[user];
new Wallet = HasSecureWallet[user];
new Con = HasCondoms[user];
new Rope = HasRope[user];
new Sci = HasScissors[user];
new Kill = Kills[user];
new Dead = Deaths[user];
format(str, sizeof(str), "Name: %s(%d)\nScore: %d\nCash: %d$\nAdmin Level: %d\n\
Army: %s\nCIA: %s\nRegular Player: %s\nTrusted Regular Player: %s\nWarns: %d\n\
Terrorist Skill: %d\nRob Skill: %d\nCop Rank: %d\nHas C4: %s\nSecure Wallet: %s\n\
Condoms: %s\nRopes: %s\nScissors: %s\nKills: %d\nDeaths: %d",
PlayerName(user),user,Score,Cash,Lvl,YesOrNo[Y(Army)],YesOrNo[Y(CIA)],
YesOrNo[Y(RegPla)],YesOrNo[Y(Trust)],Warns[user],TerroristSkill[user],
RobSkill[user],CopRank[user],YesOrNo[Y(C4)],YesOrNo[Y(Wallet)],
YesOrNo[Y(Con)],YesOrNo[Y(Rope)],YesOrNo[Y(Sci)],Kill,Dead);
return str;
}
dcmd_stats(playerid,params[])
{
#pragma unused params
if(IsSpawned[playerid] != 1)
{
SendClientMessage(playerid,COLOR_ERROR,"You must be alive and spawned in order to be able to use this command.");
return 1;
}
new string[128];
ShowPlayerDialog(playerid,DIALOG_STATS, DIALOG_STYLE_MSGBOX,"{53C506}Stats",GetPlayerStats(playerid),"Close","");
format(string,sizeof(string),"[ADMIN SPY] %s(%d) has typed /stats.",PlayerName(playerid),playerid);
SendClientMessageToAllAdmins(string);
return true;
}