Jump to content
Forgot your email address? ×
×
×
  • Create New...
  • 0

quest to disconnect staff member after X minutes afk ?


BEST

Question

As the title says.. im searching for a quest to disconnect a staff member if he/she is afk for X amount of minutes..

is it possible to be done ? If yes, what quest_function counts "afk" time ? or how to count it ?

Thanks :)

Link to comment
  • Answers 2
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

2 answers to this question

Recommended Posts

  • 0

quest afkauto begin
	state start begin
	end
	state run begin
		when login begin
			if(game.get_event_flag("afk_mod") == 0) then
				return
			else
				if(pc.getqf("afk") == 0) then
					pc.setqf("limit_time",get_time()+15*60)
					pc.setqf("afk",1)
					pc.setqf("localy",pc.get_local_y())
					pc.setqf("localx",pc.get_local_x())
					timer("Check",10)
				elseif(pc.getqf("afk") == 1 and not pc.is_polymorphed() and not pc.is_gm()) then
					if(get_time() >= pc.getqf("limit_time") and pc.getqf("localy") == pc.get_local_y() and pc.getqf("localx") == pc.get_local_x()) then
						command("logout")
						notice_in_map(pc.name.." Afk moduna geçmiştir.Bu yüzden oyundan çıkartıldı. [AFK-MOD] ")
						notice_all("Writer By : Mehmet")
						pc.setqf("afk",0)
					else
						timer("Check",10)
					end
				else
					timer("Check",10)
				end
			end
		end
		
		when Check.timer begin
			if(game.get_event_flag("afk_mod") == 0) then
				return
			else
				if(pc.getqf("afk") == 0) then
					pc.setqf("limit_time",get_time()+15*60)
					pc.setqf("afk",1)
					pc.setqf("localy",pc.get_local_y())
					pc.setqf("localx",pc.get_local_x())
				 elseif(pc.getqf("afk") == 1 and not pc.is_polymorphed()) then
					if(get_time() >= pc.getqf("limit_time") and pc.getqf("localy") == pc.get_local_y() and pc.getqf("localx") == pc.get_local_x()) then
						command("logout")
						notice_in_map(pc.name.." Afk moduna geçmiştir.Bu yüzden oyundan çıkartıldı. [AFK-MOD] ")
						notice_all("Writer by : Mehmet")
						pc.setqf("afk",0)
						cleartimer("Checkone")
						cleartimer("Check")						
					else
						timer("Checkone",10)
					end
				else
					timer("Checkone",10)
				end
			end
		end
		
		when Checkone.timer begin
			if(game.get_event_flag("afk_mod") == 0) then
				return
			else
				if(pc.getqf("afk") == 0) then
					pc.setqf("limit_time",get_time()+15*60)
					pc.setqf("afk",1)
					pc.setqf("localy",pc.get_local_y())
					pc.setqf("localx",pc.get_local_x())
				 elseif(pc.getqf("afk") == 1 and not pc.is_polymorphed()) then
					if(get_time() >= pc.getqf("limit_time") and pc.getqf("localy") == pc.get_local_y() and pc.getqf("localx") == pc.get_local_x()) then
						command("logout")
						notice_in_map(pc.name.." Afk moduna geçmiştir.Bu yüzden oyundan çıkartıldı. [AFK-MOD] ")
						notice_all("Writer by : Mehmet")
						pc.setqf("afk",0)
						cleartimer("Checkone")
						cleartimer("Check")
					else
						timer("Check",10)
					end
				else
					timer("Check",10)
				end
			end
		end 

 

Writed by Aveline, I hope that would be enough

Link to comment
  • 0

it seems like few "end" are missing at the end, hope that its not missing something important, and thanks! ill test it and post update if i can fix it (in case its not finished)

Thanks again 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Announcements

  • -15% Discount in Metin2 Dev Store (01/10/2021 => 31/12/2021) => Code => 15_PCT_OCT_TO_DEC_2021


Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.