IsPlayerInRangeOfPoint

From SA-MP Wiki

Jump to: navigation, search

IsPlayerInRangeOfPoint


Warning: This function was added in SA-MP version 0.3. It is not available in previous versions.

There are scripted (but slower) alternatives for previous SA-MP versions.


Check if a player is in range of a point.


Parameters:
(playerid, Float:range, Float:x, Float:y, Float:z)
playeridThe ID of the player you want to check the point range of.
Float:rangeThe furthest distance the player can be 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.


Returns1 if the player is in range of the point, otherwise 0.


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 might be useful as well, as they're related to this function in one way or another.

Personal tools