Help with password checking.
#1

First time I've built a user system (I did use a tutorial but it was a shit one). I can't get it to check if the entered text is the same as the password... sounds noobish but meh.

pawn Код:
OnPlayerLogin(playerid, password[])
{
    new
        hashPassword[129],
        uFile[35];

    format(uFile, 35, "%s.ini", PlayerName(playerid));

    INI_ParseFile(uFile, "LoadUserData", .bExtra = true, .extra = playerid);

    WP_Hash(hashPassword, 129, password);
    if(PlayerInfo[playerid][pBanned] == 1)
    {
        new banreason = PlayerInfo[playerid][pBanReason];
        new string[128];
        format(string, sizeof(string), "%s", banreason);
        SendClientMessage(playerid, COLOR_LIGHTRED, "This account has been banned:");
        SendClientMessage(playerid, COLOR_LIGHTRED, string);
        Kick(playerid);
        return 0;
    }
    if(WP_Hash(hashPassword, 129, password) == PlayerInfo[playerid][pPassword])
    {
        SendClientMessage(playerid, COLOR_ORANGE, "You've logged into Los Santos Gang Wars!");
        SetPVarInt(playerid, "Logged", 1);
    }
    else
    {
        SendClientMessage(playerid, COLOR_ORANGE, "Error: wrong password entered, you've been kicked.");
        Kick(playerid);
    }
    return 1;
}
I get no errors or anything, it compiles fine, but it keeps kicking me, even if the passwords right.
Reply


Messages In This Thread
Help with password checking. - by Jack_Leslie - 30.08.2011, 00:53
Re: Help with password checking. - by IceCube! - 30.08.2011, 01:04
Re: Help with password checking. - by Jack_Leslie - 30.08.2011, 01:08
Re: Help with password checking. - by IceCube! - 30.08.2011, 01:11
Re: Help with password checking. - by Jack_Leslie - 30.08.2011, 01:14
Re: Help with password checking. - by IceCube! - 30.08.2011, 01:27
Re: Help with password checking. - by Jack_Leslie - 30.08.2011, 01:36
Re: Help with password checking. - by IceCube! - 30.08.2011, 01:43
Re: Help with password checking. - by Jack_Leslie - 30.08.2011, 01:45
Re: Help with password checking. - by IceCube! - 30.08.2011, 01:48

Forum Jump:


Users browsing this thread: 3 Guest(s)