NPC:GetDistanceFromMeToPoint
Description:
Function NPC:GetDistanceFromMeToPoint get the distance between the NPC and a point.
Function NPC:GetDistanceFromMeToPoint was added in 0.3a and will not work in earlier versions! |
Parameters:
(Float:x, Float:y, Float:z, Float:Distance)
float | X | The X coordinate of the point. |
float | Y | The Y coordinate of the point. |
float | Z | The Z coordinate of the point. |
float | Distance | A float to save the distance in, passed by reference. |
Return Values:
This function does not return any specific values.
Examples:
new Float:distance; GetDistanceFromMeToPoint(2.0, 3.0, 2.0, distance); printf("The distance between the npc and the point (2.0, 3.0, 2.0) is %f", distance);
Related Functions
The following functions may be useful, as they are related to this function in one way or another.
- NPC:GetMyPos: Get the NPC's position.
- NPC:SetMyPos: Set the NPC's position.