02.08.2016, 11:56
Hello! I have been trying to create a script that enters password with Whirlpool and other details into mySQL on registration. All other information is input to the database except the password field that remains blank.
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if (dialogid == DIALOG_REGISTER) { if (response) { if(strlen(inputtext) < 11 || strlen(inputtext) > 29 ) { ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Register", ""RED"Your password must be between 11 and 29 characters long.\n"WHITE"Choose and enter a password:", "Register", "Quit"); } else { new query[150]; new playerName[MAX_PLAYER_NAME]; GetPlayerName(playerid, playerName, sizeof(playerName)); WP_Hash(PlayerInfo[playerid][Password], 129, inputtext); mysql_format(dbHandle, query, sizeof(query), "INSERT INTO `players` (`Name`, `Password`, `Cash`) VALUES ('%s', '%s', %d)", playerName, PlayerInfo[playerid][Password], starterCash); mysql_tquery(dbHandle, query, "RegisterAccount", "i", playerid); } } else { Kick(playerid); } } return 1; }