Register System issues.
#8

Quote:
Originally Posted by JacobEdwards
Посмотреть сообщение
This works perfectly for me.

pawn Код:
new HashPass[128];
WP_Hash(HashPass, sizeof(HashPass), inputtext);
if(!strcmp(HashPass, pInfo[playerid][pPass])) {
    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
} else {
    ShowPlayerDialog(playerid,REGISTER_LOGIN,DIALOG_STYLE_INPUT,"Login","Incorrect Password.","Login","Quit");
    return 1;
}
I'm still able to login with any password upon registering.

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == REGISTER_REGISTER)
    {
        if(!response)
        {
            Kick(playerid);
        }
        if(response)
        {
            if(!strlen(inputtext))
            {
                SCM(playerid,COLOR_RED, "You must enter a password to register a account.");
                ShowPlayerDialog(playerid, REGISTER_REGISTER, DIALOG_STYLE_INPUT, "Please register a account.", "Register", "Enter", "Leave");
                return 1;
            }
            new hashpass[129];
            WP_Hash(hashpass,sizeof(hashpass),inputtext);
            new INI:file = INI_Open(Path(playerid));
            INI_SetTag(file, "Player Data");
            INI_WriteString(file,"Password",hashpass);
            INI_WriteInt(file, "Kills", 0);
            INI_WriteInt(file, "Deaths", 0);
            INI_WriteInt(file, "Vip", 0);
            INI_WriteInt(file, "Admin", 0);
            INI_Close(file);
            new string[128];
            format(string,sizeof(string), "You've registered at Highschool Roleplay with the password %s", inputtext);
            SCM(playerid,COLOR_GREEN, string);
            ShowPlayerDialog(playerid,REGISTER_LOGIN,DIALOG_STYLE_INPUT,"Login","Enter your password to login.","Login","Quit");
        }
    }
    if(dialogid == REGISTER_LOGIN)
    {
        if(!response) return Kick(playerid);
        if(response)
        {
            new hashpass[129];
            WP_Hash(hashpass,sizeof(hashpass),inputtext);
            if(!strcmp(hashpass, pInfo[playerid][pPass]))
            {
                INI_ParseFile(Path(playerid),"LoadAccount_%s",.bExtra = true, .extra = playerid);
                SendClientMessage(playerid,-1,"Welcome back! You have successfully logged in");
            }
            else
            {
                ShowPlayerDialog(playerid,REGISTER_LOGIN,DIALOG_STYLE_INPUT,"Login","Incorrect Password.","Login","Quit");
                return 1;
            }
         }
    }
    return 1;
}
Reply


Messages In This Thread
Register System issues. - by rangerxxll - 14.04.2014, 23:50
Re: Register System issues. - by mrkiller90 - 15.04.2014, 02:06
Re: Register System issues. - by Chenko - 15.04.2014, 02:13
Re: Register System issues. - by JacobEdwards - 15.04.2014, 02:38
Re: Register System issues. - by rangerxxll - 15.04.2014, 02:42
Re: Register System issues. - by JacobEdwards - 15.04.2014, 02:44
Re: Register System issues. - by rangerxxll - 15.04.2014, 02:50
Re: Register System issues. - by rangerxxll - 15.04.2014, 18:22
Re: Register System issues. - by JeaSon - 15.04.2014, 18:35
Re: Register System issues. - by rangerxxll - 15.04.2014, 18:42

Forum Jump:


Users browsing this thread: 8 Guest(s)