void(entity me)     CameraOn;
void(entity me)     CameraOff;

float SVC_SETVIEWPORT = 5;    // Net.Protocol 0x05
float SVC_SETVIEWANGLES = 10; // Net.Protocol 0x0A
float SVC_UPDATEENTITY = 128; // Net.Protocol 0x80

//Again...Thanks Nezu for your original camera patch.
//without it, it would have taken much longer to figure
//this out!

//--------------------------------------------------------
// me     = player entity
// camera = entity that is playing the camera for me
// Make a player see through an entity (the camera).
//--------------------------------------------------------

void(entity me) CameraOn =
{
  // Set view point
  local entity camera;
  //if(me.aflag!=0)

  camera = hologram;  //Now you see why classnames are so important :)
  msg_entity = me;                         // target of message
  WriteByte (MSG_ONE, SVC_SETVIEWPORT);    // 5 = SVC_SETVIEWPORT;  
  WriteEntity (MSG_ONE, camera);           // view port
  WriteByte (MSG_ONE, SVC_SETVIEWANGLES);  // 10 = SVC_SETVIEWANGLES
  WriteAngle(MSG_ONE, camera.angles_x);    // tilt 
  WriteAngle(MSG_ONE, camera.angles_y);    // yaw
  WriteAngle(MSG_ONE, camera.angles_z);    // flip
};


void(entity me) CameraOff =
{
  // Set view point
  local entity camera;
  //if(me.aflag!=0)

  camera = me;
  msg_entity = me;                         // target of message
  WriteByte (MSG_ONE, SVC_SETVIEWPORT);    // 5 = SVC_SETVIEWPORT;  
  WriteEntity (MSG_ONE, camera);           // view port
  WriteByte (MSG_ONE, SVC_SETVIEWANGLES);  // 10 = SVC_SETVIEWANGLES
  WriteAngle(MSG_ONE, camera.angles_x);    // tilt 
  WriteAngle(MSG_ONE, camera.angles_y);    // yaw
  WriteAngle(MSG_ONE, camera.angles_z);    // flip
};
