home *** CD-ROM | disk | FTP | other *** search
- void(vector org) spawn_hfog =
- {
- s = spawn ();
- s.origin = org;
- s.nextthink = time + 0.2;
-
- WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
- WriteByte (MSG_BROADCAST, TE_TELEPORT);
- WriteCoord (MSG_BROADCAST, org_x);
- WriteCoord (MSG_BROADCAST, org_y);
- WriteCoord (MSG_BROADCAST, org_z);
- remove (s);
- };
-
-
- 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);
- sound (self, CHAN_VOICE, "misc/R_tele5.wav", 1, ATTN_NORM);
- spawn_hfog (ex.origin + v_forward*20);
- ex.nextthink = time + 0.1;
- ex.think = SUB_Remove;
- };
-
- void() holo_touch =
- {
- makevectors(self.angles);
- sound (self, CHAN_AUTO, "items/Inv1.wav", 1, ATTN_NORM);
- spawn_hfog (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;
- }
- };
-
- 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.
- sound (self, CHAN_AUTO, "items/Itembk2.wav", 1, ATTN_NORM);
- sprint (self, "Hologram launched...\n");
- };
-