Dialog stats - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Dialog stats (
/showthread.php?tid=363215)
Dialog stats -
TaLhA XIV - 26.07.2012
How can I display my stats like this?Please help.
Re: Dialog stats -
[KHK]Khalid - 26.07.2012
?
pawn Код:
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Your Stats!", "Line1\nLine2\nLine3\nLine4", "Ok", "");
Or are you asking about how they added those values (VIP, money etc.)?
Re: Dialog stats -
maramizo - 26.07.2012
Using format and hex colour codes.
Re: Dialog stats -
TaLhA XIV - 26.07.2012
can you give me an example becozz my stats command is really big so please..
Re: Dialog stats -
[KHK]Khalid - 26.07.2012
pawn Код:
// 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", "");
Re: Dialog stats -
Devilxz97 - 26.07.2012
https://sampwiki.blast.hk/wiki/Format
https://sampwiki.blast.hk/wiki/ShowPlayerDialog
pawn Код:
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;
}
this one is on "ZCMD"