Checking if Object is at the given position
#2

Modify a version of PlayerToPoint, Maybe like this?
pawn Код:
public ObjectToPoint(Float:radi, objectid, Float:x, Float:y, Float:z)
{
  if(IsValidObject(objectid))
  {
    new Float:oldposx, Float:oldposy, Float:oldposz;
    new Float:tempposx, Float:tempposy, Float:tempposz;
    GetObjectPos(objectid, 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


Messages In This Thread
Checking if Object is at the given position - by Robbin237 - 13.04.2009, 13:58
Re: Checking if Object is at the given position - by ICECOLDKILLAK8 - 13.04.2009, 13:59
Re: Checking if Object is at the given position - by Robbin237 - 13.04.2009, 14:02
Re: Checking if Object is at the given position - by ICECOLDKILLAK8 - 13.04.2009, 14:02
Re: Checking if Object is at the given position - by Robbin237 - 13.04.2009, 14:03
Re: Checking if Object is at the given position - by ICECOLDKILLAK8 - 13.04.2009, 14:06

Forum Jump:


Users browsing this thread: 3 Guest(s)