#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
#2

SetPVarInt(playerid, "salahlogin", (GetPVarInt(playerid, "salahlogin") +1));

The name "LogginAttempts" is nowhere used.
Reply
#3

Same not working
Reply
#4

Anyone
Reply
#5

Give this a try

PHP код:
case DIALOG_LOGIN
        { 
            if(!
responseKick(playerid); 
            
SetPVarInt(playerid"salahlogin", (GetPVarInt(playerid"salahlogin") +1));//the code 
            
if (GetPVarInt(playerid"salahlogin") == MAX_LOGGIN_ATTEMPTS) return Kick(playerid);//the 
            
if (!(MIN_PASSWORD_LENGTH <= strlen(inputtext) <= MAX_PASSWORD_LENGTH)) 
            { 
                    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"); 
            } 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)