As far as I understand, you don't need trigonometry. You only need to normalize the offset to the player.

Code:
vec_diff(my.x, you.x, planet_character.x);
var length = vec_length(my.x);
if (length > 300)
   vec_scale(my.x, 300 / length);
vec_add(my.x, planet_character.x);