void(entity ex) hologram_explode =
{
    if (ex.owner.camera >= 1)  //Check to see if the camera is on.
    {
        ex.owner.camera = 0;              //Set the camera_on variable to 0 for off
        CameraOff(ex.owner); //and turn the camera off.
     }
     ex.owner.holo = 0;   //set the self.holo to 0 so that
                                   //the player can re-activate the
                                   //hologram.

     makevectors(ex.angles);
     spawn_tfog (ex.origin + v_forward*20);
     ex.nextthink = time + 0.1;
     ex.think = SUB_Remove;
};

/*
=======================
holo_touch
spawns tfog and plays a sound now.
=======================
*/
void() holo_touch =
{
        makevectors(self.angles);
        spawn_tfog (self.origin + v_forward*20);
};

void() holo_i =
{
        self.holo = self.holo + 1;
        if (self.holo >= 300)      //Check if it is time to self-terminate
                                    //the hologram program.
          {
           sprint (self.owner,"Hologram shutdown...\n");
           hologram_explode(self);
          }
	else
	{
         self.frame = self.frame + 1;
         if (self.frame < 12 || self.frame > 16)
                self.frame = 12;
         self.skin = self.owner.skin;
         self.colormap = self.owner.colormap;
         self.nextthink = time + 0.1;
         self.think = holo_i;
	}
};
/*
===============
launch_hologram

By Jason Busby
===============
*/
void(vector org, vector dir) launch_hologram =
{
   if (self.holo > 0)
      {
        sprint (self,"The hologram is already running.\n");
        return;
      }
        hologram = spawn ();
        hologram.owner = self;
        self.holo = 1;
        self.myhologram = hologram;
        hologram.flags = FL_ITEM;
        hologram.movetype = MOVETYPE_STEP;
        hologram.solid = SOLID_TRIGGER;
        hologram.angles = vectoangles(dir);
        hologram.touch = holo_touch;
        setmodel (hologram, "progs/player.mdl");
        hologram.skin = self.skin;
        hologram.colormap = self.colormap;
        setsize (hologram, '-16 -16 -24', '16 16 40');
        setorigin (hologram, org);
        hologram.velocity = dir * 10;
        hologram.frame = 13;  //Once the mdl file is displayed, I use
                              //this to tell which frame to display
        hologram.classname = "hologram";  //This is very important so that
                                          //later on you can refer to the
                                          //entity as a "hologram"
        hologram.nextthink = time + 1;
        hologram.think = holo_i;//This is the start of the
                                          //bobbing up and down.
        sprint (self, "Hologram launched...\n");
};
