Jump to content
  • 0
Damon

Forbidden same IP on few maps

Question

Hi !

I wanted to know if it was possible a script that would forbidden two (or more) people on the same map.

(For example, in BG).

Thanks a lot :)

Link to comment
Share on other sites

19 answers to this question

Recommended Posts

  • 1

Hi !

Thx, its work.

And if i want add other map ? (Yep, i add maps on ---Enable map OnPCLoadMapEvent--- but,

I'm pretty sure :

if([email protected]$!="quiz_00","quiz01") end; 

doesn't work.

So, what i can do ? :)

Link to comment
Share on other sites

-	script	abcde	-1,{
OnPCLoadMapEvent:

	   getmapxy([email protected]$,[email protected],[email protected],0);

	   if([email protected]$!="quiz_00") end;  

		query_sql("SELECT last_ip FROM `login` WHERE account_id = "+getcharid(3)+"", [email protected]$);
		query_sql("SELECT account_id FROM `login` WHERE last_ip = '"[email protected]$+"'", [email protected]);
		set [email protected],getcharid(3,strcharinfo(0));

		for(set [email protected] ,0;[email protected]<getarraysize([email protected]);set [email protected],[email protected]+1)
		   {
			 if(attachrid([email protected][[email protected]]))
				{
				  getmapxy([email protected]$,[email protected],[email protected],0);
				  if ([email protected]$== [email protected]$) set [email protected],[email protected]+1;
				 }
				detachrid;
		   }
		attachrid [email protected];
		if([email protected] > [email protected])
			  warp "SavePoint",0,0;	
end;

OnInit:

set [email protected],1;
end;

}

//------Enable map OnPCLoadMapEvent-------------------
quiz_00	mapflag	loadevent

  • Upvote 1
Link to comment
Share on other sites

-	script	abcde	-1,{
OnPCLoadMapEvent:

	   getmapxy([email protected]$,[email protected],[email protected],0);

	   if([email protected]$!="quiz_00") end;  

		query_sql("SELECT last_ip FROM `login` WHERE account_id = "+getcharid(3)+"", [email protected]$);
		query_sql("SELECT account_id FROM `login` WHERE last_ip = '"[email protected]$+"'", [email protected]);
		set [email protected],getcharid(3,strcharinfo(0));

		for(set [email protected] ,0;[email protected]<getarraysize([email protected]);set [email protected],[email protected]+1)
		   {
			 if(attachrid([email protected][[email protected]]))
				{
				  getmapxy([email protected]$,[email protected],[email protected],0);
				  if ([email protected]$== [email protected]$) set [email protected],[email protected]+1;
				 }
				detachrid;
		   }
		attachrid [email protected];
		if([email protected] > [email protected])
			  warp "SavePoint",0,0;	
end;

OnInit:

set [email protected],1;
end;

}

//------Enable map OnPCLoadMapEvent-------------------
quiz_00	mapflag	loadevent

It works only with static IP addresses. Dynamic IP's will ignore this script.

Link to comment
Share on other sites

if([email protected]$!="quiz_00","quiz01") end;

You have to do it like this:

if([email protected]$!="quiz_00" || [email protected]$ !="quiz01") end;

you have to use && instead of ||

should be

if([email protected]$!="quiz_00" && [email protected]$ !="quiz01") end;

  • Upvote 1
Link to comment
Share on other sites

i test it it doesnt work ..it kick me out even im not using dual .

- script abcde -1,{

OnPCLoadMapEvent:

getmapxy([email protected]$,[email protected],[email protected],0);

if([email protected]$!="bat_room") end;

query_sql("SELECT last_ip FROM `login` WHERE account_id = "+getcharid(3)+"", [email protected]$);

query_sql("SELECT account_id FROM `login` WHERE last_ip = '"[email protected]$+"'", [email protected]);

set [email protected],getcharid(3,strcharinfo(0));

for(set [email protected] ,0;[email protected]<getarraysize([email protected]);set [email protected],[email protected]+1)

{

if(attachrid([email protected][[email protected]]))

{

getmapxy([email protected]$,[email protected],[email protected],0);

if ([email protected]$== [email protected]$) set [email protected],[email protected]+1;

}

detachrid;

}

attachrid [email protected];

if([email protected] > [email protected])

announce "Dual Account Detected!",bc_self,0xEE6AA7;

warp "SavePoint",0,0;

end;

OnInit:

set [email protected],1;

end;

}

bat_room mapflag loadevent

Link to comment
Share on other sites

you have to use && instead of ||

should be

if([email protected]$!="quiz_00" && [email protected]$ !="quiz01") end;

It should be OR(||) or it wont work unless that person has 2 identity that exist in those 2 maps at the same time.

:) ...check the script carefully....

he want to NOT apply to this 2 maps only.....

quiz00    or    quiz01

if he is out of these 2 map....the script will run...

that's why..........

when u see the inside the script...separately...

it is like this

[email protected]$ != "quiz_00"
[email protected]$ != "quiz_00"

as you can can see here....he using "NOT EQUAL TO" ( != ) symbol

so..when your script like this...

if( [email protected]$!="quiz_00" || [email protected]$!="quiz_00" ) end;

the code run like this..

if the character not located at quiz_00 OR not located at quit_01....then script stop

so....your script will never run..because your char cant be at these 2 place at the same time...

so you must use && and not ||

the correct 1 is this

if( [email protected]$!="quiz_00" && [email protected]$!="quiz_00" ) end;

if the char is not located at quiz_00 AND not located at quiz_01 ..the script will stop..

Link to comment
Share on other sites

try this

- script Sample -1,{
OnPCLoadMapEvent:
if( strcharinfo(3) == .Map$ ){
set [email protected], query_sql("SELECT `last_ip` FROM `login` WHERE account_id="+getcharid(3)+"",[email protected]);
set [email protected], query_sql("SELECT `account_id` FROM `login` WHERE last_ip="[email protected]+"");
if( [email protected] >= .Limit ){
 mes "We detected there is "+.Limit+" or more users with same IP Logged in.";
 mes "Please log off these unused account.";
 close2;
 warp "prontera",155,181;
}
}
end;
OnInit:
// How many Account with Same IP to trigger this Event
set .Limit,2;
// What Map will trigger the script
set .Map$,"payon";

setmapflag .Map$,mf_loadevent;
end;
}

Error...so removed..and ip remained upon log off...bugged the script...dont use...

Link to comment
Share on other sites

-	script	abcde	-1,{
OnPCLoadMapEvent:

	   getmapxy([email protected]$,[email protected],[email protected],0);

	   if([email protected]$!="quiz_00") end;  

		query_sql("SELECT last_ip FROM `login` WHERE account_id = "+getcharid(3)+"", [email protected]$);
		query_sql("SELECT account_id FROM `login` WHERE last_ip = '"[email protected]$+"'", [email protected]);
		set [email protected],getcharid(3,strcharinfo(0));

		for(set [email protected] ,0;[email protected]<getarraysize([email protected]);set [email protected],[email protected]+1)
		   {
			 if(attachrid([email protected][[email protected]]))
				{
				  getmapxy([email protected]$,[email protected],[email protected],0);
				  if ([email protected]$== [email protected]$) set [email protected],[email protected]+1;
				 }
				detachrid;
		   }
		attachrid [email protected];
		if([email protected] > [email protected])
			  warp "SavePoint",0,0;	
end;

OnInit:

set [email protected],1;
end;

}

//------Enable map OnPCLoadMapEvent-------------------
quiz_00	mapflag	loadevent

It works only with static IP addresses. Dynamic IP's will ignore this script.

It works only with static IP addresses. Dynamic IP's will ignore this script.

yup,I think his purpose is to avoid the same computer using multiple windows :)

Why should this idea not work with dynamic IP addresses? When your IP changes you are disconnected from the server -> new login -> new data in `login`.`last_ip`!

BTW; Restricting things by IP is a very bad idea. Why do you want to ban brothers (for example) from being in BG together?

Link to comment
Share on other sites

@TS

you can try this..

http://pastebin.com/raw.php?i=FxGBgUxv

// How many User with Same IP can logged in and stay at the specific map
set .Limit,2;
// What map will be restricted
set .Map$,"payon";

and ya..like what Kenpachi said is so..true... >.<

@kenpachi

maybe his brother too pro than him..so he dont want his brother to play BG with him..

hahahahhaha

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

Important Information

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