PDA

View Full Version : /stats command


zohartrejx
04/05/2014, 10:41 AM
Can someone help me with /stats command?
Currently i have
enum pInfo
{
pAdminLevel,
pCash,
pScore,
}
Can someone tell me how to do /stats command so it'll show Adminlevel , cash and score?
Please don't use ZCMD or others, normal one.
Thanks all

PrivatioBoni
04/05/2014, 10:49 AM
new admin = PlayerInfo[playerid][pAdminLevel];
new cash = PlayerInfo[playerid][pCash];
new score = PlayerInfo[playerid][pScore];


new stats[144];
format(stats,sizeof(stats),"Admin: %i | Cash: $%i | Score: %i |",admin,cash,score);
SendClientMessage(playerid, COLOR_WHITE, stats);

Should be OK. Untested.

Ghazal
04/05/2014, 10:51 AM
Maybe something like this?
CMD:stats(playerid,params[])
{
new id = playerid;
if(!isnull(params)) id = strval(params);
format(megastr, sizeof(megastr, "Name: %s /n Score: %i/n Cash: %i/nAdminLevel: %i",PlayerName(id),GetPlayerScore(id),PlayerInfo[id][pCash],PlayerInfo[id][pAdmin]);
ShowPlayerDialog(playerid, DIALOG_TEXT, DIALOG_STYLE_MSGBOX, "COL_YELLOW"" Player Stats", megastr, "Close", "");
return 1;
}

zohartrejx
04/05/2014, 12:04 PM
Thanks:)!