Jump to content
  • 0

Help+


ravetoon

Question


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  2
  • Reputation:   0
  • Joined:  07/10/14
  • Last Seen:  

Want to limit 3ID to 1 IP with script?

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2346
  • Joined:  10/28/11
  • Last Seen:  

OnPCLoginEvent:
	query_sql("SELECT COUNT(`char_id`) FROM `char` WHERE `online` = 1 AND `account_id` IN (SELECT `account_id` FROM `login` WHERE `last_ip` = '"+getcharip()+"')", .@count);
	if (.@count >= 3) {
		mes "Login count per IP exceed.";
		sleep2 3000;
		atcommand "@kick "+strcharinfo(0);
	}
	end;

can try something like this.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  159
  • Reputation:   58
  • Joined:  07/11/14
  • Last Seen:  

Please give me more information!

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  924
  • Reputation:   167
  • Joined:  04/05/13
  • Last Seen:  

https://drive.google.com/open?id=1wdfhD8HS0zFrXRfDgxslAtqQkgseywan

-	script	king69	-1,{
OnPCLoginEvent:
	query_sql ("SELECT `last_ip` FROM `login` WHERE `account_id`=" + getcharid(3) + "", .@lip$);
	if ( getd("$" + .@lip$ + "_NG") > 0
			&& getd("$" + .@lip$ + "_NG2") > 0
			&& getd("$" + .@lip$ + "_NG3") > 0){
		iAmOver9000 = 1;
		atcommand "@kick " + strcharinfo(0);
		end;
	}
	if ( getd("$" + .@lip$ + "_NG") <= 0){
		setd "$" + .@lip$ + "_NG", 1;
		end;
	}else if ( getd("$" + .@lip$ + "_NG2") <= 0){
		setd "$" + .@lip$ + "_NG2", 1;
		end;
	}else if ( getd("$" + .@lip$ + "_NG3") <= 0){
		setd "$" + .@lip$ + "_NG3", 1;
		end;
	}
	end;
	
OnPCLogoutEvent:
	if(iAmOver9000>0)
	end;
	query_sql ("SELECT `last_ip` FROM `login` WHERE `account_id`=" + getcharid(3) + "", .@lip$);
	if ( getd("$" + .@lip$ + "_NG3") > 0){
		setd "$" + .@lip$ + "_NG3", 0;
		end;
	}else if ( getd("$" + .@lip$ + "_NG2") > 0){
		setd "$" + .@lip$ + "_NG2", 0;
		end;
	}else if ( getd("$" + .@lip$ + "_NG") > 0){
		setd "$" + .@lip$ + "_NG", 0;
		end;
	}
	end;
}

 

Edited by TARTs
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...