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':
And the code of 'PassValida':
Remember that 'CALLBACK' = function or Forward and public.
Thanks to all. And sorry for my bad english.
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(playerid, inputtext) && (strlen(inputtext) > 0))
{
if(GetPVarInt(playerid,"ErraContraseña") >= 2)
{
return Kick(playerid);
}
SetPVarInt(playerid,"ErraContraseña", GetPVarInt(playerid,"ErraContraseña")+1 );
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(playerid, dIngreso, DIALOG_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:
CALLBACK: PassValida(playerid, cadena[])
{
new query[1024];
format(query, sizeof(query),"SELECT * FROM usuarios WHERE Nombre = '%s' AND Clave = md5('%s')",pName(playerid), cadena);
mysql_query(babiloniadb, query, true);
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.