User log-in limitation per IP

Aegiskore

New member
Messages
12
Points
0
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.

Code:
-	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;}
 
try this

Code:
-	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;}
 
Last edited by a moderator:
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
default_smile.png


 
Last edited by a moderator:
Back
Top