I just managed to do it. It was a small mistake in the function from the first link. Now it works just fine for getting the author posts.
Here is what I am using, maybe someone else will need it too.
COPY CODE
function custom_post_author_archive($query) {
if ($query->is_author)
$query->set( 'post_type', array('posttype1', 'posttype2') );
return $query;
remove_action( 'pre_get_posts', 'custom_post_author_archive' );
}
add_action('pre_get_posts', 'custom_post_author_archive');