how does i make auto login and login before spawn ?
#1

how does i make auto login and login before spawn ?
my register sys from here
http://forum.sa-mp.com/index.php?topic=126584.0
help ?
Reply
#2

When they Join server Get their IP, and compare them with a IP saved in their file(you should do this when they register), if both are same the make them singin, if they are not prompt them for password, and when they successfully type the password change their last ip in the file to present ip.
Reply
#3

can give me some scripit 2 see how it looks
Reply
#4

pliz help
Reply
#5

Save the IP when they register... (and update when they login)...

then OnPlayerConnect, check if their ip is the same as one of the registerd account.. tis was explained by cloud9
Reply
#6

Replace all the dini code with whatever method you use for reading from files.

I assume you already have /register and /login commands. If not, try making them first.

Code:
	GetPlayerName(playerid, name, sizeof(name));	// Store the players name.
	format(file, sizeof(file), "%s.ini", name);	// Get .ini filename according to player name
	if(fexist(file))	// If the file exists...
	{
	  GetPlayerIp(playerid, ip, sizeof(ip));	// Get the players IP.
	  tmp = dini_Get(file, "ip");		// This one uses dini for simplicity. Replace with your own read_file code.
	  if(strval(tmp) != strval(ip))		// If the current IP does not == the one from the file...
	  {
		  SendClientMessage(playerid, COLOR_YELLOW, "That nick is registered. Please change name or /login");	// Tell them they need to log in manually.
		}
		else
		{
		  gPlayerLogged[playerid] = 1;	// Logged in variable.
		  SendClientMessage(playerid, COLOR_SUCCESS, "You have been automatically logged in.");	// Tell them they have been logged in.
		}
	}
Reply
#7

Im sure he will get error: Undefined Symbol name, nice copy and paste work fooll...
Reply
#8

Fool? At least I provided an example.. Not just a method that they probably won't understand.

All that needs doing is adding a couple of "new" commands. And I'm pretty sure they will already exist in the script anyway.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)