Jump to content
  • 0

afk on bg maps


Question

Posted

hey can i request a simple afk check script for bg maps?

 

like..:

 

if a player is afk for 60 seconds:

 

"please move or you will get kicked"

 

30 seconds later

 

"you got 30 seconds to move"

 

after 30 seconds warp the char to save point

2 answers to this question

Recommended Posts

Posted

Maybe something like this ?

-	script	iubiu	-1,{
OnInit:
	setarray .@map_name$, "bat_c01", "bat_c02";
	.@size_map = getarraysize( .@map_name$ );
	for ( .@i = 0; .@i < .@size_map; .@i++ )
		setmapflag .@map_name$[.@i], mf_loadevent;
	.bg_map$ = implode( .@map_name$, "|" );
	end;
OnPCLoadMapEvent:
	if ( !compare( .bg_map$, strcharinfo(3) ) || !getcharid(4) || getgmlevel() || @loop_bg ) end;
	@loop_bg++;
	while( compare( .bg_map$, strcharinfo(3) ) && getcharid(4) ) {
		sleep2 10000;
		if( checkidle() > 60 && checkidle() <= 70 )
			announce "please move or you will get kicked", bc_self;
		else if( checkidle() > 90 && checkidle() <= 100 )
			announce "you got 30 seconds to move", bc_self;
		else if( checkidle() > 120 ) {
			warp "SavePoint", 0, 0;
			break;
		}
	}
	@loop_bg = 0;
	end;
}
  • Upvote 1

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