Wrong Password
#1

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 ?!
Reply
#2

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
Reply
#3

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


Forum Jump:


Users browsing this thread: 1 Guest(s)