IsPlayerInRangeOfPoint

warning

This function was added in SA-MP 0.3a and will not work in earlier versions!

Description

Checks if a player is in range of a point. This native function is faster than the PAWN implementation using distance formula.

NameDescription
playeridThe ID of the player.
Float:rangeThe furthest distance the player can be from the point to be in range.
Float:xThe X coordinate of the point to check the range to.
Float:yThe Y coordinate of the point to check the range to.
Float:zThe Z coordinate of the point to check the range to.

Returns

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