27.04.2013, 21:23
Quote:
You can save stats just after inputting command /stats, and then show it for player. But i dont think that showing stats from the file its good idea. Why you should use data from files to show it for player? Work with variables. (Sorry for my bad English, i'm Ukrainian)
|
pawn Code:
CMD:stats(playerid, params[])
{
new Float:gihp, Float:giar;
GetPlayerHealth(playerid, gihp);
GetPlayerArmour(playerid, giar);
GetPlayerWantedLevel(playerid);
new temp[1000];
new info[1000];
format(temp, sizeof(temp), "Cash: %i$\n",PlayerInfo[playerid][pCash]);
strcat(info, temp);
format(temp, sizeof(temp), "Skin ID: %d\n",PlayerInfo[playerid][pSkin]);
strcat(info, temp);
format(temp, sizeof(temp), "Admin Level: %d\n",PlayerInfo[playerid][pAdmin]);
strcat(info, temp);
format(temp, sizeof(temp), "Kills: %i\n",PlayerInfo[playerid][pKills]);
strcat(info, temp);
format(temp, sizeof(temp), "Deaths: %i\n",PlayerInfo[playerid][pDeaths]);
strcat(info, temp);
format(temp, sizeof(temp), "Health: %0.1f\n",PlayerInfo[playerid][pHealth]);
strcat(info, temp);
format(temp, sizeof(temp), "Armour: %0.1f\n",PlayerInfo[playerid][pArmour]);
strcat(info, temp);
format(temp, sizeof(temp), "Level: %d)\n",PlayerInfo[playerid][pLevel]);
strcat(info, temp);
format(temp, sizeof(temp), "Score: %i\n",GetPlayerScore(playerid));
strcat(info, temp);
ShowPlayerDialog(playerid, 14, DIALOG_STYLE_MSGBOX,"{53C506}Your Stats",info,"Close","");
return true;
}