Stats Dialog - 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: Stats Dialog (
/showthread.php?tid=576653)
Stats Dialog -
BR3TT - 06.06.2015
So I'm in the middle of making a dialog box. I was wondering how you end up putting the information from a MySQL table into the dialog box? I've only found ways of doing it through chat.
Below is all I've put in so far, I know it's missing other things like what if they don't complete the code, I'm putting that in once I get this to work.
Код:
CMD:stats(playerid, params[])
{
ShowPlayerDialog(playerid, StatsDialog, DIALOG_STYLE_MSGBOX, "Player Statistics",
"VIP:\n\
Admin:\n\
Name:\n\
Age:\n\
Gender:\n\
Date of Birth:\n\
Phone Number:\n\
Armour:\n\
Health:\n\
\n\
Level:\n\
Playing Hours:\n\
Total Wealth:\n\
Money:\n\
Bank:\n\", "Close", "");
}
Re: Stats Dialog -
J0sh... - 06.06.2015
Use format. Then show the player the dialog.
Re: Stats Dialog -
C4SH - 06.06.2015
Do you understand how to display variable data in a string? Such as playernames? If you do then this is pretty basic stuff that you're dealing with.
Код:
new playerbase = 100,string[250]; // Data that we're storing & the string. We use 250 as I assume there's alot of statistics to show.
format(string,sizeof(string),"Our playerbase reached %d today.",playerbase); // Formatting the data into an interger
ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX,"Caption",string,"Close",""); // Displaying the formatted data