GetDistanceFromMeToPoint: Difference between revisions
Jump to navigation
Jump to search
(Created page with "{{Welcome| desc=Gets the distance from NPC to a point.| params=<syntaxhighlight lang="lua">(point)</syntaxhighlight> <poem>::point: The Vector point to which distance form NPC...") |
No edit summary |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
{{Welcome| | {{Welcome| | ||
desc=Gets the distance from NPC to a point.| | desc=Gets the distance from NPC to a point. (distance in 3-D space rather than 2-D) | | ||
params=<syntaxhighlight lang="lua">(point)</syntaxhighlight> | params=<syntaxhighlight lang="lua">(point)</syntaxhighlight> | ||
<poem>::point: The Vector point to which distance form NPC is to be measured.</poem>| | <poem>::point: The Vector point to which distance form NPC is to be measured.</poem>| | ||
retvals=Returns the required distance as float.| | retvals=Returns the required distance as float.| | ||
example=<source lang="lua"> | example=<source lang="lua"> | ||
local d=GetDistanceFromMeToPoint( | local d=GetDistanceFromMeToPoint(GetPlayerPos(0)); | ||
print("The distance between me and Player 0 is "+d); | print("The distance between me and Player 0 is "+d); | ||
</source>| | </source>| |
Latest revision as of 16:16, 21 November 2022
Description:
Gets the distance from NPC to a point. (distance in 3-D space rather than 2-D)
Parameters:
(point)
point: The Vector point to which distance form NPC is to be measured.
Return Values:
Returns the required distance as float.
Example
local d=GetDistanceFromMeToPoint(GetPlayerPos(0)); print("The distance between me and Player 0 is "+d);
Related Functions
The following functions may be helpful as they relate to this function in one way or another.