Position functions

class PositionFunctions

Public Static Functions

double GetPosX(unsigned short pid)

Get the X position of a player.

Return
The X position.
Parameters
  • pid: The player ID.

double GetPosY(unsigned short pid)

Get the Y position of a player.

Return
The Y position.
Parameters
  • pid: The player ID.

double GetPosZ(unsigned short pid)

Get the Z position of a player.

Return
The Z position.
Parameters
  • pid: The player ID.

double GetPreviousCellPosX(unsigned short pid)

Get the X position of a player from before their latest cell change.

Return
The X position.
Parameters
  • pid: The player ID.

double GetPreviousCellPosY(unsigned short pid)

Get the Y position of a player from before their latest cell change.

Return
The Y position.
Parameters
  • pid: The player ID.

double GetPreviousCellPosZ(unsigned short pid)

Get the Z position of a player from before their latest cell change.

Return
The Z position.
Parameters
  • pid: The player ID.

double GetRotX(unsigned short pid)

Get the X rotation of a player.

Return
The X rotation.
Parameters
  • pid: The player ID.

double GetRotZ(unsigned short pid)

Get the Z rotation of a player.

Return
The Z rotation.
Parameters
  • pid: The player ID.

void SetPos(unsigned short pid, double x, double y, double z)

Set the position of a player.

This changes the positional coordinates recorded for that player in the server memory, but does not by itself send a packet.

Return
void
Parameters
  • pid: The player ID.
  • x: The X position.
  • y: The Y position.
  • z: The Z position.

void SetRot(unsigned short pid, double x, double z)

Set the rotation of a player.

This changes the rotational coordinates recorded for that player in the server memory, but does not by itself send a packet.

A player’s Y rotation is always 0, which is why there is no Y rotation parameter.

Return
void
Parameters
  • pid: The player ID.
  • x: The X position.
  • z: The Z position.

void SetMomentum(unsigned short pid, double x, double y, double z)

Set the momentum of a player.

This changes the coordinates recorded for that player’s momentum in the server memory, but does not by itself send a packet.

Return
void
Parameters
  • pid: The player ID.
  • x: The X momentum.
  • y: The Y momentum.
  • z: The Z momentum.

void SendPos(unsigned short pid)

Send a PlayerPosition packet about a player.

It is only sent to the affected player.

Return
void
Parameters
  • pid: The player ID.

void SendMomentum(unsigned short pid)

Send a PlayerMomentum packet about a player.

It is only sent to the affected player.

Return
void
Parameters
  • pid: The player ID.