Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

[Help] Password string

$
0
0
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 Code:

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 Code:

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.

Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>