Jump to content
  • 0

Disabled Dual Client in a Certain map


Question

5 answers to this question

Recommended Posts

Posted

If you only want to allow 1 char per IP in a certain map, you could do something like this:

prontera,155,188,0	script	TestNPC	910,{
if (callfunc("has_char_from_same_ip", "guild_vs2")) {
	mes "There is already a char from your IP on guild_vs2.";
} else {
	warp "guild_vs2",0,0;
}
close;
}


function	script	has_char_from_same_ip	{
set .@my_map$, getarg(0);
// get array of char names who are online from the same IP
query_sql "SELECT `char`.`name` FROM `char` LEFT JOIN login ON `char`.account_id=login.account_id " + 
          "WHERE last_ip=(SELECT last_ip FROM login WHERE account_id="+playerattached()+") AND online AND `char`.account_id!=" + playerattached(), .@name$;
// check each char, and see if they are on the map
for (set .@i,0; .@i < getarraysize(.@name$); set .@i,.@i+1) {
	getmapxy .@map$, .@x, .@y, 0, .@name$[.@i];
	if (.@map$ == .@my_map$)
		return 1; // another char from this IP is already on map
}
return 0; // no other chars from this IP are on that map
}

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