Login system not working
#1

Alright, so I have created a login script, but it does not appear to work, it saves the password, hashes it, but I think something may be wrong with my if statement that tells if the inputtext equals what is saved. But I cannot find the issue.
pawn Код:
case DIALOG_LOGIN:
        {
            if(!response) return pInfo[playerid][ForcedChange] = 1 && ShowPlayerDialog(playerid, DIALOG_NAMECHANGE, DIALOG_STYLE_INPUT, "Namechange...","Please select your new desired name","Select","Cancel");
            if( response )
            {
                if(udb_hash(inputtext) == pInfo[playerid][pPass])
                {
                    pInfo[playerid][pLogged] = 1;
                    SendClientMessage(playerid, -1, "You have been logged in!");
                    SpawnPlayer(playerid);
                    TogglePlayerControllable(playerid, 1);
                }
                else
                {
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login...", "Please Login, if this is not your account his 'Change'", "Enter","Change");
                    SendClientMessage(playerid, 0x5F5F5FFF, "ERROR: You have entered an invalid password!");
                }
            }
Reply
#2

Did you load pInfo[playerid][pPass] before the if statement?
Reply
#3

You use Y_INI for saving/loading players accounts?

Use
pawn Код:
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
after
pawn Код:
SendClientMessage(playerid, -1, "You have been logged in!");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)