AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Help]Replaceing Sounds Temporarily (https://forums.alliedmods.net/showthread.php?t=3827)

Blunted1 07-15-2004 19:46

[Help]Replaceing Sounds Temporarily
 
Basically what I need done is temporarily replaceing all the knife sounds with different sounds for a certain player only (not everyone) and for a temporary time only (so that knife sounds can be reset to normal without restarting).
This could very well be 'unpossible', but it better not be :P

In essence I basically need a function full of these statements except they do not work:
Code:
   if (emit_sound(id,CHAN_WEAPON, "weapons/knife_hit1.wav", 0.5, ATTN_NORM, 0, PITCH_NORM)){     emit_sound(id,CHAN_WEAPON, "NewSound/New_Sound.wav", 0.5, ATTN_NORM, 0, PITCH_NORM)    }

So I guess I am probably after a function that doesnt exist like:
Code:
   if (sound_playing(id,CHAN_WEAPON, "weapons/knife_hit1.wav", 0.5, ATTN_NORM, 0, PITCH_NORM)){     emit_sound(id,CHAN_WEAPON, "NewSound/New_Sound.wav", 0.5, ATTN_NORM, 0, PITCH_NORM)    }

But if anyone does know some way to catch all of the knife sounds as they happen and replace them with different sounds for a certain ID for a given amount of time or any other way of doing this, then please let me know :?

Johnny got his gun 07-16-2004 05:08

AMXX 0.20 and its new wonderful DLL API is probably the way to go. :-)

Blunted1 07-16-2004 15:50

Quote:

Originally Posted by Johnny got his gun
AMXX 0.20 and its new wonderful DLL API is probably the way to go. :-)

Hello, hello..... long time no see..... somehow I knew it would be you that answered my question.
It had to be someone with alot of experience, but somehow out of those who weild that knowledge I just knew it would be you :P


I have two more questions for you JGHG (if you ever return to read this that is :P )
1. Why does everyone keep suggesting AMXx 0.20 as the answer to a problem.... when it doesnt exist!
Then again, if you feel like err.... giveing it to me somehow :P
2. Can you somehow help me find an alternate solution to what I want to do? Simply emiting a sound when a knife hits something and a different sound when it doesnt would be a decent step towards what I am trying to accomplish.... little help? :oops:

PM 07-16-2004 15:53

The best thing to do, like JGHG indirectly said, would be making a metamod plugin (amxx module).
There are two engineapi functions you can catch: EmitSound and EmitAmbientSound.

Blunted1 07-16-2004 16:03

Quote:

Originally Posted by PM
The best thing to do, like JGHG indirectly said, would be making a metamod plugin (amxx module).
There are two engineapi functions you can catch: EmitSound and EmitAmbientSound.

Yeah I got that :(
but I dont want to have to wait until AMXx 0.20, and I dont have a clue how to make my own module..... again, little help? :oops:

I am sure there must be a way to check if a player is attacking with a knife and again if he actually hits something and play one of two sounds accordingly..... or am I wrong again? :P

Johnny got his gun 07-16-2004 16:07

Well 0.20 is in the CVS. But the feature you're asking for isn't. I just played around with stuff as usual today and yes it is possible to catch the sound emited when a player swings his knife (actually there seems to be two different standard sounds for this), also when it hits a wall so I guess, no, I KNOW that what you are asking for is possible. It's possible with 0.16 too but takes more work, this stuff is just easier with 0.20... if you ask me. Though it will also require a new module. Expect to see a lot of new modules coming out for AMXX 0.20.
However not all sounds are played using emit_sound, for instance I couldn't find any ammofiring weapon that used it, dunno really what causes those sounds. The only reload sound that uses emit_sound was the XM shotgun. Don't ask me why, you can hear people reload most weapons. Dunno if I ever need to alter all those sounds anyway...

Speaking of sounds, for 0.20 I already made a plugin that lets you replace sounds in maps with whatever waves you have. I put the super mario tune instead of opera in cs_italy. It's already a hit :-)


All times are GMT -4. The time now is 14:40.

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