GetPlayerPosition Client function

From Gothic 2 Online: Wiki
Jump to navigation Jump to search

This function was added in version: 0.0.0

Gets the given player's absolute position.

Syntax

table[x, y, z] getPlayerPosition(int id);

Required Arguments

  • id: id of the player, who's position you want to get.

Returns

  • x: absolute x coordinate.
  • y: absolute y coordinate. Note that in Gothic, the y-axis is the axis that points upwards.
  • z: absolute z coordinate.

Example

local function teleportPlayer(id1, id2)
{
    local toPos = getPlayerPosition(id2);
    setPlayerPosition(id1, toPos.x, toPos.y, toPos.z);
}

Related functions

Server

Shared