Login system needing help!
#6

Code:
	if(dialogid == MAINMENU || dialogid == MAINMENU2)
	{
		if(dialogid == MAINMENU)
		{
			if( response == 0 )
			{
				SendClientMessageEx(playerid, COLOR_RED, "SERVER: You have been kicked out automatically.");
				Kick(playerid);
			}
			else
			{
				if(strlen(inputtext))
				{
					new tmppass[64];
					strmid(tmppass, inputtext, 0, strlen(inputtext), 255);
					Encrypt(tmppass);
					if(PlayerInfo[playerid][pAdmin] > 0) {
					    ShowPlayerDialog(playerid, ADMINPIN, DIALOG_STYLE_INPUT, "Admin Pin Confirmation", "Please enter the pin that was assigned to your administrator account to continue.", "Login", "Cancel");
						PinLoginPass[playerid] = tmppass;
						SetTimerEx("AdminPinLogin",50*1000,0,"i",playerid);
					} else {
						OnPlayerLogin(playerid,tmppass);
					}
				}
				else
				{
					new loginname[64];
					GetPlayerName(playerid,loginname,sizeof(loginname));
					ShowPlayerDialog(playerid,MAINMENU,DIALOG_STYLE_INPUT,"Login","Incorrect password. \n \nThat name is registered, you may now enter your password.","Login","Exit");
					gPlayerLogTries[playerid] += 1;
					if(gPlayerLogTries[playerid] == 2) { SendClientMessageEx(playerid, COLOR_RED, "SERVER: Wrong password, you have been kicked out automatically."); Kick(playerid); }
				}
			}
		}
		if(dialogid == MAINMENU2)
		{
			if(strlen(inputtext))
			{
				GetPlayerName(playerid, sendername, sizeof(sendername));
				if(doesAccountExist(sendername))
				{
					SendClientMessageEx(playerid, COLOR_YELLOW, "That username is already taken, please choose a different one.");
					return 1;
				}
				new tmppass[64];
				strmid(tmppass, inputtext, 0, strlen(inputtext), 255);
				Encrypt(tmppass);
				OnPlayerRegister(playerid,tmppass);
			}
		}
	}
Reply


Messages In This Thread
Login system needing help! - by James Bob - 20.11.2012, 16:36
Re: Login system needing help! - by Mustafa6155 - 20.11.2012, 16:37
Re: Login system needing help! - by [Dejo] - 20.11.2012, 16:42
Re: Login system needing help! - by tyler12 - 20.11.2012, 16:43
Re: Login system needing help! - by park4bmx - 20.11.2012, 16:48
Re: Login system needing help! - by James Bob - 20.11.2012, 17:08
Re: Login system needing help! - by park4bmx - 20.11.2012, 17:22
Re: Login system needing help! - by James Bob - 20.11.2012, 17:47
Re: Login system needing help! - by park4bmx - 20.11.2012, 18:11
Re: Login system needing help! - by James Bob - 21.11.2012, 02:44

Forum Jump:


Users browsing this thread: 1 Guest(s)