Jump to content
For maintenance and updates, the community will be offline on 31 December 2022 ×
  • 0

Empire and local towns check by c++


ReFresh

Question

  • Premium

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

I'll be always helpful! 👊 

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

  • 2
  • Distinguished Member

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

 

Link to comment
Share on other sites

  • 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
Share on other sites

  • 0
  • Premium
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.

I'll be always helpful! 👊 

Link to comment
Share on other sites

  • 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
Share on other sites

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


  • Activity

    1. 1

      Looking for a good designer

    2. 2

      Where are those maps/dungeons coming from?

    3. 3

      Press F10 to close the client immediately

    4. 2

      Where are those maps/dungeons coming from?

    5. 2

      Where are those maps/dungeons coming from?

    6. 4

      Visual studio 2022 compiling issue

    7. 1

      Count players function

    8. 64
  • Recently Browsing

    • No registered users viewing this page.
×
×
  • 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.