SA-MP Forums Archive
Help please. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help please. (/showthread.php?tid=340249)



Help please. - Kukkurloom - 06.05.2012

Hello!

How to make CMD: stats, what shows player score and how much money does he have on hand.
If somebody would please help me?


Re: Help please. - Dziugsas - 06.05.2012

To get money :

https://sampwiki.blast.hk/wiki/GetPlayerMoney


Re: Help please. - FalconX - 06.05.2012

Quote:
Originally Posted by Kukkurloom
Посмотреть сообщение
Hello!

How to make CMD: stats, what shows player score and how much money does he have on hand.
If somebody would please help me?
If you already have the register system you can make a stats command.
pawn Код:
CMD:stats(playerid, params[])
{
    if(YOUR_LOGGED_IN_VAR == 0) return SendClientMessage(playerid, -1 , "You are not logged in");
    new money = PlayerInfo[playerid][pCash]; // CHANGE THESE ALL TO YOUR OWN VARS....
    new deaths = PlayerInfo[playerid][pDeaths];// CHANGE THESE ALL TO YOUR OWN VARS....
    new kills = PlayerInfo[playerid][pKills];// CHANGE THESE ALL TO YOUR OWN VARS....
    new score = PlayerInfo[playerid][pScore];// CHANGE THESE ALL TO YOUR OWN VARS....
    new admin = PlayerInfo[playerid][pAdmin];// CHANGE THESE ALL TO YOUR OWN VARS....
    new vip = PlayerInfo[playerid][pVIP];// CHANGE THESE ALL TO YOUR OWN VARS....
    new killpoints = PlayerInfo[playerid][pKillPoints];// CHANGE THESE ALL TO YOUR OWN VARS....
    new string[128];
    format(string,sizeof(string),"Money: %d | Deaths: %d | Kills: %d | Score: %d | Admin: %d | VIP: %d | Killpoints: %d",money,deaths,kills,score,admin,vip,killpoints);
    SendClientMessage(playerid,COLOR_WHITE,string);
    // you have to change these to your OWN vars, it is just an example!!!
    return 1;
}
or live stats:-

pawn Код:
CMD:stats(playerid, params[])
{
   new string[100];
   format(string, sizeof(string), "Money: $%i | Kills: %d | Deaths: %d", GetPlayerMoney(playerid), Kills, Deaths); // kills and deaths much be there
   SendClientMessage(playerid, 0xFFFFFFAA, string);
   return 1;
}
-FalconX