before you use temp for the vec_to_angle function you need to set the position of temp in relation to the position of the player.
As long as the player is at position vector(0,0,0) it works, because such values don't change anything!
Use something like the following:
function turn_towards_target()
{
// get the direction from the entity MY to the entity YOU
vec_set(temp,your.x);
vec_sub(temp,my.x);
vec_to_angle(my.pan,temp); // now MY looks at YOU
}
You already got the first and the third line of this snippet, you still need the second line.
Look for others examples of vector calculation in c-script in the manual, in the AUM and Kinji's Vector tutorials, to get an idea how they work!
