SA-MP Forums Archive
AutoLogin Problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: AutoLogin Problem (/showthread.php?tid=97705)



AutoLogin Problem - CJ101 - 16.09.2009

Today i found out that someone was getting on my account on my server, and it autologged in for him.

OnPlayerConnect:
Код:
	new plname[MAX_PLAYER_NAME];
  	GetPlayerName(playerid, plname, sizeof plname);
	format(plname, sizeof plname, "%s.ini", plname);
    if(fexist(plname))
	{
	new ip[16];
    GetPlayerIp(playerid,ip,sizeof(ip));
    if(!strcmp(ip,Stats[playerid][IP],true))
      {
      SendClientMessage(playerid,CONNECT1,"You have been automatically logged in.");
       LoginPlayer(playerid,Stats[playerid][aPassword]);
      }
      else
      {
	  SendClientMessage(playerid,CONNECT1,"You are registered, please /login.");
	  }
	}
	else
	{
	SendClientMessage(playerid,COLOR_RED,"You are not registered, you should /register to recieve all benefits.");
	}
i blame firefox for the indentation.


Re: AutoLogin Problem - Clavius - 16.09.2009

Did you get the original IP of the account from the file, and saved it to Stats[playerid][IP] before autologin?