Jump to content
  • 0

Get X & Y of LastMapEntered??


Question

Posted
Spoiler

private void Respawn()
        {
            //Remove any damage over time effects
            DoT.Clear();
            CachedDots = new DoT[0];
            Statuses.Clear();
            CachedStatuses = new Status[0];

            CombatTimer = 0;
            
            var cls = ClassBase.Get(ClassId);
            //===== 
            var MAP_X = 0;
           

            if (cls != null)
            {
                //Search death common event trigger
                //StartCommonEventsWithTrigger(CommonEventTrigger.OnRespawn);            
                //Warp(cls.SpawnMapId, (byte) cls.SpawnX, (byte) cls.SpawnY, (byte) cls.SpawnDir);
                Warp(LastMapEntered, 0, 0, 0);
            }
            else
            {
                Warp(Guid.Empty, 0, 0, 0);
            }

            PacketSender.SendEntityDataToProximity(this);

            //Search death common event trigger
            StartCommonEventsWithTrigger(CommonEventTrigger.OnRespawn);
        }
 

How to get player's x & y position?? i want make a respawn in dead map with money. thank you!

6 answers to this question

Recommended Posts

  • 0
Posted

I believe there's simply an X and Y property for every entity that holds their current location.

Not sure LastMapEntered is a base thing? Also not sure how that's relevant to your question here.

  • 0
Posted
7 hours ago, Cheshire said:

I believe there's simply an X and Y property for every entity that holds their current location.

Not sure LastMapEntered is a base thing? Also not sure how that's relevant to your question here.

i just want to know what is my current x,y position, i can use it to save after respawn

  • 0
Posted
49 minutes ago, nvh said:

i just want to know what is my current x,y position, i can use it to save after respawn

 

Not sure how you are tying to do this exactly, but if you decide to create a function to be used by every Player uppon death, then  Player.X  & Player.Y should give you the values you need.
There's no such a thing as "LastMapEntered" player values, but you can get these values from Player's current location.

  • 0
Posted
39 minutes ago, Arufonsu said:

 

Not sure how you are tying to do this exactly, but if you decide to create a function to be used by every Player uppon death, then  Player.X  & Player.Y should give you the values you need.
There's no such a thing as "LastMapEntered" player values, but you can get these values from Player's current location.

In "player.cs" I want to create a method that saves the current map position, which can be activated after death to warp to that map.

  • 0
Posted
19 hours ago, Cheshire said:

In that case you have your answer. X and Y has their current location before they are warped away. 

how should i code it?

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