Password saves "0"
#15

@RedFusion,

Sure, but how can I make them save in a better way?

@Sniperwars, I would love to learn how to use Whirlpool

UPDATE: After removing the " INI_WriteInt(File,"Password",PlayerInfo[playerid][pPass]); " from the SavePlayerStats AND OnPlayerDisconnect and putting the password to save in registration like this:

pawn Code:
INI_WriteInt(File,"Password",PlayerInfo[playerid][pPass]);
                INI_Close(File);
                print("(File) has been closed and password is saved.");
Password saves, but when I try to reconnect then put the password, it says that the password is wrong.


UPDATE:

I have put the Whirlpool plugin and did this:

pawn Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch( dialogid )
    {
        case DIALOG_REGISTER:
        {
            if (!response) return Kick(playerid);
            if(response)
            {
                if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Registering...",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
                new INI:File = INI_Open(UserPath(playerid));
                INI_SetTag(File,"PlayerData");
                //INI_WriteString(File,"Password",udb_hash(inputtext));
                new buf[145];
                WP_Hash(buf, sizeof(buf), inputtext);
                //if(strcmp(Password, buf) == true)
               
                INI_WriteInt(File,"Password",WP_Hash(buf, sizeof(buf), inputtext));
                INI_WriteInt(File,"Cash",0);
                INI_WriteInt(File,"Admin",-1);
                INI_WriteInt(File,"Kills",0);
                INI_WriteInt(File,"Deaths",0);
                INI_WriteInt(File,"Zombie",0);
                INI_WriteInt(File,"Score",1);
                INI_WriteInt(File,"Team",-1);
                INI_WriteInt(File,"Registered",1);
                INI_WriteInt(File,"Logged",1);
               
                PlayerInfo[playerid][pTeam] = -1;
                PlayerInfo[playerid][pAdmin] = -1;
               
               
               
                INI_Close(File);
               
                print("(File) has been opened and Password was saved. ");
                INI_WriteInt(File,"Password",PlayerInfo[playerid][pPass]);
                INI_Close(File);
                print("(File) has been closed and password is saved.");

                ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"Great! Your Y_INI system works perfectly. Relog to save your stats!","Ok","");
            }
        }

        case DIALOG_LOGIN:
        {
            if ( !response ) return Kick ( playerid );
            if( response )
            {
                new buf[145];
                if(WP_Hash(buf, sizeof(buf), inputtext) == PlayerInfo[playerid][pPass])
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
                    ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"You have successfully logged in!","Ok","");
                }
                else
                {
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"You have entered an incorrect password.\n"COL_WHITE"Type your password below to login.","Login","Quit");
                }
                return 1;
            }
        }
    }
    return 1;
}
But the password again saves as 0.
Reply


Messages In This Thread
Password saves "0" [Added the codes] - by Guitar - 07.09.2012, 11:08
Re: Password saves "0" - by doreto - 07.09.2012, 11:37
Re: Password saves "0" - by HuSs3n - 07.09.2012, 11:40
Re: Password saves "0" - by Guitar - 07.09.2012, 11:49
Re: Password saves "0" - by Guitar - 07.09.2012, 11:59
Re: Password saves "0" - by HuSs3n - 07.09.2012, 12:00
Re: Password saves "0" - by Guitar - 07.09.2012, 12:02
Re: Password saves "0" - by HuSs3n - 07.09.2012, 12:06
Re: Password saves "0" - by Guitar - 07.09.2012, 12:14
Re: Password saves "0" - by Cjgogo - 07.09.2012, 13:06
Re: Password saves "0" - by JaKe Elite - 07.09.2012, 13:10
Re: Password saves "0" - by Guitar - 07.09.2012, 20:27
Re: Password saves "0" - by RedFusion - 07.09.2012, 20:37
Re: Password saves "0" - by sniperwars - 07.09.2012, 20:37
Re: Password saves "0" - by Guitar - 08.09.2012, 06:04
Re: Password saves "0" - by Guitar - 08.09.2012, 10:15
Re: Password saves "0" - by JaKe Elite - 08.09.2012, 10:31
Re: Password saves "0" - by Guitar - 08.09.2012, 10:49
Re: Password saves "0" - by Kush - 08.09.2012, 10:54
Re: Password saves "0" - by JaKe Elite - 08.09.2012, 10:59
Re: Password saves "0" - by Guitar - 08.09.2012, 11:01
Re: Password saves "0" - by Aprezt - 08.09.2012, 11:03
Re: Password saves "0" - by JaKe Elite - 08.09.2012, 11:04
Re: Password saves "0" - by Guitar - 08.09.2012, 11:06
Re: Password saves "0" - by Kush - 08.09.2012, 11:11
Re: Password saves "0" - by Guitar - 08.09.2012, 11:14
Re: Password saves "0" - by Kush - 08.09.2012, 11:20
Re: Password saves "0" - by Guitar - 08.09.2012, 11:26
Re: Password saves "0" - by JaKe Elite - 08.09.2012, 11:31
Re: Password saves "0" - by Guitar - 08.09.2012, 11:36
Re: Password saves "0" - by Glint - 08.09.2012, 12:02

Forum Jump:


Users browsing this thread: 26 Guest(s)