Strcmp
#1

PHP Code:
if(dialogid == 1){
    if(!
strval(inputtext)) return DLG(playerid,0,DIALOG_STYLE_PASSWORD,"Login","{d6d681}Hello there and welcome back to Gangsta Regeneration Roleplay!\nPlease enter your current password to get access to your account.","Login","");
    if(!
response){MSG(playerid,C_RED,"See you!"); SetTimerEx("KickDelay"1000false"i"playerid);}
    new 
hashpass[129]; //Will create a new variable to hash his/her password
    
WP_Hash(hashpass,sizeof(hashpass),inputtext); //Will hash inputted password
    
if(!strcmp(hashpassDB[playerid][Password], false)){
    if(
FirstTry[playerid] == false && LastTry[playerid] == false){MSG(playerid,C_RED,"[ERROR] {ff7777}Wrong password! 2 attempts left."); FirstTry[playerid] = trueDLG(playerid,1,DIALOG_STYLE_PASSWORD,"Login","{d6d681}Hello there and welcome back to Gangsta Regeneration Roleplay!\nPlease enter your current password to get access to your account.","Login",""); return 1;}
    if(
FirstTry[playerid] == true){MSG(playerid,C_RED,"[ERROR] {ff7777}Wrong password! 1 attempt left."); FirstTry[playerid] = falseLastTry[playerid] = trueDLG(playerid,1,DIALOG_STYLE_PASSWORD,"Login","{d6d681}Hello there and welcome back to Gangsta Regeneration Roleplay!\nPlease enter your current password to get access to your account.","Login",""); return 1;}
    if(
LastTry[playerid] == true){MSG(playerid,C_RED,"[ERROR] {ff7777}Wrong password! See you."); SetTimerEx("KickDelay"1000false"i"playerid);}
    return 
1;} 
Everytime even the password is right or wrong it's shows me that the password is wrong, if i'm removing the ! from the !strcmp it's showing that the password is right even if its right and even if it's wrong.
Reply


Messages In This Thread
Strcmp - by Lirbo - 22.07.2015, 00:16
Re: Strcmp - by SickAttack - 22.07.2015, 00:50
Re: Strcmp - by Lirbo - 22.07.2015, 01:38
Re: Strcmp - by SickAttack - 22.07.2015, 01:44
Re: Strcmp - by Lirbo - 22.07.2015, 02:18
Re: Strcmp - by SickAttack - 22.07.2015, 02:30
Re: Strcmp - by Lirbo - 22.07.2015, 02:50
Re: Strcmp - by SickAttack - 22.07.2015, 03:02

Forum Jump:


Users browsing this thread: 1 Guest(s)