Raised This Month: $ Target: $400
 0% 

*Solved* Block all Sounds


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 05-21-2013 , 11:10   *Solved* Block all Sounds
Reply With Quote #1

When i use this code it blocks the falldmg sound and the sound when you press e

How can you fix that?
Code:
public EmitSound(id, channel, sample[])
{
 if(!is_user_alive(id)) 
  return FMRES_IGNORED
 
 new temp[2], weapon = get_user_weapon(id, temp[0], temp[1])
 if(weapon == CSW_KNIFE)
 { 
  if ( knife_model[id] == 2)
  {
   if(equal(sample,"weapons/knife_hit1.wav")) 
   {
    emit_sound(id, CHAN_WEAPON, "MuminDalen/katana_hit1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
   }
   else if(equal(sample,"weapons/knife_hit2.wav")) 
   {
    emit_sound(id, CHAN_WEAPON, "MuminDalen/katana_hit2.wav", 1.0, ATTN_NORM, 0, PITCH_NORM) 
   }
   else if(equal(sample,"weapons/knife_hit3.wav")) 
   {
    emit_sound(id, CHAN_WEAPON, "MuminDalen/katana_hit3.wav", 1.0, ATTN_NORM, 0, PITCH_NORM) 
   }
   else if(equal(sample,"weapons/knife_hit4.wav")) 
   {
    emit_sound(id, CHAN_WEAPON, "MuminDalen/katana_hit4.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
   }
   else if(equal(sample,"weapons/knife_stab.wav")) 
   {
    emit_sound(id, CHAN_WEAPON, "MuminDalen/katana_stab.wav", 1.0, ATTN_NORM, 0, PITCH_NORM) 
   }
   else if(equal(sample,"weapons/knife_hitwall1.wav")) 
   {
    emit_sound(id, CHAN_WEAPON, "MuminDalen/katana_hitwall1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM) 
   }
   else if(equal(sample,"weapons/knife_slash1.wav")) 
   {
    emit_sound(id, CHAN_WEAPON, "MuminDalen/katana_slash1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM) 
   }
   else if(equal(sample,"weapons/knife_slash2.wav")) 
   {
    emit_sound(id, CHAN_WEAPON, "MuminDalen/katana_slash2.wav", 1.0, ATTN_NORM, 0, PITCH_NORM) 
   }
   else if(equal(sample,"weapons/knife_deploy1.wav")) 
   {
    emit_sound(id, CHAN_WEAPON, "MuminDalen/katana_deploy1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM) 
   }
   return FMRES_SUPERCEDE
  }
 }
 
 return FMRES_IGNORED
}
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.

Last edited by ironskillz1; 05-21-2013 at 11:40.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 05-21-2013 , 11:17   Re: Block all sounds
Reply With Quote #2

Because you've written it so if a player is carrying a knife and has the specific knife model, then you supercede all other sounds, which you shouldn't. You should also use a loop to check for replacing sounds. Take a look at Chronic's Weapon Model Replacement.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 05-21-2013 , 11:40   Re: Block all sounds
Reply With Quote #3

Quote:
Originally Posted by hornet View Post
Because you've written it so if a player is carrying a knife and has the specific knife model, then you supercede all other sounds, which you shouldn't. You should also use a loop to check for replacing sounds. Take a look at Chronic's Weapon Model Replacement.
Solved
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:19.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode