SA-MP Forums Archive
Wrong Password - 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: Wrong Password (/showthread.php?tid=570346)



Wrong Password - nezo2001 - 09.04.2015

Hello, I'm scripting for another server now I get some codes from my main gamemode but there is a problem in it
PHP код:
        case DIALOG_LOGIN:
                 {
            if(!
response) return Kick(playerid);
            if(
response)
            {
                if(
udb_hash(inputtext) != PlayerInfo[playerid][pPass])
                {
                       
ShowPlayerDialog(playeridDIALOG_REGISTERDIALOG_STYLE_PASSWORD,"Account","Welcome to SA-MP Server!\n\n{FF1493}Your account is registered on the server, we hope you enjoy your stay!\n{FF1493}In order to log in your account successfully, Fill in your password correctly:\n\n{FF0033}*Password you typed is incorrect","Continue","Leave");
                    
LoggedIn[playerid] = false;
                }
                else
                {
                       
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra true, .extra playerid);
                    
GivePlayerMoney(playeridPlayerInfo[playerid][pMoney]);
                    
SendClientMessage(playerid0xFF7F2480,"You have successfully logged in your game account!");
                    
SetPlayerScore(playeridPlayerInfo[playerid][pScore]);
                     
LoggedIn[playerid] = true;
                }
            }
        } 
And I tried it like this
PHP код:
        case DIALOG_LOGIN:
                 {
            if(!
response) return Kick(playerid);
            if(
response)
            {
                if(
udb_hash(inputtext) != PlayerInfo[playerid][pPass])
                {
                    
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra true, .extra playerid);
                    
GivePlayerMoney(playeridPlayerInfo[playerid][pMoney]);
                    
SendClientMessage(playerid0xFF7F2480,"You have successfully logged in your game account!");
                    
SetPlayerScore(playeridPlayerInfo[playerid][pScore]);
                     
LoggedIn[playerid] = true;
                }
                else
                {
                       
ShowPlayerDialog(playeridDIALOG_REGISTERDIALOG_STYLE_PASSWORD,"Account","Welcome to SA-MP Server!\n\n{FF1493}Your account is registered on the server, we hope you enjoy your stay!\n{FF1493}In order to log in your account successfully, Fill in your password correctly:\n\n{FF0033}*Password you typed is incorrect","Continue","Leave");
                    
LoggedIn[playerid] = false;
                }
            }
        } 
And in the both times it gives me wrong password in the first time then work in the second I o't kow why ?!


Re: Wrong Password - Bulgaria - 09.04.2015

PHP код:
     case DIALOG_LOGIN

            if(!
response) return Kick(playerid); 
            if(
response
            { 
                if(
udb_hash(inputtext) != PlayerInfo[playerid][pPass]) 
                { 
                    
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra true, .extra playerid); 
                    
GivePlayerMoney(playeridPlayerInfo[playerid][pMoney]); 
                    
SendClientMessage(playerid0xFF7F2480,"You have successfully logged in your game account!"); 
                    
SetPlayerScore(playeridPlayerInfo[playerid][pScore]); 
                     
LoggedIn[playerid] = true
                } 
                else 
                { 
                       
ShowPlayerDialog(playeridDIALOG_REGISTERDIALOG_STYLE_PASSWORD,"Account","Welcome to SA-MP Server!\n\n{FF1493}Your account is registered on the server, we hope you enjoy your stay!\n{FF1493}In order to log in your account successfully, Fill in your password correctly:\n\n{FF0033}*Password you typed is incorrect","Continue","Leave"); 
                    
LoggedIn[playerid] = false
                } 
            } 

Try this


Re: Wrong Password - Matess - 09.04.2015

First one is right but where are you loading PlayerInfo[playerid][pPass]?