login
#1

PHP код:
case DIALOG_LOGIN:
        {
            if(!
responseKick(playerid);
            
SetPVarInt(playerid"salahlogin", (GetPVarInt(playerid"LogginAttempts") +1));//the code
            
if (!(MIN_PASSWORD_LENGTH <= strlen(inputtext) <= MAX_PASSWORD_LENGTH))
            {
                    if (
GetPVarInt(playerid"salahlogin") == MAX_LOGGIN_ATTEMPTS) return Kick(playerid);//the
                    
new string[144];//the code
                    
format(stringsizeof(string), "ERROR: Invalid password length, must be (correct length: %d/%d)"MIN_PASSWORD_LENGTHMAX_PASSWORD_LENGTH);//the code
                    
SendClientMessage(playerid0xDC143CFFstring);//the code
                    
format(stringsizeof(string), "{FFFFFF}Enter your password then hit \"Submit\"\n\n \
                                                    Error: Insert your correct password{DC143C}(attempts: %d/%d)"
GetPVarInt(playerid"salahlogin"), MAX_LOGGIN_ATTEMPTS);//the code
            
}
            new 
hash[64];
            
SHA256_PassHash(inputtext""hash64);
            if(!
strcmp(hashUserInfo[playerid][p_password]))
            {
                
//Load player data
                
new handle SL::Open(SL::READ"players""p_idac"UserInfo[playerid][p_id]);
                
SL::ReadInt(handle"score"UserInfo[playerid][p_score]);
                
SL::ReadFloat(handle"p_posxeon"UserInfo[playerid][p_posx]);
                
SL::ReadFloat(handle"p_posyoung"UserInfo[playerid][p_posy]);
                
SL::ReadFloat(handle"p_poszebra"UserInfo[playerid][p_posz]);
                
SL::Close(handle);
                
SetPlayerScore(playeridUserInfo[playerid][p_score]);
                
UserInfo[playerid][p_loggedin] = 1;
                
SendClientMessage(playerid, -1"Successfully logged in!");
            }
            else
            {
                
ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_PASSWORD"{0080FF}Login""Please input your password below to log in.""Login""Exit");
            } 
my max attempts login not work.
Reply


Messages In This Thread
login - by asri - 31.08.2017, 10:25
Re: login - by Meller - 31.08.2017, 12:05
Re: login - by asri - 01.09.2017, 09:58
Re: login - by asri - 01.09.2017, 14:59
Re: login - by mongi - 01.09.2017, 17:24

Forum Jump:


Users browsing this thread: 1 Guest(s)