PDA

View Full Version : register problem


gotwarzone
07/12/2013, 08:43 AM
Can someone please fix the else for registering? So if he click Quit button from the dialog registration he will be kicked.

I tried to make it right but I couldn't it just return the dialog registration.

stock ShowPlayerRegisterDialog(playerid)
{
new string[256];
format(string, sizeof(string), ""white"Welcome to "gold""#SERVER_NAME""white"\n"white"Your name "gold" %s "white"is not registered.\n\nPlease enter a password for your new account:", GetName(playerid), GetName(playerid));
ShowPlayerDialog(playerid, REGISTER_DIALOG, DIALOG_STYLE_PASSWORD, "Registration", string, "Register", "Quit");
return 1;
}


case REGISTER_DIALOG :
{
if(strlen(inputtext) < MIN_PASS_LEN || strlen(inputtext) > MAX_PASS_LEN || strlen(inputtext) == 0)
{
GameTextForPlayer(playerid, "~r~Invalid password length", 3000, 3);
ShowPlayerRegisterDialog(playerid);
}
else
{
KickEx(playerid);
}
CreateAccount(playerid, inputtext);
return 1;
}

I

Dragonsaurus
07/12/2013, 09:22 AM
case REGISTER_DIALOG :
{
if(!response) return KickEx(playerid);
if(strlen(inputtext) < MIN_PASS_LEN || strlen(inputtext) > MAX_PASS_LEN || strlen(inputtext) == 0)
{
GameTextForPlayer(playerid, "~r~Invalid password length", 3000, 3);
ShowPlayerRegisterDialog(playerid);
}
else CreateAccount(playerid, inputtext);
return 1;
}