new buf[129]; WP_Hash(buf, 129, inputtext); if(!strcmp(buf, User[playerid][Password], false)) { etc etc etc etc etc return 1; }
// remove this new buf[129];
// remove this WP_Hash(buf, 129, inputtext); if(!strcmp(inputtext, User[playerid][Password], false)) // edit this buf to inputtext, like this <-- { |
//Login Dialog if(num_hash(inputtext) == User[playerid][Password]) {
if(dialogid == DIALOG_REGISTER) { if(response) { if(!IsValidPassword(inputtext)) { SendClientMessage(playerid, -1, ""chat" "COL_RED"The password is invalid, Valid characters are: A-Z, a-z, 0-9"); ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, ""COL_BLUE"SERVER NAME"COL_WHITE" Register pannel", ""chat" Please register to play on "COL_BLUE"SERVER NAME\n"COL_WHITE"Enter a "COL_BLUE"password"COL_WHITE":", "Register", "Exit"); return 1; } if(strlen(inputtext) < 3 || strlen(inputtext) > 24) { SendClientMessage(playerid, -1, ""chat" "COL_RED"The password is invalid, Its lenght should be 3-24 characters"); ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, ""COL_BLUE"SERVER NAME"COL_WHITE" Register pannel", ""chat" Please register to play on "COL_BLUE"SERVER NAME\n"COL_WHITE"Enter a "COL_BLUE"password"COL_WHITE":", "Register", "Exit"); return 1; } new Query[208]; format(Query, sizeof(Query), "INSERT INTO users (username, password) VALUES ('%s', '%s')", DB_Escape(User[playerid][UserName]), User[playerid][Password] == num_hash(inputtext));//DB_Escape(User[playerid][Password]),num_hash(inputtext)); db_query(Database, Query); User[playerid][Logged] = true; SendClientMessage(playerid, 0x00FF00FF, ""chat" "COL_LIGHTBLUE"You have just registered to our server! You have been automatically logged in!"); } else Kick(playerid); return 1; }