Hash error
#1

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)
Reply
#2

https://sampforum.blast.hk/showthread.php?tid=152659
Reply
#3

Are you sure thats all what i needed? I dont understand anything there..
Reply
#4

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.
Reply
#5

Try this:

pawn Код:
MD5_Hash(inputtext);
if(!strcmp(inputtext, pass, true))
{
        // Same pass
}
else
{
        // Not the same pass
}
Reply
#6

Thanks very much, RyDeR`
Reply
#7

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)