Stats Dialog
#1

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", "");
}
Reply
#2

Use format. Then show the player the dialog.
Reply
#3

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)