int GetIsFacingTarget(object oSelf, object oTarget, int nViewArc)
{
float AngleOffset = VectorToAngle( GetPosition(oTarget) - GetPosition(oSelf)) - GetFacing(oSelf) ;
return (abs(FloatToInt(AngleOffset)) < nViewArc/2);
}
Lightfoot8 wrote that for me, years back, for a function to check if something is in front of an object. It's a handy function to have around.