Registration, Saving in the wrong place
#1

Hello.

I am wanting to make my server remonstration save in MySQl not ini so, how do i do this?

As you can see in the following code, its saving in .ini I want it to save in my sql player database. So how do i do this?

Код:
 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;
	}

----

Also, I am wanting to make a system where you can register via my website for a IG account. Where it sets a account up instatly. How do i do that. Is there a system existing?

Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)