INI doesn't hash password + doesnt load money
#1

Hey guys i have tried this login/register system it doesn't hash password it allows me to type and password and gives access to account.. and it doesn't load money while login.. check it if you are free , thanks.

Код:
case DIALOG_REGISTER:
        {
            if (!response) return Kick(playerid);
            if(response)
            {
                if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Registering...","You have entered an invalid password.\nType your password below to register a new account.","Register","Quit");
                new
					hashed_password[ 129 ];
				WP_Hash( hashed_password, sizeof ( hashed_password ), inputtext );


                new INI:File = INI_Open(UserPath(playerid));
                INI_SetTag(File,"data");
                INI_WriteString(File, "Password", hashed_password );
                INI_WriteInt(File,"Cash",0);
                INI_WriteInt(File,"Admin",0);
                INI_WriteInt(File,"Sex",0);
                INI_WriteInt(File,"Age",0);
                INI_WriteFloat(File,"Pos_x",1654.0);
    			INI_WriteFloat(File,"Pos_y",-2330.3);
    			INI_WriteFloat(File,"Pos_z",13.5);
   			 	INI_WriteInt(File,"Skin",0);
   			 	INI_WriteInt(File,"Team",0);
   			 	INI_WriteInt(File,"Accent",0);
                INI_WriteInt(File,"Member",0);
                INI_Close(File);

            }
        }
        case DIALOG_LOGIN:
        {
            //if ( !response ) return Kick ( playerid );  done :D
            if( response )
            {
                new
					hashed_password[ 129 ];
				

                if( !strcmp ( hashed_password, PlayerInfo[ playerid ][ pPassword ] ) )
                {
                    INI_ParseFile(UserPath ( playerid ), "load_user_%s", .bExtra = true, .extra = playerid);
					SetSpawnInfo(playerid, PlayerInfo[playerid][pTeam], PlayerInfo[playerid][pSkin], PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z], 1.0, -1, -1, -1, -1, -1, -1);
					GivePlayerMoney( playerid, PlayerInfo[ playerid ][ pCash ] );
					// so this is done (thanks i pissed and chosen to come and fix :D) man not fixed trust me JUST WATCH
				}
                else
                {
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"{97F2FD}Account: Login","{FF2020}You have entered an incorrect password\n\n{FFFFFF}Please type your password to login","Login","Quit");
                }
                return 1;
            }
            else
            {
                Kick(playerid);
                //ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Login","Please enter a password to proceed further.","Login","Quit");
			}
        }
    }
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)