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? |
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;
}
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;
}