Jump to content
  • 0

DeviL Square AFK and Dual Restrictions


Question

Posted

Hello i want to add some thing on my Devil Square.

 

 

Prevent People from AFking inside that can cause into abuse.

Prevent dual accounts in entering Devil Square.

 

 

Hope someone can help me.

6 answers to this question

Recommended Posts

Posted

Hello i want to add some thing on my Devil Square.

 

 

Prevent People from AFking inside that can cause into abuse.

OnCheckIdle:
	while( .start ) {
		sleep 2000;
		for( .@i = 0; .@i < .register_num; .@i++ )
			if( checkidle( rid2name( .register_aid[ .@i ] ) ) > 60 )
				unitkill .register_aid[ .@i ];
	}
	end;
donpcevent strnpcinfo(0)+"::OnCheckIdle";

 

 

 

Prevent dual accounts in entering Devil Square.

	for( .@i = 0; .@i < .register_num; .@i++ )
		if( getcharip( .register_aid[ .@i ] ) == getcharip() ) {
			mes "you can't enter";
			close;
		}
Posted (edited)

Thanks ill try this

Im Confused where to put this ...

 

Well that's why I asked you to post your script

I don't know if you made your script, or which one Devil Square you have so I based my post on Annieruru's Devil Square

 

.register_aid save the account ID of the player

.register_num is the size of the array .register_aid

 

IS it possible it give a warning msg first before it warp people back to save point when hes afk.

OnCheckIdle:
	while( .start ) { // if event on and player on map
		sleep 2000;
		for( .@i = 0; .@i < .register_num; .@i++ ) {
			if( checkidle( rid2name( .register_aid[ .@i ] ) ) >= 60 && checkidle( rid2name( .register_aid[ .@i ] ) ) < 62 )
				mapannounce "<your map>", rid2name( .register_aid[ .@i ] ) +" is AFK ! Wake up !",0;
			else if( checkidle( rid2name( .register_aid[ .@i ] ) ) >= 82 ) { // check if idle > than 82 sec
				unitkill .register_aid[ .@i ];
				unitwarp .register_aid[ .@i ],"prontera,0,0;
			}
		}
	}
	end;

Good luck ;)

Edited by Capuche

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