Jump to content
  • 0

Help with Dual Client Blocker


Guih

Question


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  40
  • Reputation:   0
  • Joined:  11/25/12
  • Last Seen:  

Hello guys! So, i got this script from here and I need to do a few modifications that I've tried, but no success.

 

This is the original script:

-	script	dualclientkicker	-1,{
OnPCLoadMapEvent:
	set .@charmap$, strcharinfo(3);
	if(!compare(.tmp$,.@charmap$)) end;
	set .@len, query_sql("select account_id from `char` right join login on login.account_id = `char`.account_id where `char`.online = 1 and login.last_ip = '"+ getcharip() +"'",.@a ); //Annieruru Addition.
	if(.@len-1) {
		for(set(.@d,0);.@d<.@len;set(.@d,.@d+1)) {
			getmapxy(.@map$,.@x,.@y,0,rid2name(.@a[.@d]));
			if(.@charmap$==.@map$&&rid2name(.@a[.@d])!=strcharinfo(0)) {
				dispbottom "Dual Client não disponível nesse mapa.";
				warp "vilasyn",91,54;
			}
		}
	}
	end;
	
OnInit:
	setarray   .maps$  ,	"aldeg_cas01", "gefg_cas01", "payg_cas01", "prtg_cas01", "guild_vs3";
	set        .lens   ,	getarraysize(.maps$)                                   ;
	for(set(.a,0);.a<.lens;set(.a,.a+1)) {
		setmapflag .maps$[.a],	mf_loadevent ;
		set .tmp$  ,.tmp$+.maps$[.a]+",";
	}
}

I'd like to make it look after the last_mac field instead of the last_ip field. And also, I have a separated login database, I tried this:

query_sql("select account_id from DB1.`char` right join DB2.login on login.account_id = `char`.account_id where `char`.online = 1 and login.last_ip = '"+ getcharip() +"'",.@a );

But no success.

 

Could anyone help me in these two situations?

 

Thanks in advance!

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

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

login.last_ip

change to

login.last_mac

default i believe should be `last_mac` unless your SQL table column name is different, then change accordingly.

getcharip()

change to

getcharmac()   // if you have the relevant script command to get MAC.

otherwise you might need some workaround to get the MAC address.

Ex

SELECT `last_mac` FROM `login` WHERE `account_id` = "+getcharid(3)
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  40
  • Reputation:   0
  • Joined:  11/25/12
  • Last Seen:  

Thanks for answering Emistry, I changed the script as you suggested:

-	script	dualclientkicker	-1,{
OnPCLoadMapEvent:
	set .@charmap$, strcharinfo(3);
	if(!compare(.tmp$,.@charmap$)) end;
	set .@len, query_sql("select account_id from `char` right join login on login.account_id = `char`.account_id where `char`.online = 1 and login.last_mac = '"+ getcharmac() +"'",.@a ); //Annieruru Addition.
	if(.@len-1) {
		for(set(.@d,0);.@d<.@len;set(.@d,.@d+1)) {
			getmapxy(.@map$,.@x,.@y,0,rid2name(.@a[.@d]));
			if(.@charmap$==.@map$&&rid2name(.@a[.@d])!=strcharinfo(0)) {
				dispbottom "Dual Client não disponível nesse mapa.";
				warp "vilasyn",91,54;
			}
		}
	}
	end;
	
OnInit:
	setarray   .maps$  ,	"aldeg_cas01", "gefg_cas01", "payg_cas01", "prtg_cas01", "guild_vs3";
	set        .lens   ,	getarraysize(.maps$)                                   ;
	for(set(.a,0);.a<.lens;set(.a,.a+1)) {
		setmapflag .maps$[.a],	mf_loadevent ;
		set .tmp$  ,.tmp$+.maps$[.a]+",";
	}
}

But now I got this error:

parse_callfunc: expected ')' to close argument list

On this line and function: 

set .@len, query_sql("select account_id from `char` right join login on login.account_id = `char`.account_id where `char`.online = 1 and login.last_mac = '"+ getcharmac() +"'",.@a ); //Annieruru Addition.

getcharmac()

So i guess I'll have to use the other method you told me about, but how can I insert it into this NPC? Thanks.

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