IsObjectInRangeOfPoint[SOLVED]
#1

Is there any functions like IsObjectInRangeOfPoint or can someone tell me which is the best and efficient way to find the closest object to x,y,z and a example thanks.


I'm just trying to get a object closest to position and how you can do it.
Reply
#2

For the first ones, find PlayerToPoint and edit it then do a loop through all the objects and use GetDistanceBetweenPoints or whatever it is named.
Reply
#3

Код:
stock ObjectToPoint(Float:radi, objectid, Float:x, Float:y, Float:z)
{
  new Float:oldposx, Float:oldposy, Float:oldposz;
  new Float:tempposx, Float:tempposy, Float:tempposz;
  GetObjectPos(playerid, oldposx, oldposy, oldposz);
  tempposx = (oldposx -x);
  tempposy = (oldposy -y);
  tempposz = (oldposz -z);
  if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  {
   return 1;
  }
  return 0;
}
Reply
#4

Quote:
Originally Posted by misko28
Код:
stock ObjectToPoint(Float:radi, objectid, Float:x, Float:y, Float:z)
{
 new Float:oldposx, Float:oldposy, Float:oldposz;
 new Float:tempposx, Float:tempposy, Float:tempposz;
 GetObjectPos(playerid, oldposx, oldposy, oldposz);
 tempposx = (oldposx -x);
 tempposy = (oldposy -y);
 tempposz = (oldposz -z);
 if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
 {
   return 1;
 }
 return 0;
}
Thank you.

If I can help you with anything I'll do it except for anything else than money.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)