27.07.2012, 07:00
this is for mystats , show your stats;
this is for checking other player stats;
pawn Код:
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;
}
pawn Код:
#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;
}