AutoLogin Problem
#1

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.
Reply
#2

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


Forum Jump:


Users browsing this thread: 1 Guest(s)