Silencer
Created By: | Marius |
eMail: | lordshoel@yahoo.com |
Difficulty Scale: | Easy |
\Quake\Mymod\Sound\Weapons\silencer.wavNote: Mymod is the directory of this modification.
//Silencer .float silencer_on;The above does not need to be at the bottom but it is easy and will not interfere with anything that might cause errors.
if (self.impulse == 15) { if (self.silencer_on == FALSE) { self.silencer_on = TRUE; centerprint (self, "Silencer Acivated\n"); } else if (self.silencer_on == TRUE) { self.silencer_on = FALSE; centerprint (self, "Silencer Deacivated\n"); } }When you've finished there scroll up to the function W_Precache. At the bottom of that function paste:
precache_sound ("weapons/silencer.wav");Once that is done save and go onto Step 3.
sound (self, CHAN_WEAPON, "weapons/spike2.wav", 1, ATTN_NORM);With the following:
if (self.silencer_on == TRUE) sound (self, CHAN_WEAPON, "weapons/silencer.wav", 1, ATTN_NORM); else sound (self, CHAN_WEAPON, "weapons/spike2.wav", 1, ATTN_NORM);For the normal spikes replace:
sound (self, CHAN_WEAPON, "weapons/rocket1i.wav", 1, ATTN_NORM);With the following:
if (self.silencer_on == TRUE) sound (self, CHAN_WEAPON, "weapons/silencer.wav", 1, ATTN_NORM); else sound (self, CHAN_WEAPON, "weapons/rocket1i.wav", 1, ATTN_NORM);
self.silencer_on = FALSE;The above line turns the silencer off when entering the server, so when you die and respawn or start a new level the silencer is automatically off.
SuperDamageSound();That was the last part of code to be modified. All thats left is Step 6...