SA-MP Forums Archive
mysql login bug :/ - 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: mysql login bug :/ (/showthread.php?tid=530577)



mysql login bug :/ - Champ - 07.08.2014

I get login in if its correct password but I get logged in too when i typed incorrect password.
Here is the code.

pawn Код:
case d_login:
        {
            if(!response) return Kick(playerid);

            new hpass[129];
            new Query[100];
            WP_Hash(hpass, 129, inputtext);
            if(!strcmp(hpass, PlayerInfo[playerid][Password]))
            {
                mysql_format(mysql, Query, sizeof(Query),"SELECT * FROM `players` WHERE `Username` = '%e' LIMIT 1", Name[playerid]);
                mysql_tquery(mysql, Query, "OnAccountLoad", "i", playerid);
            }
            else
            {
                ShowPlayerDialog(playerid, d_login, DIALOG_STYLE_INPUT, "Login", "{FF0000}Error Login: Password Incorrect", "Login", "Quit");
            }
        }
thnk you.


Re: mysql login bug :/ - ikkentim - 07.08.2014

Try
pawn Код:
mysql_format(mysql, Query, sizeof(Query),"SELECT * FROM `players` WHERE `Username` = '%e' AND `Password` = '%e' LIMIT 1", Name[playerid], hpass);
I'm just guessing your password field is called Password.


Re: mysql login bug :/ - Champ - 08.08.2014

fixed my self. thanks