Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Finding player cordinates?


abhi2011
 Share

Recommended Posts

What is the code for finding the player coordinates and storing them so that i can use it for a control? The coordinates are displayed when "/loc" is inputted but that is not what I want so don't suggest it. Something like "GetPlayerPos"
Link to comment
Share on other sites

What do you mean by control?
Controlling the player's character while he/she is online?

What's the point of that,if the player moves around,getting many coords.
But first explain more detailed what are you thinking
Link to comment
Share on other sites

I mean the player's position (if it is the same as coordinate)on the screen cuz i want to try and make a right click option and when right clicked should come up near the player. And Erwin doesn't player(myindex) mean the player that is playing? like if i were playing it would be me?
Link to comment
Share on other sites

@abhi2011:

> I mean the player's position (if it is the same as coordinate)on the screen cuz i want to try and make a right click option and when right clicked should come up near the player. And Erwin doesn't player(myindex) mean the player that is playing? like if i were playing it would be me?

Player position is the same as coordinates I guess, Player(index).X and the other stuff displays the player X and Y position on the map, so thesame as you see when the /loc thing is turned on.
And Player(MyIndex) has nothing to do if the player if playing, because you can only check that at server side with IsPlaying sub, its an array with data of the player. (Please note that MyIndex can only be used at client side and will always be the player playing at the client)
Link to comment
Share on other sites

@Erwin:

> Player position is the same as coordinates I guess, Player(index).X and the other stuff displays the player X and Y position on the map, so thesame as you see when the /loc thing is turned on.
> And Player(MyIndex) has nothing to do if the player if playing, because you can only check that at server side with IsPlaying sub, its an array with data of the player. (Please note that MyIndex can only be used at client side and will always be the player playing at the client)

So client side is for the person playing the game and server side can be used for any player? So does that mean I have will have to write the code for sending a packet and stuff?

I also wanted to ask if there was a need to wirte  a packet why is there a write.buffer code in client/server  TCP module. And what is cls.buffer?
Link to comment
Share on other sites

@abhi2011:

> So client side is for the person playing the game and server side can be used for any player? So does that mean I have will have to write the code for sending a packet and stuff?

I think you can use PlayerSearch for that.

@abhi2011:

> I also wanted to ask if there was a need to wirte  a packet why is there a write.buffer code in client/server  TCP module. And what is cls.buffer?

Read this:
http://www.touchofdeathforums.com/smf2/index.php/topic,69393.msg746513.html#msg746513
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
 Share

×
×
  • Create New...