24.04.2013, 03:11
Try this. This is how we do it.
pawn Код:
CMD:stats(playerid, params[])
{
new id;
new Cash = PlayerInfo[id][pCash];
new Deaths = PlayerInfo[id][pDeaths];
new Kills = PlayerInfo[id][pKills];
new Score = PlayerInfo[id][pScore];
new pName[24];
new string[128];
new rank[30];
switch(Kills)
{
case 0..100: rank= "None";
case 101..500: rank= "Savage Killer";
//Setting the rank according to the kills
}
if(sscanf(params, "u", id))
return SendClientMessage(playerid, DEEPPINK, "USAGE: /stats <id>");
if(!IsPlayerConnected(id))
return SendClientMessage(playerid, DEEPPINK, "ERROR: Player is not connected.");
{
GetPlayerName(playerid, pName, sizeof pName);
format(string, sizeof(string), "{00FF22}===============[Stats of {FFFFFF}%s{00FF22}]==============", pName);
SendClientMessage(playerid, -1, string);
format(string, sizeof(string), "{FFFFFF}Cash: {00FF22}%d $ | {FFFFFF}Rank: {00FF22}%s", Cash , rank);
SendClientMessage(playerid, -1, string);
format(string, sizeof(string), "{FFFFFF}Deaths: {00FF22}%d {FFFFFF}| Kills: {00FF22}%d", Deaths, Kills);
SendClientMessage(playerid, -1, string);
format(string, sizeof(string), "{FFFFFF}Score: {00FF22}%d", Score);
SendClientMessage(playerid, -1, string);
SendClientMessage(playerid, -1, "{00FF22}================================================");
}
return 1;
}

