02.11.2012, 00:16
pawn Code:
if(dialogid == DIALOG_LOGIN)
{
if(!response) return Kick(playerid);
if(response)
{
new hinfo[20];
if(PlayerInfo[playerid][pHouseKey] == -1)
{ hinfo = "Unavailable"; }
else if(PlayerInfo[playerid][pHouseKey] >= -1)
{ hinfo = "Available"; }
if(udb_hash(inputtext) == PlayerInfo[playerid][pPassword])
{
TogglePlayerSpectating(playerid, 0);
INI_ParseFile(UserSavePath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
SendClientMessage(playerid, COLOR_LIGHTRED, "You have entered your password correct! Logged in successfully.");
SpawnPlayer(playerid);
SetPlayerStuff(playerid);
SetPlayerPos(playerid, PlayerInfo[playerid][PlayerPos][0], PlayerInfo[playerid][PlayerPos][1], PlayerInfo[playerid][PlayerPos][2]);
gLoggedIn[playerid] = 1000;
}
else ShowPlayerDialog(playerid, DIALOG_ERROR, DIALOG_STYLE_MSGBOX, "{DE0D0D}Error!", "{EDC72F}You have entered an invalid password.\n\n{CF0808}You have been kicked.", "Close", "");
//Kick(playerid);
}
}
No-matter what it ALWAYS say its invalid, when it clearly isn't, i've registered shit load of different accs to test it and its generally being a *****..
My register dialog with the PW saving:
pawn Code:
if(dialogid == DIALOG_REGISTER)
{
if(!response) return Kick(playerid);
if(response)
{
if(udb_hash(inputtext) > 5)
{
new genderstring[96];
TutorialPassword[playerid] = udb_hash(inputtext);
gLoggedIn[playerid] = 5;
format(genderstring, sizeof(genderstring), "%s, choose your gender!", GetPlayerNameEx(playerid));
ShowPlayerDialog(playerid, DIALOG_REGISTERGENDER, DIALOG_STYLE_LIST, genderstring, "I am a male!\nI am a female!", "Select", "Cancel");
}
}
}
pawn Code:
INI_WriteInt(File, "Password", TutorialPassword[playerid]);