OnDialogRespond Login
#1

Hi i have problem

When player register his password got saved very well! But when player connect he got login screen dialog for login but he can type anything password he want he will be logged in! what problem ?!

Код:
if (dialogid ==  DIALOG_LOGIN)
    {
		if(!response)
  		{
    		SCM(playerid, COLOR_WHITE, "SERVER: You have been kicked out of the server because you failed to respond.");
		    Kick(playerid);
    	}

		new hashpass[129];
		WP_Hash(hashpass,sizeof(hashpass),inputtext);
		if(!strcmp(hashpass, pInfo[playerid][e_USER_PASSWORD], false))
		{
            SetPVarInt(playerid, "gLogged", 1);
		    SCM(playerid, COLOR_WHITE, "SERVER: You have successfully logged into your account.");
			INI_ParseFile(Path(playerid),"loadaccount_%s",.bExtra = true, .extra = playerid);
			SetPlayerScore(playerid, pInfo[playerid][e_USER_SCORES]);
			GivePlayerMoney(playerid, pInfo[playerid][e_USER_MONEY]);
		}
	}
	else
	{
		if(GetPVarInt(playerid, "FailedLoginAttempt") == 0)
		{
			SetPVarInt(playerid, "FailedLoginAttempt", 1);
			SCM(playerid, COLOR_RED, "SERVER: The password you have entered is incorrect, please try again (1/3 attempts used).");
		}
		else if(GetPVarInt(playerid, "FailedLoginAttempt") == 1)
		{
			SetPVarInt(playerid, "FailedLoginAttempt", 2);
 			SCM(playerid, COLOR_RED, "SERVER: The password you have entered is incorrect, please try again (2/3 attempts used).");
   		}
		else if(GetPVarInt(playerid, "FailedLoginAttempt") == 2)
		{
			SetPVarInt(playerid, "FailedLoginAttempt", 3);
			SCM(playerid, COLOR_RED, "SERVER: The password you have entered is incorrect, please try again (3/3 attempts used).");
		}
		else if(GetPVarInt(playerid, "FailedLoginAttempt") == 3)
		{
			DeletePVar(playerid, "FailedLoginAttempt");
			SCM(playerid, COLOR_RED, "SERVER: You have used up all your login attempts, and hence got kicked.");
			Kick(playerid);
		}
			new L_DIALOG[380];
 			ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,"Login:", L_DIALOG, "Login", "");
			return 1;
  		}
  		return 1;
Reply


Messages In This Thread
OnDialogRespond Login - by Hunud - 17.02.2017, 15:00
Re: OnDialogRespond Login - by Threshold - 17.02.2017, 15:08
Re: OnDialogRespond Login - by Hunud - 17.02.2017, 15:26
Re: OnDialogRespond Login - by Threshold - 17.02.2017, 15:32
Re: OnDialogRespond Login - by Hunud - 17.02.2017, 15:34
Re: OnDialogRespond Login - by Hunud - 17.02.2017, 15:53

Forum Jump:


Users browsing this thread: 1 Guest(s)