You could use ExecuteHam(Ham_FVecVisible, this, const Float: origin[3]), then you wouldn't have to retrieve player eyes position.
Code:
BOOL CBaseEntity :: FVisible ( const Vector &vecOrigin )
{
TraceResult tr;
Vector vecLookerOrigin;
vecLookerOrigin = EyePosition();//look through the caller's 'eyes'
UTIL_TraceLine(vecLookerOrigin, vecOrigin, ignore_monsters, ignore_glass, ENT(pev)/*pentIgnore*/, &tr);
if (tr.flFraction != 1.0)
{
return FALSE;// Line of sight is not established
}
else
{
return TRUE;// line of sight is valid.
}
}
__________________