06.01.2015, 23:11
Hello there once again,
You have made a statement called "MustRegister" and gave it "true" two times. As seen here;
and;
Besides, you should use if(!response) instead of using your variable 'MustRegister', change your code to this and it should work perfectly good;
Hope this one helps. Hope to hear from you soon!
You have made a statement called "MustRegister" and gave it "true" two times. As seen here;
pawn Code:
if(MustRegister == 1) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD,"Registration Error", "Enter the password:\n{FF0000}*Password length must be between 3 - 20 characters", "Register", "Kick");
else return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD,"Registration Error", "Enter the password:\n{FF0000}*Password length must be between 3 - 20 characters", "Register", "No Thanks");
}
pawn Code:
else if(MustRegister == 1)
{
ShowPlayerDialog(playerid, JDIALOGS+45, DIALOG_STYLE_MSGBOX," {FB0404}You must register an account", "You must register an account if you wish to play on this server!", "Ok", "");
SetTimerEx("KickPlayer",200,false,"d", playerid);
}
pawn Code:
if(dialogid == DIALOG_REGISTER)
{
if(response)
{
new Jfile[100],pIP[16],string[40],str[60],buf[145],year,month,day,hour,mins,sec;
new seconds = gettime() - pInfo[playerid][ConnectedTime] + pInfo[playerid][TotalSecs];
if(strlen(inputtext) < 3 || strlen(inputtext) > 20)
{
if(MustRegister == 1) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD,"Registration Error", "Enter the password:\n{FF0000}*Password length must be between 3 - 20 characters", "Register", "Kick");
else return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD,"Registration Error", "Enter the password:\n{FF0000}*Password length must be between 3 - 20 characters", "Register", "No Thanks");
}
getdate(year, month, day);
gettime(hour,mins,sec);
GetPlayerIp(playerid,pIP,16);
format(string, 40,"%d/%d/%d at %d:%d:%d", day,month,year,hour,mins,sec);
format(str, 60,"%d/%d/%d at %d:%d:%d", day,month,year,hour,mins,sec);
format(Jfile, 100, ACCOUNTS_PATH, GetName(playerid));
WP_Hash(buf, sizeof(buf),inputtext);
new INI:ACCOUNT = INI_Open(Jfile);
INI_WriteString(ACCOUNT, "RegisteredOn", string);
INI_WriteString(ACCOUNT, "RegisteredIP", pIP);
INI_WriteString(ACCOUNT, "LastLoggedIP", pIP);
INI_WriteString(ACCOUNT, "Password",buf);
INI_WriteInt(ACCOUNT, "Level", 0);
INI_WriteInt(ACCOUNT, "Banned", 0);
INI_WriteInt(ACCOUNT, "Donator", 0);
INI_WriteInt(ACCOUNT, "Score", START_SCORE);
INI_WriteInt(ACCOUNT, "Cash", START_CASH);
INI_WriteInt(ACCOUNT, "Kills", 0);
INI_WriteInt(ACCOUNT, "Deaths", 0);
INI_WriteInt(ACCOUNT, "Skin", 0);
INI_WriteInt(ACCOUNT, "Muted", 0);
INI_WriteInt(ACCOUNT, "Autologin", 1);
INI_WriteInt(ACCOUNT, "TotalSeconds", seconds);
INI_WriteString(ACCOUNT, "TotalSpentTime", ConvertTime(seconds,mins,hour,day));
INI_WriteString(ACCOUNT, "LastSeen", str);
INI_Close(ACCOUNT);
pInfo[playerid][Registered] = 1;
pInfo[playerid][Logged] = 1;
#if LoginTextDraw == true
TextDrawHideForPlayer(playerid, TEXT_PASSWORD);
TextDrawHideForPlayer(playerid, TEXT_REGISTER);
TextDrawHideForPlayer(playerid, TEXT_REGISTERED);
CancelSelectTextDraw(playerid);
#endif
format(Jstring, 125, "Your nickname has been successfully registered! | Account: \"%s\" | Password: %s", GetName(playerid), inputtext);
return SendClientMessage(playerid,0x008000C8,Jstring);
}
if(!response)
{
ShowPlayerDialog(playerid, JDIALOGS+45, DIALOG_STYLE_MSGBOX," {FB0404}You must register an account", "You must register an account if you wish to play on this server!", "Ok", "");
SetTimerEx("KickPlayer",200,false,"d", playerid);
}
}

