Secret password on dialog response
#1

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

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

if(!strcmp(pass,hash,false))

change that to

if(!strcmp(pass,hash,true))
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)