Jump to content
  • 0
Sign in to follow this  
Aegiskore

User log-in limitation per IP

Question

Hi,

 

I found this script in RA, just want to know if this will also work in Herc.

 

Basically, I want to limit 4 accounts only per IP but that doesn't include the @autotraders.

 

-	script	Only4perIP	-1,{OnPCLoginEvent:	if (getgmlevel() >= 99) end;	set .@myname$, strcharinfo(0);	if (query_sql("SELECT `char`.`name` FROM `char` LEFT JOIN login ON `char`.account_id=login.account_id WHERE login.last_ip='"+getcharip()+"' AND `char`.online=1 AND `char`.char_id!="+getcharid(0), .@name$) >= 4) {		for (set .@i,0; .@i<getarraysize(.@name$); set .@i,.@i+1) {			if (checkvending(.@name$[.@i]) != 2)				set .@sameip, .@sameip +1;		}		if (.@sameip >= 4) {			announce "Sorry, only 4 accounts per IP can be logged in at a time.", bc_self;			sleep 1000;			atcommand "@kick " + .@myname$;		}	}	end;}

 

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

try this

-	script	Only4perIP	-1,{OnPCLoginEvent:if( query_sql("SELECT name FROM `char` LEFT JOIN login ON `char`.account_id = `login`.account_id WHERE `login`.last_ip='"+getcharip()+"' AND `char`.online=1 AND `char`.char_id!="+getcharid(0)+" AND `char`.account_id NOT IN (SELECT account_id FROM `autotrade_merchants`)",.@name$) >4 ) {	announce "Sorry, only 4 accounts per IP can be logged in at a time.", bc_self;        sleep 1000;        atcommand "@kick "+strcharinfo(0);}end;}
Edited by Angelmelody

Share this post


Link to post
Share on other sites
  • 0

 

try this

-	script	Only4perIP	-1,{OnPCLoginEvent:if( query_sql("SELECT name FROM `char` LEFT JOIN login ON `char`.account_id = `login`.account_id WHERE `login`.last_ip='"+getcharip()+"' AND `char`.online=1 AND `char`.char_id!="+getcharid(0)+" AND `char`.account_id NOT IN (SELECT account_id FROM `autotrade_merchants`)",.@name$) >4 ) {	announce "Sorry, only 4 accounts per IP can be logged in at a time.", bc_self;        sleep 1000;        atcommand "@kick "+strcharinfo(0);}end;}

 

this works well, thanks :)

Edited by Freezer

Share this post


Link to post
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.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.