04.01.2018, 19:58
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 код:
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 код:
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.