Login system needing help!
#1

Okay, so I have my login system scripted but ATM you can type any password and you are logged in.. I can't find the problem/error.. When I compile no error's at all

Code:
ShowMainMenuDialog(playerid, frame)
{
	new titlestring[64];
	new string[256];

	switch(frame)
	{
		case 1:
		{
			new ip[32];
			GetPlayerIp(playerid, ip, 32);
			format(titlestring, sizeof(titlestring), "Login - %s", GetPlayerNameEx(playerid));
			format(string, sizeof(string), "Welcome to High Street's Roleplay, %s.\n\nIP Address: 66.146.239.20:7777\n\nThe name that you are using is registered, please enter a password to login:", GetPlayerNameEx(playerid),  ip);
			ShowPlayerDialog(playerid,MAINMENU,DIALOG_STYLE_PASSWORD,titlestring,string,"Login","Exit");
		}
		case 2:
		{
			new ip[32];
			GetPlayerIp(playerid, ip, 32);
			format(titlestring, sizeof(titlestring), "Register - %s", GetPlayerNameEx(playerid));
			format(string, sizeof(string), "High Street's Roleplay, %s.\n\nIP Address: 66.146.239.20:7777 %s\n\nYou may register an account by entering a desired password here:", GetPlayerNameEx(playerid),  ip);
			ShowPlayerDialog(playerid,MAINMENU2,DIALOG_STYLE_PASSWORD,titlestring,string,"Register","Exit");
		}
		case 3:
		{
			new ip[32];
			GetPlayerIp(playerid, ip, 32);
			format(titlestring, sizeof(titlestring), "Login - %s", GetPlayerNameEx(playerid));
			format(string, sizeof(string), "Invalid Password!\n\nWelcome to High Street's Roleplay, %s.\n\nIP Address: 66.146.239.20:7777 %s\n\nThe name that you are using is registered, please enter a password to login:", GetPlayerNameEx(playerid),  ip);
			ShowPlayerDialog(playerid,MAINMENU,DIALOG_STYLE_PASSWORD,titlestring,string,"Login","Exit");
		}
	}
}
If you can help, I'll +Rep
Reply
#2

What do u mean?
Reply
#3

Dude, if you want that for some server, there are a lot of filterscripts login register system! just use them
Reply
#4

OnDialogResponse sir.
Reply
#5

you need to show the response of dialogid: MAINMENU
Reply
#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
#7

change
pawn Code:
if(strlen(inputtext))
To:
pawn Code:
if(!strcmp(inputtext,password,false))
//the "password" would be the variable to check their account's password
:NOTE: strlen si used to measure string length !
Reply
#8

C:\Users\***** *****\Desktop\Test\gamemodes\HSRP.pwn(7615 : error 017: undefined symbol "password"
C:\Users\***** *****\Desktop\Test\gamemodes\HSRP.pwn(76183) : error 017: undefined symbol "password"
Reply
#9

and now let me just quote my self.
Quote:
Originally Posted by park4bmx
View Post
//the "password" would be the variable to check their account's password
you will need to get the players save password and replace it with what ever variable you load it as
Reply
#10

Quote:
Originally Posted by park4bmx
View Post
and now let me just quote my self.

you will need to get the players save password and replace it with what ever variable you load it as
Park, would you have skype/TeamViewer? You have cofused me.. Haha.

If you have skype can you add me? im_smithhyyy
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)