Jump to content
  • 0

Question

3 answers to this question

Recommended Posts

  • 0
Posted
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.

  • 0
Posted (edited)

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

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...