26.01.2017, 02:34
Use https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
Lemme make you a stock for easier using of it
Example usage:-
Lemme make you a stock for easier using of it
PHP Code:
stock NearestCoord(playerid)
{
new coord;
if(IsPlayerInRangeOfPoint(playerid,3.0,2305.2930,-1385.6023,24.1008))
{
coord = 1;
}
else if(IsPlayerInRangeOfPoint(playerid,3.0,2404.2930,-1382.6025,246.1008))
{
coord = 2;
}
return coord;
}
PHP Code:
if(NearestCoord(playerid) == 1) // 1 = He's near the 1st coord
{
//code
}
else if(NearestCoord(playerid) == 2) // 2 = He's near the 2nd coord
{
//code
}