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



Password Saving Issue - TyThaBomb - 08.10.2011

Well, I have this login/register script, and it tells me I have the wrong password when I attempt to login with the password I registered with! I would really appreciate some help!

pawn Код:
}
    if(dialogid == 2) {
        new file[128], name[MAX_PLAYER_NAME], str[128];
        GetPlayerName(playerid, name, MAX_PLAYER_NAME);
        format(str, sizeof(str), "Users/%s.ini", name);
        if(response) {
            if(strlen(inputtext)) {
                if(num_hash(inputtext) != dini_Int(file, "Password")) {
                    SendClientMessage(playerid, red, "Wrong Password");
                    ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Please Login", "Enter Your Password Below", "Login", "Cancel");
                }
                else {
                    SendClientMessage(playerid, lightgreen, "Succesfuly logged in");
                    PlayerInfo[playerid][PlayerLevel] = dini_Int(file, "PlayerLevel");
                    PlayerLogged[playerid] = 1;
                    PlayerInfo[playerid][PlayerCash] = dini_Int(file, "PlayerCash");
                    GivePlayerMoney(playerid, dini_Int(file, "PlayerCash"));
                    PlayerInfo[playerid][AdminLevel] = dini_Int(file, "AdminLevel");
                }
            }
        }
        else {
            Kick(playerid);
        }
    }
    return 1;
}



Re: Password Saving Issue - roleplay501 - 08.10.2011

if(num_hash(inputtext) != dini_Int(str, "Password")) {

//use str instead of file..

If it won't work i think you'll have to show us the registration part.


Re: Password Saving Issue - TyThaBomb - 08.10.2011

It worked, thanks so much for the quick reply as well +rep :3