PDA

View Full Version : Help please.


Kukkurloom
06/05/2012, 03:18 PM
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? :)

Dziugsas
06/05/2012, 03:34 PM
To get money :

http://wiki.sa-mp.com/wiki/GetPlayerMoney

FalconX
06/05/2012, 03:34 PM
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.

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:-


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