I'm not sure if this your problem but if you are trying to check if an enemy is facing the player then use this:
function Facing(EnemyObj,PlayerObj,AngleOfView)
Facing=0
OldAng#=object angle y(EnemyObj)
point object EnemyObj,object position x(PlayerObj),object position y(EnemyObj),object position z(PlayerObj)
if OldAng#>(object angle y(EnemyObj)-AngleOfView)
if OldAng#<(object angle y(EnemyObj)+AngleOfView)
Facing=1
endif
endif
yrotate object EnemyObj,OldAng#
endfunction Facing
Then call it by typing something like:
if Facing(2,1,45)=1
blah
blah some more
endif
If the enemy is facing the player then a 1 will be returned.
The angle of view should probably be around 45.