26.07.2012, 22:42
How can I display my stats like this?Please help.
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Your Stats!", "Line1\nLine2\nLine3\nLine4", "Ok", "");
// create some vars
new x, y;
// setting their values
x = 4;
y = 8;
// declaring a string to hold these vars
new str[16];
// formating it
format(str, sizeof(str), "x: %d\ny: %d", x, y); // adding the vars into the string. \n creates a new line
// Output:
// x: 4
// y: 8
// -------
// Now you can use the string that you formatted in your dialog
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Dialog", str, "Ok", "");
CMD:stats(playerid, params[])
{
new string[256], sendername[MAX_PLAYER_NAME];
new
admin,
kills,
deaths;
admin = PlayerInfo[playerid][pAdmin]; // i dont know your variables , change this to your variables
kills = PlayerInfo[playerid][pKills];
deaths = PlayerInfo[playerid][pDeaths];
format(string,sizeof(string), "PlayerName:( %s ) Admin Level:[ %d ] Kills:[ %d ] Deaths:[ %d ]",sendername,admin,kills,deaths);
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX , "Player Stats", string, "Okay", "");
return 1;
}