Hash error - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Hash error (
/showthread.php?tid=159543)
Hash error -
martyz-lithuania - 13.07.2010
I have the error and i don't know how to fix it :\
Код:
if(dialogid == 2)
{
if(response) //Login GUI
{
new pass[128];
format(query, 1024, "SELECT * FROM "SQL_PLAYERTABLE" WHERE Nick = '%s'",pInfo[playerid][Nick]);
mysql_query(query);
mysql_store_result();
mysql_fetch_row(sqlline);
mysql_fetch_field("Pass",pass);
if(MD5_Hash(inputtext) != pass)
{
ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Hefty Stuntages Login","Password incorrect!\nEnter the correct password:","Login","Iрeiti");
return 1;
}
SendClientMessage(playerid, COLOR_GREEN, "You succesfully logged in to your account.");
}
if(!response)
{
Kick(playerid);
}
return 1;
}
Error:
Код:
error 033: array must be indexed (variable "MD5_Hash")
On this line:
Код:
if(MD5_Hash(inputtext) != pass)
Re: Hash error -
Mr187 - 13.07.2010
https://sampforum.blast.hk/showthread.php?tid=152659
Re: Hash error -
martyz-lithuania - 13.07.2010
Are you sure thats all what i needed? I dont understand anything there..
Re: Hash error -
Mr187 - 13.07.2010
Quote:
Originally Posted by martyz-lithuania
Are you sure thats all what i needed? I dont understand anything there..
|
Pretty much tells you, Unless your using MySQL MD5 you won't beable to use MD5, The guy also explains how to use it, I dont want to be bothered to have to explain it, But pretty much if your running a new server my suggestion if you don't no how to work it for MySQL is don't use MD5 for passwords.
Re: Hash error -
RyDeR` - 13.07.2010
Try this:
pawn Код:
MD5_Hash(inputtext);
if(!strcmp(inputtext, pass, true))
{
// Same pass
}
else
{
// Not the same pass
}
Re: Hash error -
martyz-lithuania - 13.07.2010
Thanks very much, RyDeR`
Re: Hash error -
Sergei - 13.07.2010
Quote:
Originally Posted by Mr187
Pretty much tells you, Unless your using MySQL MD5 you won't beable to use MD5, The guy also explains how to use it, I dont want to be bothered to have to explain it, But pretty much if your running a new server my suggestion if you don't no how to work it for MySQL is don't use MD5 for passwords.
|
****** created and released MD5 include.