WoW:API GetCurrentPosition: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
(clarification...GetCurrentPosition and GetPlayerMapPosition kinda got crossed.)
m (Move page script moved page API GetCurrentPosition to API GetCurrentPosition without leaving a redirect)
 
(4 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<center>'''GetCurrentPosition''' ''-Documentation by [[user:Pilum|Pilum]]-''</center>
{{wowapi|removed=1.3.0|replace=Replaced by {{api|GetPlayerMapPosition}}}}


Returns the postion of a unit relative to the world.
Returns the position of a unit relative to the world.


  loc = GetCurrentPosition("unit");
  local loc = GetCurrentPosition("unit")


----
== Parameters ==
;''Returns''
=== Returns ===
* locY (number) - Y value of the player's position.
* locX (number) - X value of the player's position.
* locZ (number) - Z value of the player's position (0 is sea level).


:locY, locX, locZ as one string.
== Example ==
:;locY : Number - Y value of the player's position.
local locX, locY, locZ = GetCurrentPosition("player");
:;locX : Number - X value of the player's position.
DEFAULT_CHAT_FRAME:AddMessage(locX .. ", " .. locY .. ", " .. locZ);
:;locZ : Number - Z value of the player's position (0 is sea level).


----
;Result
;''Example''
local loc = GetCurrentPosition("player");
 
;''Result''
1773.85, 63.06, -46.32
1773.85, 63.06, -46.32


 
== Notes ==
----
* Removed in patch 1.3.0. Use the more specific {{api|GetPlayerMapPosition}} instead.
;Note: As of Interface 1300, this function is deprecated. Use [[API_GetPlayerMapPosition|GetPlayerMapPosition]] instead.
 
----
{{Template:WoW API}}
[[Category:API World Map Functions|GetCurrentPosition]]

Latest revision as of 04:45, 15 August 2023

WoW API < GetCurrentPosition

Returns the position of a unit relative to the world.

local loc = GetCurrentPosition("unit")

Parameters[edit]

Returns[edit]

  • locY (number) - Y value of the player's position.
  • locX (number) - X value of the player's position.
  • locZ (number) - Z value of the player's position (0 is sea level).

Example[edit]

local locX, locY, locZ = GetCurrentPosition("player");
DEFAULT_CHAT_FRAME:AddMessage(locX .. ", " .. locY .. ", " .. locZ);
Result

1773.85, 63.06, -46.32

Notes[edit]