Registration, Not saving/ Working
#1

Hello.

Today I bring to you my problem of Registration, Not saving. When you join the server for the first time your prompted to create a password, Once you have typed the password your meant to login. BUT what actually happens is Your prompted to create a password then it says "You have registered a account" (all fine so far) you then type your password in...and it loops you to registration again.

I have created a account for my self in the MySQL and that works fine, so its reading the data from the MySQL, its just not saving it. SO it must be a problem with the registration system.

Код:
#define LOGIN_DIALOG        1
#define REGISTER_DIALOG     2
Код:
 if (dialogid == LOGIN_DIALOG)
	{
	    if (response)
	    {
			if(!strlen(inputtext))
			{
			    SendClientMessage(playerid, COLOR_GRAD2, " Please input a password !");
				ShowPlayerDialog(playerid, LOGIN_DIALOG, 1, "{3399CC}Information", "{FFFFFF}You have an account here, please type below your password to login.", "Login", "Quit");
				return 1;
			}
			/*new string[128];
			format(string, sizeof(string), "users/%s.ini", PlayerName(playerid));
			if(!fexist(string))
			{
				SendClientMessage(playerid, COLOR_RED, "That Username is not taken, please use /register [password].");
				return 1;
			}*/
			if(!AccountExists(PlayerName(playerid)))
			{
				ShowPlayerDialog(playerid, REGISTER_DIALOG, 1, "{3399CC}Information", "{FFFFFF}You don't have an account here, please type below your password to register.", "Register", "Exit");
				return 1;
			}
			OnPlayerLogin(playerid,inputtext);
			return 1;
		}
		else
		{
		    Kick(playerid);
		    /*SendClientMessage(playerid,COLOR_LIGHTBLUE,"____________________________________________________");
		    SendClientMessage(playerid,COLOR_LIGHTBLUE,"              Hidden Life  Roleplay:");
		    SendClientMessage(playerid, COLOR_LIGHTBLUE, "[INFO]: You have an account here, please type /login <password> to login.");
            SendClientMessage(playerid,COLOR_LIGHTBLUE,"____________________________________________________");*/
		}
		return 1;
	}

	else if (dialogid == REGISTER_DIALOG)
	{
	    if (response)
	    {
		    if(!strlen(inputtext))
			{
	  			SendClientMessage(playerid, COLOR_GRAD2, " Please input a password !");
				ShowPlayerDialog(playerid, REGISTER_DIALOG, 1, "{3399CC}Information", "{FFFFFF}You don't have an account here, please type below your password to register.", "Register", "Quit");
				return 1;
			}
			/*new playername[24], string[128];
			GetPlayerName(playerid, playername, sizeof(playername));
			format(string, sizeof(string), "users/%s.ini", playername);*/
			PlayerInfo[playerid][pCash] = GetPlayerPCash(playerid);
			OnPlayerRegister(playerid, inputtext);
			ShowPlayerDialog(playerid, LOGIN_DIALOG, 1, "{3399CC}Information", "{FF0000}You've registered an account!\n{FFFFFF}You have an account here, please type below your password to login.", "Login", "Quit");

			strmid(PlayerInfo[playerid][pPassword], inputtext, 0, strlen(inputtext), 255);
			PlayerInfo[playerid][pLevel] = 1;
			return 1;
		}
		else
		{
		    Kick(playerid);
		    /*SendClientMessage(playerid,COLOR_LIGHTBLUE,"____________________________________________________");
		    SendClientMessage(playerid,COLOR_LIGHTBLUE,"              Hidden Life  Roleplay:");
		    SendClientMessage(playerid, COLOR_LIGHTBLUE, "[INFO]: You don't have an account here, please type /register <password> to register.");
		    SendClientMessage(playerid,COLOR_LIGHTBLUE,"____________________________________________________");*/
		}
		return 1;
	}
You can also see for your self using the IP in my signature.

Please Help ASAP

Thanks
Reply


Messages In This Thread
Registration, Not saving/ Working - by stueycow - 19.12.2013, 16:20
Re: Registration, Not saving/ Working - by stueycow - 20.12.2013, 14:23

Forum Jump:


Users browsing this thread: 1 Guest(s)