passwords seems to be wrong after registering
#3

yeah in first script there was that one actually it hashed my password too so i have 2 accounts yes youre right my second account doesnt have password saved but first one has it saved and hashed still it doesnt quite work still logs in with empty pasword instead of my actual or hashed password fixed code:
Код:
      case DIALOG_REGISTER:
        {
      		if (!response)
            {
                Kick(playerid);
                return 1;
            }
            else if(response)
            {
                if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Register","You have entered an invalid password.\n""Type your password below to register a new account.","Register","Quit");
                new IP[22];
                GetPlayerIp(playerid, IP, sizeof(IP));
                new name[MAX_PLAYER_NAME];
    			GetPlayerName(playerid, name, sizeof(name));
    			
    			PlayerInfo[playerid][pName] = name;
    			PlayerInfo[playerid][pPlate1] = 0;
    			PlayerInfo[playerid][pPlate2] = 0;
    			PlayerInfo[playerid][pPlate3] = 0;
                new INI:File = INI_Open(UserPath(playerid));
                INI_SetTag(File,"data");
                INI_WriteInt(File,"Password",strval(inputtext));
                INI_WriteInt(File,"Cash",0);
                INI_WriteInt(File,"Admin",0);
                INI_WriteInt(File,"Kills",0);
                INI_WriteInt(File,"Deaths",0);
                INI_WriteInt(File,"LSD",0);
                INI_WriteInt(File,"Cocaine",0);
                INI_WriteInt(File,"Marijuana",0);
                INI_WriteInt(File,"Respect",0);
                INI_WriteInt(File,"Cigarettes",0);
                INI_WriteInt(File,"Beer",0);
                INI_WriteString(File, "Ip", IP);
                INI_WriteFloat(File,"Health",0);
                INI_WriteInt(File,"BankAccount",0);
                INI_WriteInt(File,"Datasaved",0);
                INI_WriteInt(File,"Number",0);
                INI_WriteInt(File,"Level",0);
                INI_WriteInt(File,"Crashed",0);
                INI_WriteInt(File,"Phone",0);
                INI_WriteInt(File,"Donator",0);
				INI_WriteInt(File, "Plate1", PlayerInfo[playerid][pPlate1]);
				INI_WriteInt(File, "Plate2", PlayerInfo[playerid][pPlate2]);
				INI_WriteInt(File, "Plate3", PlayerInfo[playerid][pPlate3]);
   				INI_WriteString(File, "Name", PlayerInfo[playerid][pName]);
                INI_Close(File);
				
      			FadeColorForPlayer(playerid,0,0,0,0,0,0,0,255,15,0);
                GivePlayerMoney(playerid, 2500);
                PlayerInfo[playerid][pSkin] = 26;
                PlayerInfo[playerid][pXPos] = 1742.9600;
                PlayerInfo[playerid][pYPos] = -1861.4019;
                PlayerInfo[playerid][pZPos] = 0.2426;
                PlayerInfo[playerid][pLevel] = 1;
                PlayerInfo[playerid][pBankAccount] = 1000;
                SetTimerEx("AgeSetup", 1000, false, "i", playerid);
                new Year, Month, Day;
				getdate(Year, Month, Day);
				PlayerLogged[playerid] = true;
				PlayerInfo[playerid][pYear] = Year;
				PlayerInfo[playerid][pMonth] = Month;
				PlayerInfo[playerid][pDay] = Day;
            }
        }
Код:
        case DIALOG_LOGIN:
        {
      		if(!response)
            {
                Kick(playerid);
                return 1;
            }
            else if(response) 
            {
                if(strval(inputtext) == PlayerInfo[playerid][pPass])
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
                    LoadFightingStyle(playerid);
                   	FadeColorForPlayer(playerid,0,0,0,255,0,0,0,0,15,0);
                    SCM(playerid, COLOR_WHITE, "You have successfully logged in.");
                    TogglePlayerSpectating(playerid, false);
                    PlayerLogged[playerid] = true;
                    SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
              		new playername[24];
					GetPlayerName(playerid, playername, sizeof(playername));
					
					PlayerInfo[playerid][pName] = playername;
					
					new INI:File = INI_Open(UserPath(playerid));
					INI_SetTag(File,"data");
					INI_WriteString(File, "Name", PlayerInfo[playerid][pName]);
					INI_Close(File);
					
					sInfo[playerid][Misc] = 0;
					sInfo[playerid][Head] = 0;
					sInfo[playerid][Chest] = 0;
					sInfo[playerid][Crotch] = 0;
					sInfo[playerid][LArm] = 0;
					sInfo[playerid][RArm] = 0;
					sInfo[playerid][LLeg] = 0;
					sInfo[playerid][RLeg] = 0;
					
					if(PlayerInfo[playerid][pTutorialDone] == 0) return SetTimerEx("AgeSetup", 1000, false, "i", playerid);
                   	if(PlayerInfo[playerid][pBanned] == 1)
					{
					    SCM(playerid, COLOR_LIGHTRED, "AdmCmd: You have been banned for logging into a banned account.");
    					SetTimerEx("UnsetBan", 500, 0, "i", playerid);
					}
                }
                else
                {
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Login","You have entered an incorrect password.\n""Type your password below to login.","Login","Quit");
                }
                return 1;
            }
        }
    }
Reply


Messages In This Thread
[Y_ini]passwords seems to be wrong after registering[SOLVED] - by grymtn - 23.02.2017, 19:59
Re: passwords seems to be wrong after registering - by Awide - 23.02.2017, 20:34
Re: passwords seems to be wrong after registering - by grymtn - 23.02.2017, 20:47
Re: passwords seems to be wrong after registering - by Awide - 24.02.2017, 00:05

Forum Jump:


Users browsing this thread: 2 Guest(s)