PDA

View Full Version : help


AndreaSanchez
21/03/2017, 10:05 AM
Hello, guys and girls. Whirlpool is connected but when I enter the password(correctly) writes that the password is incorrect. If you disable the Whirlpool, you can login with any password.

forward LoginDialog(playerid, dialogid, response, listitem, string:inputtext[]);
public LoginDialog(playerid, dialogid, response, listitem, string:inputtext[]) {
#pragma unused dialogid, response, inputtext
if(response) {
new user_name[32], hashed_password[129], user_password[129];

if(strlen(inputtext)) {
WP_Hash(hashed_password, sizeof(hashed_password), inputtext);
GetPVarString(playerid,"user_password", user_password, 129);
if(strcmp(hashed_password, user_password, true) == 0) {
GetPVarString(playerid, "user_name", user_name, 32);
format(a_string, sizeof a_string, "{FFFFFF}Добро пожаловать на {FFD5A3}San Fierro Stories Project{FFFFFF}, %s!", user_name);
SendClientMessage(playerid, COLOR_WHITE, a_string);

if(GetPVarInt(playerid, "user_admin_level") > 0) {
if(GetAdminLevel(playerid) == 1)
format(a_string, sizeof a_string, "{FFFFFF}Вы вошли как {00FF9D}игровой помощник{FFFFFF}.");
else if(GetAdminLevel(playerid) > 1)
format(a_string, sizeof a_string, "{FFFFFF}Вы вошли как {FF0000}игровой администратор %d уровня.", GetPVarInt(playerid, "user_admin_level")-1);

SendClientMessage(playerid, COLOR_WHITE, a_string);
}

ChooseCharacterQuery(playerid);
}
else {
SetPVarInt(playerid, "LogAttempts", GetPVarInt(playerid,"LogAttempts")+1);
if(GetPVarInt(playerid, "LogAttempts") >= 1) {
SendClientMessage(playerid, COLOR_HELPME, "Вы ввели неверный пароль - вы были отключены от сервера.");
KickPlayer(playerid);
}
format(a_string, sizeof a_string, "", 1-GetPVarInt(playerid,"LogAttempts"));
Dialog_ShowCallback(playerid, using callback LoginDialog, DIALOG_STYLE_PASSWORD, "{FFFFFF}Авторизация", a_string, "Готово", "Выход");
}

}
else {
SetPlayerLoginWindow(playerid);
}
}
else {
SendClientMessage(playerid, COLOR_HELPME, "Для закрытия игры введите команду - /q(uit)");
KickPlayer(playerid);
}
return true;
}