@TiagoCosta: Need a little bit of more clarification.Sorry I didn't had time to comment the code before.
playerPos is the beginning of the cone (enemy eyes position)? Is that true?
someNumber is how far the enemy can see.
someOtherNumber: How do I get this value?
I updated the code in my last post... should be easier to understand.