13.04.2009, 13:59
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;
}