24.10.2014, 14:49
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;
}


