Hello I have a question about /stats command.... - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Hello I have a question about /stats command.... (
/showthread.php?tid=373654)
Hello I have a question about /stats command.... -
Scrillex - 31.08.2012
Hello everybody..
I wanted to know how can I make /stats command maybe if its possible you can just show me how it looks.. or something...
Just yeah.. Looking around in ******..
And find nothing....!
Thanks for your time and thank you for your answers
With regards Scrillex
Re: Hello I have a question about /stats command.... -
JaKe Elite - 31.08.2012
This is my stats command from my CnR Gamemode:
pawn Код:
CMD:stats(playerid, params[])
{
new str[128], formatit[256], id;
if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "Syntax: /stats (id)");
if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Player not connected!");
format(str, sizeof(str), "%s account status", GetName(id));
SendClientMessage(playerid, COLOR_LIME, str);
format(formatit, sizeof(formatit), ""white"%s account status:\n\nAdminLvl: %i\nVipLvl: %i\nMoney: $%i\nScore: %i\nKills: %i\nDeaths: %i\nWantedLvl: %i\nWeed: %i", GetName(id), pInfo[id][pAdmin], pInfo[id][pVip], GetPlayerMoney(id), GetPlayerScore(id), pInfo[id][pKills], pInfo[id][pDeaths], pInfo[id][pWanted], pInfo[id][pWeed]);
ShowPlayerDialog(playerid, DIALOG_INFO, DIALOG_STYLE_MSGBOX, ""white"Status:", formatit, "Ok", "");
return 1;
}
Note: It uses sscanf and zcmd.
Re: Hello I have a question about /stats command.... -
ThePrograme - 31.08.2012
Here this is an easy one the stats are in dialog:
pawn Код:
CMD:stats(playerid,params[])
{
new string[128];
new name[MAX_PLAYER_NAME];
new deaths = PlayerInfo[playerid][pDeaths];
new kills = PlayerInfo[playerid][pKills];
new admin = PlayerInfo[playerid][pAdmin];
new money = PlayerInfo[playerid][pCash];
new score = PlayerInfo[playerid][pScore];
new stats[1024];
GetPlayerName(playerid, name, sizeof(string));
format(string, sizeof(string), "Name:%s\nScore:%d\nMoney:%d\nAdmin Level:%d\nKills:%d\nDeaths:%d",name,score,money,admin,kills,deaths);
format(stats, sizeof(stats), "%s", string);
ShowPlayerDialog(playerid,454, DIALOG_STYLE_MSGBOX,""white"Stats:",stats,"Ok","");
return 1;
}
Re: Hello I have a question about /stats command.... -
Scrillex - 31.08.2012
Thanks now I get how it works
For real thank you guys + rep