You can use attach_view, "
attach_view ( player, target ) "
The target can't be a player, so you will have to create an entity that follows the player you wish to spectate.
This is a my Proof of concept, and has not yet been tested, so try this out.
Code:
new camera[33]
public FollowPlayer(id,id2){
new Float:origin[3];
entity_get_vector(id2,EV_VEC_origin,origin) ;
new camera[id] = create_entity("info_target");
entity_set_string(camera[id],EV_SZ_classname,"spectatorcamera") ;
entity_set_origin(camera[id],origin);
entity_set_int(camera[id], EV_INT_movetype, MOVETYPE_FOLLOW ); //follow the player
entity_set_edict(camera[id], EV_ent_aiment, id ); //set aim
entity_set_edict(camera[id], EV_ent_owner,33);
}
Public Follow(id){
attach_view ( id, camera[id] )
}
__________________