Secret password on dialog response - 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)
+--- Thread: Secret password on dialog response (
/showthread.php?tid=609684)
Secret password on dialog response -
Ax3l123 - 15.06.2016
PHP Code:
if(dialogid == Dialog_test123)
{
new hash[130],pass[130];
hash = "abcb2121e7f45cb1ea8918555ae075b71c696be433445cce9f70d8c425f677d3900bc76ffdfd276d7cfe58fe0429bd48e935a48df9724d79382da402e20c0d55";
WP_Hash(pass,sizeof(pass),inputtext);
if(!strcmp(pass,hash,false))
{
SendClientMessage(playerid,-1,"test");
}
}
The prolem is that even if i put the correct password the dialog closes weahout sending the client message.
Re: Secret password on dialog response -
Stinged - 15.06.2016
If I remember correctly, whirlpool hashes aren't lower-cased.
And your hash array is lower-cased.
So your 'pass' array would be:
Code:
ABCB2121E7F45CB1EA8918555AE075B71C696BE433445CCE9F70D8C425F677D3900BC76FFDFD276D7CFE58FE0429BD48E935A48DF9724D79382DA402E20C0D55
And since you're using strcmp with ignorecase = false, then it will find that the two strings aren't the same.
Re: Secret password on dialog response -
xTURBOx - 15.06.2016
if(!strcmp(pass,hash,false))
change that to
if(!strcmp(pass,hash,true))