27.07.2012, 04:55
Hello All. I have a stats system but i does not shows other stats. i want to make it that the command show other stats like. /stats [id] and /stats for himself. need help quickly.
thank you
thank you
enum pInfo
{
blabla,
lololol
}
new PlayerInfo[MAX_PLAYERS][pInfo];
CMD:mystats(playerid, params[])
{
new string[256], sendername[MAX_PLAYER_NAME];
new
admin,
kills,
deaths;
admin = PlayerInfo[playerid][pAdmin]; // i dont know your variables , change this to your variables
kills = PlayerInfo[playerid][pKills];
deaths = PlayerInfo[playerid][pDeaths];
format(string,sizeof(string), "PlayerName:( %s ) Admin Level:[ %d ] Kills:[ %d ] Deaths:[ %d ]",sendername,admin,kills,deaths);
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX , "MyStats", string, "Okay", "");
return 1;
}
#include <a_samp>
#include <zcmd>
#include <sscanf2>
#define DIALOG_STATS 1997
#define red 0xFF0000AA
CMD:stats(playerid, params[])
{
new str[256];
new pid;
new
admin = PlayerInfo[playerid][pAdmin],
kills = PlayerInfo[playerid][pKills],
deaths = PlayerInfo[playerid][pDeaths];
if(sscanf(params,"u",pid)) return SendClientMessage(playerid,red,"[USAGE]:/stats [PlayerID/PartOfName]");
format(str, sizeof(str), "AdminLevel:[ %d ] Kills:[ %d ] Deaths:[ %d ]", admin,kills,deaths);
ShowPlayerDialog(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX , "PlayerStats", string, "Close", "");
return 1;
}