AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Blocking or replacing weapon sounds (https://forums.alliedmods.net/showthread.php?t=249283)

Strick3n 10-03-2014 16:21

Blocking or replacing weapon sounds
 
Hello, is there any way to block or replace weapon sounds?

EDIT:
AFAIK there is a way to block and replace the knife sounds, but when i'm trying to do it on weapons it doesn't work..

wickedd 10-03-2014 18:42

Re: Blocking or replacing weapon sounds
 
Quote:

Originally Posted by Strick3n (Post 2206650)
EDIT:
AFAIK there is a way to block and replace the knife sounds, but when i'm trying to do it on weapons it doesn't work..

That's because they are client side.

Kuma77 10-03-2014 21:27

Re: Blocking or replacing weapon sounds
 
1 Attachment(s)
check if this plugin can help you

neverminde 10-04-2014 01:30

Re: Blocking or replacing weapon sounds
 
You cant do it with other weapons except knife.
There are some methods for block animation and all weapon sounds at the same time. ( not cool )
Also you can create new weapon with same animation, ammo bpammo num etc. This method allow set any sound you want.

Kuma77 10-04-2014 02:10

Re: Blocking or replacing weapon sounds
 
Quote:

Originally Posted by neverminde (Post 2206811)
You cant do it with other weapons except knife.
There are some methods for block animation and all weapon sounds at the same time. ( not cool )
Also you can create new weapon with same animation, ammo bpammo num etc. This method allow set any sound you want.

true i found this code

PHP Code:

#include <amxmodx>
#include <cstrike>
#include <fakemeta>

new new_knife_sound_ct[] = "weapons/newknife_hitwall1.wav"
new old_knife_sound_ct[] = "weapons/knife_hitwall1.wav"
new new_knife_sound_t[] = "weapons/newknife_hitwall1.wav"
new old_knife_sound_t[] = "weapons/knife_hitwall1.wav"

new new_knife_sound_ct_resource[] = "weapons/newknife_hitwall1.wav"
new old_knife_sound_ct_resource[] = "weapons/knife_hitwall1.wav"
new new_knife_sound_t_resource[] = "weapons/newknife_hitwall1.wav"
new old_knife_sound_t_resource[] = "weapons/knife_hitwall1.wav"

public plugin_init()
{
    
register_forward(FM_EmitSound"FmEmitSound")
}

public 
plugin_precache()
{
    
precache_sound(new_knife_sound_ct_resource)
    
precache_sound(old_knife_sound_ct_resource)
    
precache_sound(new_knife_sound_t_resource)
    
precache_sound(old_knife_sound_t_resource)
}

public 
FmEmitSound(idchannel, const sample[], Float:volumeFloat:attenuationflagspitch)
{
    if(
equali(sampleold_knife_sound_ct))
    {
        
engfunc(EngFunc_EmitSoundidchannelnew_knife_sound_ctvolumeattenuationflagspitch)
    }
    if(
equali(sampleold_knife_sound_t))
    {
        
engfunc(EngFunc_EmitSoundidchannelnew_knife_sound_tvolumeattenuationflagspitch)
    }



HamletEagle 10-04-2014 10:01

Re: Blocking or replacing weapon sounds
 
You can change the sound that you hear from others weapons in PlayBackEvent. Weapons sounds are client side, the only one that is played in FM_EmitSound is the knife sound, so you can easy change it. About other weapons, you may find some silly ways( hook TraceAttack and play a new sound etc ), but there is no good solution for it.

Kuma77 10-04-2014 14:44

Re: Blocking or replacing weapon sounds
 
Quote:

Originally Posted by HamletEagle (Post 2206960)
You can change the sound that you hear from others weapons in PlayBackEvent. Weapons sounds are client side, the only one that is played in FM_EmitSound is the knife sound, so you can easy change it. About other weapons, you may find some silly ways( hook TraceAttack and play a new sound etc ), but there is no good solution for it.

So it can be with knife only !,


All times are GMT -4. The time now is 17:29.

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