03.04.2013, 03:10
(
Последний раз редактировалось BittleRyan; 03.04.2013 в 04:46.
)
pawn Код:
case DIALOG_CREATE_PASSWORD:
{
if(!response || isnull(inputtext)) return ClearChat(playerid), SendClientMessage(playerid, COLOR_RED, "Notice: You have been kicked as you did not want to register. You may rejoin at anytime!"), Kick(playerid);
if(response)
{
if(strlen(inputtext) < 4 || strlen(inputtext) > 21) return SendClientMessage(playerid, COLOR_LIGHTRED, "Your password cannot have more than 20 letters/numbers or less than 4 letters/numbers"), ShowPlayerDialog(playerid, DIALOG_CREATE_PASSWORD, DIALOG_STYLE_PASSWORD, "Create a Password", "Pleae create a secure password. Your password must be between 4-20 characters.", "Next", "Cancel");
else
{
strcat(TempPassword[playerid], inputtext, sizeof(TempPassword));
SendClientMessage(playerid, COLOR_WHITE, "Great, now please confirm your password!"), ShowPlayerDialog(playerid, DIALOG_CREATE_PASSWORD_CONFIRM, DIALOG_STYLE_PASSWORD, "Confirm your Password", "Please confirm that you know your password. If you cannot enter it as before, you will need to recreate one", "Next", "Cancel");
}
}
}
case DIALOG_CREATE_PASSWORD_CONFIRM:
{
if(!response || isnull(inputtext)) return ClearChat(playerid), SendClientMessage(playerid, COLOR_RED, "Notice: You have been kicked as you did not want to register. You may rejoin at anytime!"), Kick(playerid);
if(response)
{
if(!strcmp(inputtext, TempPassword[playerid], false))
{
SendClientMessage(playerid, COLOR_WHITE, "Okay, great! Now enter a valid email address. We will only contact you if it is nessessary.");
new buffer[129];
WP_Hash(buffer, sizeof(buffer), inputtext);
pInfo[playerid][pPassword] = buffer;
ShowPlayerDialog(playerid, DIALOG_SET_EMAIL, DIALOG_STYLE_INPUT, "Email Address", "Please enter a valid email address so we can contact you in the future. We may contact you about administrative actions or server news!", "Next", "Close");
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: The passwords did not match. Please recreate your password!");
ShowPlayerDialog(playerid, DIALOG_CREATE_PASSWORD, DIALOG_STYLE_PASSWORD, "Create a Password", "Pleae create a secure password. Your password must be between 4-20 characters.", "Next", "Cancel");
}
}
}
It works as designed if both passwords match the first time, but if you screw up it will always give you the else statement even if they match on the confirm password dialog.
Any ideas?