MySQL Dialog Won't Open
#3

Hmm nope, still no dialog, here's the dialog code:

pawn Код:
#define DIALOG_LOGIN 2
pawn Код:
case DIALOG_LOGIN: //Dialog login
        {
            if(!response) //If they click the cancel button
            {
                Kick(playerid);
            }
            if(response) //If the player clicked login
            {
                new query[200], pname[24], escapepass[100];//
                GetPlayerName(playerid, pname, 24); //Gets the players name
                mysql_real_escape_string(inputtext, escapepass); //We escape the inputtext to avoid SQL injections.
                format(query, sizeof(query), "SELECT `user` FROM playerdata WHERE user = '%s' AND password = SHA1('%s')", pname, escapepass);
                mysql_query(query);
                mysql_store_result();
                new numrows = mysql_num_rows();
                if(numrows == 1) MySQL_Login(playerid);
                //This means that there is a user in the database with the same
                //password that we typed, we now proceed by using the login function.
                if(!numrows)
                {
                    //This means that the password that the player
                    //typed was incorrect and we will resend the dialog.
                    format(string, sizeof(string), "Welcome back, %s. Please enter your password below to log in.", GetName(playerid));
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Login", string, "Confirm", "Quit");
                    SendClientMessage(playerid, COLOR_LIGHTRED, "Error{FFFFFF}: You have entered an incorrect password."); //Sends the client a error message
                }
                mysql_free_result(); //Remember to always free a result if you stored one!
            }
            return 1;
        }
The indent at:
pawn Код:
case DIALOG_LOGIN: //Dialog login
is just the way I posted the code
Reply


Messages In This Thread
MySQL Dialog Won't Open - by AphexCCFC - 22.01.2013, 22:04
Re: MySQL Dialog Won't Open - by [jS]Thomas - 22.01.2013, 22:13
Re: MySQL Dialog Won't Open - by AphexCCFC - 22.01.2013, 22:21
Re: MySQL Dialog Won't Open - by [jS]Thomas - 22.01.2013, 22:23
Re: MySQL Dialog Won't Open - by AphexCCFC - 22.01.2013, 22:30
Re: MySQL Dialog Won't Open - by AphexCCFC - 22.01.2013, 22:32
Re: MySQL Dialog Won't Open - by [jS]Thomas - 22.01.2013, 22:33
Re: MySQL Dialog Won't Open - by AphexCCFC - 22.01.2013, 22:35

Forum Jump:


Users browsing this thread: 1 Guest(s)