Problem with login system.
#1

When i reach 3 wrong passwords, server kicks me. This is OK. But when i connect again and type correct password log me and my cash is 000000. It doesn't save the cash when kick you. Please Help. CODE:

Код:
case DIALOG_LOGIN:
        {

            if(!response) return Kick(playerid);
            if(response)
            {
                if(udb_hash(inputtext) != PlayerInfo[playerid][pPass])
                {
                    TimesAttempted[playerid] += 1;
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, ""COL_GREY"Login", ""COL_GREY"You have entered an incorrect {FF6347}password{B4B5B7}.\n"COL_GREY"Type your password below to login.", "Login", "Quit");
					if(TimesAttempted[playerid] == 1)
					{
					    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, ""COL_GREY"Login", ""COL_GREY"You have entered an incorrect {FF6347}password{B4B5B7}.\n"COL_GREY"Type your password below to login.", "Login", "Quit");
					}
					else if(TimesAttempted[playerid] == 2)
					{
					    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, ""COL_GREY"Login", ""COL_GREY"You have entered an incorrect {FF6347}password{B4B5B7}.\n"COL_GREY"Type your password below to login.", "Login", "Quit");
					}
					else if(TimesAttempted[playerid] == 3)
					{
						Kick(playerid);
 					}
				}
                else
                {
                    LoggedIn[playerid] = true;
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
                    GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
					SetPlayerFightingStyle(playerid, PlayerInfo[playerid][pFightStyle]);
                    ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX, ""COL_LGREEN"Success", ""COL_LGREEN"You have successfully logged in!", "Ok", "");

				}
        }
		}
    }
    return 1;
}
Reply


Messages In This Thread
Problem with login system. - by Stoyanov - 24.10.2014, 14:49
Re: Problem with login system. - by gurmani11 - 24.10.2014, 15:30
Re: Problem with login system. - by Stoyanov - 24.10.2014, 15:53
Re: Problem with login system. - by gurmani11 - 24.10.2014, 16:06
Re: Problem with login system. - by Stoyanov - 24.10.2014, 17:17
Re: Problem with login system. - by gurmani11 - 24.10.2014, 18:18
Respuesta: Problem with login system. - by aoEXE - 24.10.2014, 18:18
Re: Problem with login system. - by Stoyanov - 24.10.2014, 18:19
Respuesta: Problem with login system. - by aoEXE - 24.10.2014, 18:23
Re: Problem with login system. - by Stoyanov - 24.10.2014, 18:27

Forum Jump:


Users browsing this thread: 1 Guest(s)