[HELP] /stats command
#4

Hey!
Here is my help
You can use /stats or /stats [ID] (it works both ways)
Replace "ID" with this
Код:
new target=playerid;
if(!isnull(params)) sscanf(params, "r", target);
so then it will look like

Код:
CMD:stats(playerid,params[])
{
	new name[MAX_PLAYER_NAME];
        new target=playerid;
        if(!isnull(params)) sscanf(params, "r", target);
 	GetPlayerName(target, name, sizeof(name));
	if(sscanf(params,"d",target)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /stats <ID>");
	if (!IsPlayerConnected(target)) return SendClientMessage(playerid, COLOR_RED, "ERROR: Player is not connected.");
	new string[128];
	new Float:ratio=floatdiv(PlayerInfo[target][pKills], PlayerInfo[target][pDeaths]);
	format(string, 128, "%d %d %.2f", PlayerInfo[target][pKills], PlayerInfo[target][pDeaths], ratio);
	format(string, sizeof(string), "Name: %s (ID:%d)\nAdmin Level :%d\nKills : %d\nDeaths : %d\nKill/Death Ratio: %.2f\nScore: %d",name, target, PlayerInfo[target][pAdmin], PlayerInfo[target][pKills], PlayerInfo[target][pDeaths], ratio,PlayerInfo[target][pScore]);
    ShowPlayerDialog(playerid,DIALOG_STATS,DIALOG_STYLE_MSGBOX,"Player Stats",string,"Close","");
    return 1;
}
EDIT : SORRY FORGOT TO REFRESH KONSTANTINOS AND THE OTHER ONE
Reply


Messages In This Thread
[HELP] /stats command - by NeamPojma - 22.06.2015, 20:01
Re: [HELP] /stats command - by justice96 - 22.06.2015, 20:06
Re: [HELP] /stats command - by Konstantinos - 22.06.2015, 20:07
Re: [HELP] /stats command - by kalanerik99 - 22.06.2015, 20:08
Re: [HELP] /stats command - by NeamPojma - 22.06.2015, 20:15
Re: [HELP] /stats command - by kalanerik99 - 22.06.2015, 20:20
Re: [HELP] /stats command - by NeamPojma - 22.06.2015, 20:25
Re: [HELP] /stats command - by Prokill911 - 22.06.2015, 20:40
Re: [HELP] /stats command - by justice96 - 22.06.2015, 20:49

Forum Jump:


Users browsing this thread: 2 Guest(s)