From SA-MP Wiki
Get the distance between the NPC and a point.
|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.|
|Returns||This function doesn't return a specific value|
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);
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.