Jump to content
  • 0

Anti multi login by ip - Need to exclude AT Merchants!


iraciz

Question


  • Group:  Members
  • Topic Count:  140
  • Topics Per Day:  0.03
  • Content Count:  562
  • Reputation:   107
  • Joined:  10/05/12
  • Last Seen:  

Good Day,
I found this script, and it's working fine, but is also counting the autotrade merchants! to the point if you have an autotrade logged out, you can't dual login!

Any possible way to not count the autotrade merchants in this script? In order to keep an autotrade vending and still log with two maximun same ip accounts.

Thanks in advance.

-	script	Only2perIP	-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$) >= 2) {
	for (set .@i,0; .@i<getarraysize(.@name$); set .@i,.@i+1) {
		if (checkvending(.@name$[.@i]) != 2)
			set .@sameip, .@sameip +1;
	}
	if (.@sameip >= 2) {
		announce "Sorry, only 2 accounts per IP can be logged in at a time.", bc_self;
		sleep 1000;
		atcommand "@kick " + .@myname$;
	}
}
end;
}

 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  140
  • Topics Per Day:  0.03
  • Content Count:  562
  • Reputation:   107
  • Joined:  10/05/12
  • Last Seen:  

Solved by my own means.

satanbitch1.thumb.png.d8ffa6cbd9e309af3d33d0eaa7efb26e.png

Autotrade merchants are not counting in the multi login ip filter,
Only 3 accounts per IP and the fourth was kicked.

Also added an exception, just in case there are confirmed brothers, couples, etcm in different pcs but using same ip:

if (#brothers) end;

 

-	script	Only3perIP	-1,{
OnPCLoginEvent:
if (getgmlevel() >= 99) end;
if (#brothers) 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$) >= 2) {
	for (set .@i,0; .@i<getarraysize(.@name$); set .@i,.@i+1) {
		if (!checkvending(.@name$[.@i]) )
			set .@sameip, .@sameip +1;
	}
	if (.@sameip >= 3) {
		announce "Lo sentimos, Solo se permite un maximo de 3 cuentas logeadas por IP.", bc_self;
		mes "Suzaku Ro";
		mes "Lo sentimos, solo  se permite un maximo de 3 cuentas logeadas por IP!";
		sleep 4000;
		atcommand "@kick " + .@myname$;
	}
}
end;
}

 

Edited by iraciz
  • Like 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.01
  • Content Count:  130
  • Reputation:   70
  • Joined:  09/03/14
  • Last Seen:  

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.02
  • Content Count:  106
  • Reputation:   1
  • Joined:  09/24/19
  • Last Seen:  

On 6/17/2020 at 7:32 PM, iraciz said:

Solved by my own means.

satanbitch1.thumb.png.d8ffa6cbd9e309af3d33d0eaa7efb26e.png

Autotrade merchants are not counting in the multi login ip filter,
Only 3 accounts per IP and the fourth was kicked.

Also added an exception, just in case there are confirmed brothers, couples, etcm in different pcs but using same ip:

if (#brothers) end;

 

-	script	Only3perIP	-1,{
OnPCLoginEvent:
if (getgmlevel() >= 99) end;
if (#brothers) 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$) >= 2) {
	for (set .@i,0; .@i<getarraysize(.@name$); set .@i,.@i+1) {
		if (!checkvending(.@name$[.@i]) )
			set .@sameip, .@sameip +1;
	}
	if (.@sameip >= 3) {
		announce "Lo sentimos, Solo se permite un maximo de 3 cuentas logeadas por IP.", bc_self;
		mes "Suzaku Ro";
		mes "Lo sentimos, solo  se permite un maximo de 3 cuentas logeadas por IP!";
		sleep 4000;
		atcommand "@kick " + .@myname$;
	}
}
end;
}

 

What should I do if I only want maximum to be a logged account without counting the autotrades and let another pc with the same ip also connect an example that they are brothers as you say and that each one can be logged in to their pc

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...