Hello I have a question about /stats command....
#1

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
Reply
#2

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.
Reply
#3

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;
}
Reply
#4

Thanks now I get how it works For real thank you guys + rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)