//dummy backpacks void () DetpackExplode = { if(deathmatch == 0) T_Damage (other, self, self.owner, 1000000); T_RadiusDamage (self, self.owner, 400, world, "backpack"); //This will create the damage radius, a grenade //does 120 but we want a BIG explosion. //So we'll ues 1000 !! ;-) //sound (self, CHAN_WEAPON, "weapons/r_exp3.wav", 1, ATTN_NORM); WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); //Sets up a temporary entity WriteByte (MSG_BROADCAST, TE_EXPLOSION); //Temporary entity is an explosion WriteCoord (MSG_BROADCAST, self.origin_x); //Create at Backpack Origins(x) WriteCoord (MSG_BROADCAST, self.origin_y); //Create at Backpack Origins(y) WriteCoord (MSG_BROADCAST, self.origin_z); //Create at Backpack Origins(z) //BecomeExplosion (); //BANG !!! self.owner.backpack = time + 20; multicast (self.origin, MULTICAST_PHS); sprint (self.owner, PRINT_HIGH, "a thermal detonator exploded!\n"); remove(self); }; void() DetpackTouch = { if (other == self.owner) //If player touches their own detpack then ignore it { return; //Return to game } if (other.takedamage == DAMAGE_AIM) //If player/monster who touches detpack can take damage { sprint (self.owner, PRINT_HIGH, "The booby trap was tripped!\n"); DetpackExplode(); //BANG !!! return; //Return to game. } if (self.velocity == '0 0 0') //If backpack isn't moving then:- { self.avelocity = '0 0 0'; //prevent it moving angularly (I think ?!?!? ) } }; void() DropDetpack = { if(self.backpack == 1) { sprint (self, PRINT_HIGH, "no more than 1 detonator at a time!\n"); return; } // CQ // place a time limit til the next backpack can be dropped if(time < self.backpack) { sprint(self, PRINT_HIGH, "Too soon to drop a thermal detonator!\n"); return; } // CQ if (self.ammo_rockets >= 25) //Check to see if player has 25+ rockets { if(deathmatch > 0) self.ammo_rockets = self.ammo_rockets - 25; //reduce rockets by 25 local entity item; //create a variable called item item = spawn(); //spawn an item item.origin = self.origin - '0 0 24'; //create item at 24 above player item.velocity_z = 300; //items vertical velocity item.velocity_x = -100 + (random() * 200); //Item is thrown in... item.velocity_y = -100 + (random() * 200); //a random direction item.flags = FL_ITEM; item.solid = SOLID_TRIGGER; //Trigger an event when touched item.movetype = MOVETYPE_TOSS; //Movement type..ie. throw it !! setmodel (item, "progs/backpack.mdl"); //Graphic to be thrown setsize (item, '-16 -16 0', '16 16 56'); //Set size of graphic item.owner = self; //set item.owner to players ident item.classname = "detonator"; item.touch = DetpackTouch; //if item is touched then goto DetpackTouch item.nextthink = time + 120; //After two minutes execute item.think item.think = DetpackExplode; //So after two minutes execute DetpackExplode self.backpack = 1; // CQ sprint (self, PRINT_HIGH, "Dropped!\n"); // CQ } else //Not Enough rockets... { //sprint (self, "not enough ammo.\n"); //Print to player..."You ain't got enough ammo!!" soundtoclient (self, self, CHAN_WEAPON, "deny.wav", 1, ATTN_NORM); return; //return to game } };