Raised This Month: $ Target: $400
 0% 

Problem with replacing knife sound (emit_sound)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Pro Patria Finland
Senior Member
Join Date: Apr 2006
Location: BaronPub.com
Old 06-01-2007 , 16:17   Problem with replacing knife sound (emit_sound)
Reply With Quote #1

So, anyhows, long story short:

I replace sounds as suggested in this thread: http://forums.alliedmods.net/showthread.php?t=23303&

Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <fakemeta> new CBARHIT_SOUND[] = "sounds/cbar_hit1.wav" new CBARHIT_SOUND2[]    = "sounds/cbar_hit2.wav" new CBARBOD_SOUND[] = "sounds/cbar_hitbod1.wav" new CBARBOD_SOUND2[]    = "sounds/cbar_hitbod2.wav" new CBARBOD_SOUND3[]    = "sounds/cbar_hitbod3.wav" new CBARMISS_SOUND[]    = "sounds/cbar_miss1.wav" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_forward(FM_EmitSound,"fw_emitsound"); } public plugin_precache() {     precache_sound(CBARHIT_SOUND)     precache_sound(CBARHIT_SOUND2)     precache_sound(CBARBOD_SOUND)     precache_sound(CBARBOD_SOUND2)     precache_sound(CBARBOD_SOUND3)     precache_sound(CBARMISS_SOUND) } public fw_emitsound(entity,channel,sample[],Float:volume,Float:attenuation,fFlags,pitch) {         if(equal(sample,"weapons/knife_slash1.wav")) {             emit_sound(entity,channel,CBARMISS_SOUND,volume,attenuation,fFlags,pitch);     return FMRES_SUPERCEDE;     }     if(equal(sample,"weapons/knife_slash2.wav")) {      emit_sound(entity,channel,CBARMISS_SOUND,volume,attenuation,fFlags,pitch);     return FMRES_SUPERCEDE;     }         if(equal(sample,"weapons/knife_hitwall1.wav")) {      emit_sound(entity,channel,CBARHIT_SOUND,volume,attenuation,fFlags,pitch);     return FMRES_SUPERCEDE;     }         if(equal(sample,"weapons/knife_hit1.wav")) {      emit_sound(entity,channel,CBARBOD_SOUND,volume,attenuation,fFlags,pitch);     return FMRES_SUPERCEDE;     }             if(equal(sample,"weapons/knife_hit2.wav")) {     emit_sound(entity,channel,CBARBOD_SOUND2,volume,attenuation,fFlags,pitch);     return FMRES_SUPERCEDE;     }             if(equal(sample,"weapons/knife_hit3.wav")) {     emit_sound(entity,channel,CBARBOD_SOUND3,volume,attenuation,fFlags,pitch);     return FMRES_SUPERCEDE;     }         if(equal(sample,"weapons/knife_hit4.wav")) {     emit_sound(entity,channel,CBARBOD_SOUND3,volume,attenuation,fFlags,pitch);     return FMRES_SUPERCEDE;     }             return FMRES_IGNORED;   }
The plugin compiles. Then I add it to my AMXX plugins and start a game. The game does start, so it means that there should be no error in precaching the sounds. Still in game I have succesfully disabled the original knife sound, but I can't hear the new sound at all.

Okay, I am quite new to this whole scripting, and I am very new to Fakemeta. So laugh your heads off or whatever, but what am I doing wrong? Any suggestions to this problem?
__________________
I am not a number. I am Gordon Freeman!
Pro Patria Finland is offline
 



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 10:34.


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