Do something based on line-sight.

Is it possible to, for example, give an effect to a player if they are in line-sight of another player? Being more specific, what I wanted to do was give a glowing effect to a player when another player sees them through a spyglass.
Continue to help post