Password Saving Issue
#1

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;
}
Reply
#2

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

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


Forum Jump:


Users browsing this thread: 2 Guest(s)