SA-MP Forums Archive
help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: help (/showthread.php?tid=630992)



help - AndreaSanchez - 21.03.2017

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.

PHP код:
forward LoginDialog(playeriddialogidresponselistitemstring:inputtext[]);
public 
LoginDialog(playeriddialogidresponselistitemstring:inputtext[]) {
    
#pragma unused dialogid, response, inputtext
    
if(response) {
        new 
user_name[32], hashed_password[129], user_password[129];
        if(
strlen(inputtext)) {
            
WP_Hash(hashed_passwordsizeof(hashed_password), inputtext);
            
GetPVarString(playerid,"user_password"user_password129);
            if(
strcmp(hashed_passworduser_passwordtrue) == 0) {
                
GetPVarString(playerid"user_name"user_name32);
                
format(a_stringsizeof a_string"{FFFFFF}Добро пожаловать на {FFD5A3}San Fierro Stories Project{FFFFFF}, %s!"user_name);
                
SendClientMessage(playeridCOLOR_WHITEa_string);
                if(
GetPVarInt(playerid"user_admin_level") > 0) {
                    if(
GetAdminLevel(playerid) == 1)
                        
format(a_stringsizeof a_string"{FFFFFF}Вы вошли как {00FF9D}игровой помощник{FFFFFF}.");
                    else if(
GetAdminLevel(playerid) > 1)
                        
format(a_stringsizeof a_string"{FFFFFF}Вы вошли как {FF0000}игровой администратор %d уровня."GetPVarInt(playerid"user_admin_level")-1);
                    
SendClientMessage(playeridCOLOR_WHITEa_string);
                }
                
ChooseCharacterQuery(playerid);
            } 
            else {
                
SetPVarInt(playerid"LogAttempts"GetPVarInt(playerid,"LogAttempts")+1);
                if(
GetPVarInt(playerid"LogAttempts") >= 1) {
                    
SendClientMessage(playeridCOLOR_HELPME"Вы ввели неверный пароль - вы были отключены от сервера.");
                    
KickPlayer(playerid);
                }
                
format(a_stringsizeof a_string""1-GetPVarInt(playerid,"LogAttempts"));
                
Dialog_ShowCallback(playeridusing callback LoginDialogDIALOG_STYLE_PASSWORD"{FFFFFF}Авторизация"a_string"Готово""Выход");
            }
            
        } 
        else {
            
SetPlayerLoginWindow(playerid);
        }
    }
    else {
        
SendClientMessage(playeridCOLOR_HELPME"Для закрытия игры введите команду - /q(uit)");
        
KickPlayer(playerid);
    }
    return 
true;