Jump to content
  • 0

Empire and local towns check by c++


ReFresh

Question

Hello guys,

have someone some function which will check empire of player via server source when player login?

It must work like: If player is in Pyungmoo then it will check his empire and if player empire != Pyungmoo then it will warp player to his local town etc. It must check local towns with player empire. 

I need to have this function because when you change the empire via quest, player can disconnect his account in changing empire state by connecting to server again and then when he login he has empire changed but he will still in town of another empire.

Thanks for possible answers!

Sincerely,

ReFresh

Edited by ReFresh
Link to comment
  • Answers 6
  • Created
  • Last Reply

Top Posters For This Question

6 answers to this question

Recommended Posts

  • 1

One little think.. 😄

quest back_to_your_town begin
	state start begin
		when login with not pc.is_gm() begin
			if pc.get_map_index() == 41 and pc.get_empire() != 3 then
				warp_to_village();
			elseif pc.get_map_index() == 21 and pc.get_empire() != 2 then
				warp_to_village();
			elseif pc.get_map_index() == 1 and pc.get_empire() != 1 then
				warp_to_village();
			end
		end
	end
end

 

  • Metin2 Dev 1
  • Love 1
  • Good 1
Link to comment
  • 2

Doing such things meant to be in quests as Cunoo said.

Here is an example code:

quest back_to_your_town begin
	state start begin
		when login begin
			-- As i remember warp_to_village will teleport to your own home town but if not, just use pc.warp...
			if pc.get_map_index() == 41 and pc.get_empire() != 3 then
				warp_to_village();
			elseif pc.get_map_index() == 21 and pc.get_empire() != 2 then
				warp_to_village();
			elseif pc.get_map_index() == 1 and pc.get_empire() != 1 then
				warp_to_village();
			end
		end
	end
end

 

  • Metin2 Dev 1
  • Love 3
Link to comment
  • 0
10 hours ago, ReFresh said:

Hello guys,

have someone some function which will check empire of player via server source when player login?

It must work like: If player is in Pyungmoo then it will check his empire and if player empire != Pyungmoo then it will warp player to his local town etc. It must check local towns with player empire. 

I need to have this function because when you change the empire via quest, player can disconnect his account in changing empire state by connecting to server again and then when he login he has empire changed but he will still in town of another empire.

Thanks for possible answers!

Sincerely,

ReFresh

I don't have source check, but I think you can do it with quest specifically in empire change quest with simple check.. I think could be do at least 2+ variant.. Simple variant is add automatic warp in your new empire.. I think you dont must totally logout account, because warp too reload all needed informations..

Link to comment
  • 0
12 hours ago, Cunoo said:

I don't have source check, but I think you can do it with quest specifically in empire change quest with simple check.. I think could be do at least 2+ variant.. Simple variant is add automatic warp in your new empire.. I think you dont must totally logout account, because warp too reload all needed informations..

@CunooI wasn't talking about account logging out. I was talking about: You can change empire normally with warp to the new empire town, it works right but when player disconnect his account by turning off internet connection or by login to the same account again, it will result in disconnection before "warp function" is triggered, so player won't be warped to the new empire town.

4 hours ago, TMP4 said:

Doing such things meant to be in quests as Cunoo said.

Here is an example code:

quest back_to_your_town begin
	state start begin
		when login begin
			-- As i remember warp_to_village will teleport to your own home town but if not, just use pc.warp...
			if pc.get_map_index() == 41 and pc.get_empire() != 3 then
				warp_to_village();
			elseif pc.get_map_index() == 21 and pc.get_empire() != 2 then
				warp_to_village();
			elseif pc.get_map_index() == 1 and pc.get_empire() != 1 then
				warp_to_village();
			end
		end
	end
end

 

@TMP4 Good idea, I'll try.

  • Metin2 Dev 1
Link to comment
  • 0
24 minutes ago, ReFresh said:

@CunooI wasn't talking about account logging out. I was talking about: You can change empire normally with warp to the new empire town, it works right but when player disconnect his account by turning off internet connection or by login to the same account again, it will result in disconnection before "warp function" is triggered, so player won't be warped to the new empire town.

@TMP4 Good idea, I'll try.

Yes but now you cant go in enemy empire.. Thats what u want?

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


×
×
  • Create New...

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.