IsPlayerInRangeOfPoint

IsPlayerInRangeOfPoint

Description:
Function IsPlayerInRangeOfPoint checks if a player is in range of a point. This native function is faster than the PAWN implementation using distance formula.
Function IsPlayerInRangeOfPoint was added in 0.3a and will not work in earlier versions!


Parameters:
(playerid, Float:range, Float:x, Float:y, Float:z)
int playerid The ID of the player.
float range The furthest distance the player can be from the point to be in range.
float X The X coordinate of the point to check the range to.
float Y The Y coordinate of the point to check the range to.
float Z The Z coordinate of the point to check the range to.


Return Values:
  • true - The player is in range of the point.
  • false - The player is not in range of the point.


Examples:
if (!strcmp("/stadium", cmdtext))
{
    if (IsPlayerInRangeOfPoint(playerid, 7.0, 2695.6880, -1704.6300, 11.8438)) 
    {
    	SendClientMessage(playerid,0xFFFFFFFF,"You are near the stadium entrance!");
    }
 
    return 1;
}


Related Functions
The following functions may be useful, as they are related to this function in one way or another.