Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ===============================================================================
- ARMOR
- ===============================================================================
- */
- void() armor_touch;
- void() armor_touch =
- {
- local float type, value, bit;
- if (other.health <= 0)
- return;
- if (other.classname != "player")
- return;
- if (self.classname == "item_armor1")
- {
- type = 0.3;
- value = 100;
- bit = IT_ARMOR1;
- }
- if (self.classname == "item_armor2")
- {
- type = 0.6;
- value = 150;
- bit = IT_ARMOR2;
- }
- if (self.classname == "item_armorInv")
- {
- type = 0.8;
- value = 200;
- bit = IT_ARMOR3;
- }
- if (other.armortype*other.armorvalue >= type*value)
- return;
- other.armortype = type;
- other.armorvalue = value;
- other.items = other.items - (other.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)) + bit;
- self.solid = SOLID_NOT;
- self.model = string_null;
- if (deathmatch == 1)
- self.nextthink = time + 20;
- self.think = SUB_regen;
- sprint (other, "You got ");
- sprint (other, self.netname);
- sprint (other, "\n");
- // armor touch sound
- sound(other, CHAN_ITEM, self.noise, 1, ATTN_NORM);
- stuffcmd (other, "bf\n");
- activator = other;
- SUB_UseTargets(); // fire all targets / killtargets
- };
- /*QUAKED item_armor1 (0 .5 .8) (-16 -16 0) (16 16 32)
- */
- void() item_armor1 =
- {
- self.touch = armor_touch;
- precache_model ("progs/armor.mdl");
- precache_sound ("items/armor1.wav");
- setmodel (self, "progs/armor.mdl");
- self.noise = "items/armor1.wav";
- self.skin = 0;
- setsize (self, '-16 -16 0', '16 16 56');
- self.netname = "the Light Armor";
- StartItem ();
- };
- /*QUAKED item_armor2 (0 .5 .8) (-16 -16 0) (16 16 32)
- */
- void() item_armor2 =
- {
- self.touch = armor_touch;
- precache_model ("progs/armor.mdl");
- precache_sound ("items/armor2.wav");
- setmodel (self, "progs/armor.mdl");
- self.noise = "items/armor2.wav";
- self.skin = 1;
- setsize (self, '-16 -16 0', '16 16 56');
- self.netname = "the Combat Armor";
- StartItem ();
- };
- /*QUAKED item_armorInv (0 .5 .8) (-16 -16 0) (16 16 32)
- */
- void() item_armorInv =
- {
- self.touch = armor_touch;
- precache_model ("progs/armor.mdl");
- precache_sound ("items/armor3.wav");
- setmodel (self, "progs/armor.mdl");
- self.noise = "items/armor3.wav";
- self.skin = 2;
- setsize (self, '-16 -16 0', '16 16 56');
- self.netname = "the Tank Armor";
- StartItem ();
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement