Distance question
#2

Use https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
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;

Example usage:-
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

Reply


Messages In This Thread
Distance question - by boy - 26.01.2017, 01:56
Re: Distance question - by StrikerZ - 26.01.2017, 02:34

Forum Jump:


Users browsing this thread: 1 Guest(s)