22.07.2015, 00:16
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", 1000, false, "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(hashpass, DB[playerid][Password], false)){
if(FirstTry[playerid] == false && LastTry[playerid] == false){MSG(playerid,C_RED,"[ERROR] {ff7777}Wrong password! 2 attempts left."); FirstTry[playerid] = true; DLG(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] = false; LastTry[playerid] = true; DLG(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", 1000, false, "i", playerid);}
return 1;}