SA-MP Forums Archive
[Help] Password string - 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] Password string (/showthread.php?tid=647406)



[Help] Password string - Dello - 04.01.2018

Hi guys, i have a problem with the passwords of the users. When someone try to log in with your password.

Anyone can log in with any password, the script fail there.

(I dont have any error when i compile)

Code of the dialog 'dIngreso':

PHP код:
case dIngreso:
        {
            if(
response)
            {
                if(
PassValida(playeridinputtext) && (strlen(inputtext) > 0))
                {
                    if(
GetPVarInt(playerid,"ErraContraseсa") >= 2)
                    {
                        return 
Kick(playerid);
                    }
                    
SetPVarInt(playerid,"ErraContraseсa"GetPVarInt(playerid,"ErraContraseсa")+);
                    new
                        
string[210];
                    
A_Format(string""#CBLANCO"La contraseсa introducida, no coincide con la contraseсa de "#CINFO"%s"#CBLANCO".\nSi erras tres veces la contraseсa, serбs expulsado automбticamente.\n\n\t\t\tIntento: "#CAMARILLO"[%d/3]", pName(playerid), GetPVarInt(playerid,"ErraContraseсa"));
                    
Dialog(playeriddIngresoDIALOG_STYLE_INPUT""#CROJO"ЎContraseсa incorrecta!", string, "Aceptar", "Salir");
                
}
                else
                {
                    
SetPVarInt(playerid,"Logueado",1);
                    
LoadAccountData(playerid);
                }
                        
//****//
                
return 1;
            }
            else
                return 
Kick(playerid);
        } 

And the code of 'PassValida':

PHP код:
CALLBACKPassValida(playeridcadena[])
    {
    new 
query[1024];
                    
    
format(querysizeof(query),"SELECT * FROM usuarios WHERE Nombre = '%s' AND Clave = md5('%s')",pName(playerid), cadena);
    
mysql_query(babiloniadbquerytrue);
    
     if(
cache_get_row_count(babiloniadb) != 0)
    {
        return 
1;
    }
    return 
0;
    } 


Remember that 'CALLBACK' = function or Forward and public.


Thanks to all. And sorry for my bad english.


Re: [Help] Password string - Dello - 04.01.2018

UP. I really need this.


Re: [Help] Password string - jasperschellekens - 04.01.2018

I dont really understand it becuase i dont understand the language. Do you even check if the inputtext = equal to the players pw?


Re: [Help] Password string - iLearner - 05.01.2018

Because you have
PHP код:
SetPVarInt(playerid,"Logueado",1); 
                    
LoadAccountData(playerid); 
Under (!response).

Which means anyone can simply click button 2 of the dialog and login without and kind of verification.


Re: [Help] Password string - Dello - 05.01.2018

Ohhhh thanks, i will try this!!!


Re: [Help] Password string - Dello - 05.01.2018

Quote:
Originally Posted by jasperschellekens
Посмотреть сообщение
I dont really understand it becuase i dont understand the language. Do you even check if the inputtext = equal to the players pw?
Yes bro. Sorry for my bad english.

The password has encrypted anyway, but yes.