Help with /stats command
#1

Hey all.
Somenone can tell me some ideas for /stats command? i mean...how it's need to be to show player job, cash, player name and level?? i got no ideea how to start.
Reply
#2

You can start from

name, level, how long online
cash on hand, in banks,
Reply
#3

Yea but...i don't know how to start. give me pls some hints
Reply
#4

Well, if you mean how to create the command..
pawn Код:
CMD:stats(playerid,params[])
{
   new astring[100];
   new stirng[1000];
   format(astring,sizeof(astring),"Name:%s",PlayerAcc[playerid][pName]);//change the "PlayerAcc" to you own array name
   strcat(string,astring);
   format(astring,sizeof(astring),"Money:%i",PlayerAcc[playerid][pMoney]);
   //and so on...
}
You must simply use the enums of the player account. Obviously, you can only do this if you have a saving system
Reply
#5

BTW thx man. i descover how to make this command.
pawn Код:
CMD:stats(playerid, params[])
{
SendClientMessage(playerid,COL_STATS,"<____________________>");
new name[MAX_PLAYER_NAME+1], string[24+MAX_PLAYER_NAME+1];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s Status", name);
SendClientMessageToAll(COL_JMEK, string);
format(string, sizeof(string), "Money: $%i.", GetPlayerMoney(playerid));
SendClientMessage(playerid, COL_JMEK, string);
format(string, sizeof(string),"Level: %i", PlayerInfo[playerid][pLevel]);
SendClientMessage(playerid, COL_JMEK,string);
format(string, sizeof(string),"RP: %i", PlayerInfo[playerid][pRP]);
SendClientMessage(playerid, COL_JMEK,string);
SendClientMessage(playerid,COL_STATS,"<____________________>");
return 1;
}
Reply
#6

pawn Код:
CMD:stats(playerid,params[])
{
        new string1[150],string2[150],string3[150],ip[8];
        GetPlayerIp(playerid,ip,sizeof(ip));
        MSG(playerid,WHITE,"=================================================");
        format(string1,sizeof(string1),"** %s status **",sendername(playerid));
        MSG(playerid,MAROON,string1);
        format(string2,sizeof(string2),"Name: %s | IP: %s | Skin Model: %d | Admin Level: %d",sendername(playerid),ip,GetPlayerSkin(playerid),PlayerInfo[playerid][pAdmin]);
        MSG(playerid,RED,string2);
        format(string3,sizeof(string3),"Kills %d | Deaths %d | Level %d | Money %d  ",PlayerInfo[playerid][pKills],PlayerInfo[playerid][pDeaths],GetPlayerScore(playerid),GetPlayerMoney(playerid));
        MSG(playerid,RED,string3);
        MSG(playerid,WHITE,"=================================================");
}
This is taken from my admin filterscript as an example.
Reply
#7

Just a sayin', showing the player stats to everyone can spam the chat if your users are sorta immature.
No offense.
Reply
#8

Ma' mistake.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)