SA-MP Forums Archive
OnDialogResponse Login issue - 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: OnDialogResponse Login issue (/showthread.php?tid=486939)



OnDialogResponse Login issue - Lyksus - 11.01.2014

When you login the password says it's incorrect (it is correct), but it lets me log in at the same time, even returning the login message. The incorrect password dialog shows up as well. Anyone see the issue?


pawn Код:
case DIALOG_LOGIN:
            {
                if(response)
                {
                    new query[256];
                    format(query, sizeof(query), "SELECT `user` FROM accounts WHERE Name = '%s' AND Password = '%s'", pName(playerid), inputtext);
                   
                    mysql_query(query);
                    mysql_store_result();
                   
                    if(mysql_num_rows() == 1)
                    {
                        SendClientMessage(playerid, WHITE, "You have successfully logged into the server. Enjoy your stay.");
                        LoginScript(playerid);
                        SetTimerEx("HideLoginAndRegisterTextdraws", 200, false, "i", playerid);
                    }
                    else
                    {
                        SetPlayerPos(playerid, 774.7465,352.7754,19.7365);
                        SetPlayerCameraLookAt(playerid, 774.7465,352.7754,19.7365);
                        SetPlayerCameraPos(playerid, 811.6769,381.2172,21.4083);
                        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Emil's Gamemode", "Incorrect password!\nPlease login with a valid password below.", "Login", "Exit");
                    }
                    LoginScript(playerid);
                }
                else Kick(playerid);
                return 1;
            }



Re: OnDialogResponse Login issue - Lyksus - 11.01.2014

Bumb