Jump to content
  • 0

Warp out players from a map


Frost Diver

Question


  • Group:  Members
  • Topic Count:  48
  • Topics Per Day:  0.02
  • Content Count:  177
  • Reputation:   6
  • Joined:  10/22/18
  • Last Seen:  

Hi,

I need some guide on how to warp a player after a period of times from a map? Eg: player farming zeny in a map. After 3 hours, he will be warped out to save points and there's a delay for 3 days before he can enter the map again. the delay is account bound.

Any guides for this? Thanks for the assistances. I'm much appreciated

Edited by Frost Diver
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  50
  • Reputation:   39
  • Joined:  01/13/12
  • Last Seen:  

On 2/18/2020 at 10:57 AM, Frost Diver said:

Hi,

I need some guide on how to warp a player after a period of times from a map? Eg: player farming zeny in a map. After 3 hours, he will be warped out to save points and there's a delay for 3 days before he can enter the map again. the delay is account bound.

Any guides for this? Thanks for the assistances. I'm much appreciated

I think is it:

Spoiler

-	script	Farm_Map_Config#1	FAKE_NPC,{
	end;

	OnInit:
		// Name of the map using to farm.
		.farm_map_name$ = "izlude";

		// Delay time to enter in the map again. (Seconds)
		.farm_map_delay = 259200;	// 259200 = 3 Days

		// How much time the player can access the farm map. (Seconds)
		.farm_map_time_access = 10800;	// 10800 = 3 Hours

		// GameMaster level to avoid the delay and access time of farm map.
		.farm_gm_avoid_lv = 99;

		// ONLY CHANGE IF YOU KNOW WHAT YOU'RE DOING !!
		setmapflag .farm_map_name$, MF_LOADEVENT;
	end;

	OnPCLogoutEvent:
		if (getgroupid() >= .farm_gm_avoid_lv)
		{
			end;
		}

		if (strcharinfo(3) == .farm_map_name$)
		{
			if (#Farm_Map_Time > 0)
			{
				.@time_tick = gettimetick(2);

				#Farm_Map_Time -= .@time_tick;

				if (#Farm_Map_Time <= 0)
				{
					#Farm_Map_Time = 0;
					#Farm_Map_Delay = .@time_tick + .farm_map_delay;
				}

				deltimer strnpcinfo(3) + "::OnTimeEnd";
			}
		}
	end;

	OnTimeEnd:
		.@time_tick = gettimetick(2);
		#Farm_Map_Time = 0;
		#Farm_Map_Delay = .@time_tick + .farm_map_delay;

		warp getsavepoint(0), getsavepoint(1), getsavepoint(2);
		dispbottom "Your " + callfunc("Time2Str", (.@time_tick + .farm_map_time_access)) + " of farm already end.";
		dispbottom "You need to wait " + callfunc("Time2Str", #Farm_Map_Delay) + " to enter again in [" + .farm_map_name$ + "].";
	end;

	OnPCLoadMapEvent:
		if (getgroupid() >= .farm_gm_avoid_lv)
		{
			end;
		}

		if (strcharinfo(3) == .farm_map_name$)
		{
			.@time_tick = gettimetick(2);

			if (#Farm_Map_Time <= 0)
			{
				if (#Farm_Map_Delay <= 0 || (.@time_tick >= #Farm_Map_Delay && #Farm_Map_Delay > 0))
				{
					#Farm_Map_Time = .@time_tick + .farm_map_time_access;
					#Farm_Map_Delay = 0;

					dispbottom "You have " + callfunc("Time2Str", #Farm_Map_Time) + " to get farm in [" + .farm_map_name$ + "].";
					addtimer ((#Farm_Map_Time - .@time_tick) * 1000), strnpcinfo(3) + "::OnTimeEnd";
					end;
				}
				else
				{
					warp getsavepoint(0), getsavepoint(1), getsavepoint(2);
					dispbottom "You need to wait " + callfunc("Time2Str", #Farm_Map_Delay) + " to enter again in [" + .farm_map_name$ + "].";
					end;
				}
			}
			else
			{
				if (#Farm_Map_Time < .@time_tick)
				{
					#Farm_Map_Time += .@time_tick;
					#Farm_Map_Delay = 0;

					dispbottom "You have " + callfunc("Time2Str", #Farm_Map_Time) + " to get farm in [" + .farm_map_name$ + "].";
					addtimer ((#Farm_Map_Time - .@time_tick) * 1000), strnpcinfo(3) + "::OnTimeEnd";
					end;
				}
			}
		}
	end;
}

 

Tested and working.

I hope it helps you. ?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  48
  • Topics Per Day:  0.02
  • Content Count:  177
  • Reputation:   6
  • Joined:  10/22/18
  • Last Seen:  

51 minutes ago, Cretino said:

I think is it:

  Hide contents


-	script	Farm_Map_Config#1	FAKE_NPC,{
	end;

	OnInit:
		// Name of the map using to farm.
		.farm_map_name$ = "izlude";

		// Delay time to enter in the map again. (Seconds)
		.farm_map_delay = 259200;	// 259200 = 3 Days

		// How much time the player can access the farm map. (Seconds)
		.farm_map_time_access = 10800;	// 10800 = 3 Hours

		// GameMaster level to avoid the delay and access time of farm map.
		.farm_gm_avoid_lv = 99;

		// ONLY CHANGE IF YOU KNOW WHAT YOU'RE DOING !!
		setmapflag .farm_map_name$, MF_LOADEVENT;
	end;

	OnPCLogoutEvent:
		if (getgroupid() >= .farm_gm_avoid_lv)
		{
			end;
		}

		if (strcharinfo(3) == .farm_map_name$)
		{
			if (#Farm_Map_Time > 0)
			{
				.@time_tick = gettimetick(2);

				#Farm_Map_Time -= .@time_tick;

				if (#Farm_Map_Time <= 0)
				{
					#Farm_Map_Time = 0;
					#Farm_Map_Delay = .@time_tick + .farm_map_delay;
				}

				deltimer strnpcinfo(3) + "::OnTimeEnd";
			}
		}
	end;

	OnTimeEnd:
		.@time_tick = gettimetick(2);
		#Farm_Map_Time = 0;
		#Farm_Map_Delay = .@time_tick + .farm_map_delay;

		warp getsavepoint(0), getsavepoint(1), getsavepoint(2);
		dispbottom "Your " + callfunc("Time2Str", (.@time_tick + .farm_map_time_access)) + " of farm already end.";
		dispbottom "You need to wait " + callfunc("Time2Str", #Farm_Map_Delay) + " to enter again in [" + .farm_map_name$ + "].";
	end;

	OnPCLoadMapEvent:
		if (getgroupid() >= .farm_gm_avoid_lv)
		{
			end;
		}

		if (strcharinfo(3) == .farm_map_name$)
		{
			.@time_tick = gettimetick(2);

			if (#Farm_Map_Time <= 0)
			{
				if (#Farm_Map_Delay <= 0 || (.@time_tick >= #Farm_Map_Delay && #Farm_Map_Delay > 0))
				{
					#Farm_Map_Time = .@time_tick + .farm_map_time_access;
					#Farm_Map_Delay = 0;

					dispbottom "You have " + callfunc("Time2Str", #Farm_Map_Time) + " to get farm in [" + .farm_map_name$ + "].";
					addtimer ((#Farm_Map_Time - .@time_tick) * 1000), strnpcinfo(3) + "::OnTimeEnd";
					end;
				}
				else
				{
					warp getsavepoint(0), getsavepoint(1), getsavepoint(2);
					dispbottom "You need to wait " + callfunc("Time2Str", #Farm_Map_Delay) + " to enter again in [" + .farm_map_name$ + "].";
					end;
				}
			}
			else
			{
				if (#Farm_Map_Time < .@time_tick)
				{
					#Farm_Map_Time += .@time_tick;
					#Farm_Map_Delay = 0;

					dispbottom "You have " + callfunc("Time2Str", #Farm_Map_Time) + " to get farm in [" + .farm_map_name$ + "].";
					addtimer ((#Farm_Map_Time - .@time_tick) * 1000), strnpcinfo(3) + "::OnTimeEnd";
					end;
				}
			}
		}
	end;
}

 

Tested and working.

I hope it helps you. ?

Wow thanks alot! Gonna try this

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