View Single Post
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 11-09-2022 , 03:32   Re: [CSGO:REQ] mute weapon pickup sound
Reply With Quote #2

I got work this way.
- Client itself EmitSound "Player.PickupWeapon" when "item_pickup" event trigger.
With this code you block event.

*edit
I found more sounds. When player pickup while running, it make sound.
PHP Code:

#include <sdktools>

public void OnPluginStart()
{
    
HookEvent("item_pickup"item_pickupEventHookMode_Pre);
    
AddNormalSoundHook(soundhook);
}


public 
Action item_pickup(Event event, const char[] namebool dontBroadcast)
{
    return 
Plugin_Handled;
}

public 
Action soundhook(int clients[MAXPLAYERS], int &numClientschar sample[PLATFORM_MAX_PATH],
      
int &entityint &channelfloat &volumeint &levelint &pitchint &flags,
      
char soundEntry[PLATFORM_MAX_PATH], int &seed)
{
    if(
StrEqual(soundEntry"Player.PickupWeapon"true) ||
        
StrEqual(soundEntry"BaseCombatCharacter.AmmoPickup"true) ||
        
StrEqual(soundEntry"Player.PickupGrenade"true))
    {
        return 
Plugin_Handled;
    }

    return 
Plugin_Continue;

__________________
Do not Private Message @me

Last edited by Bacardi; 11-09-2022 at 03:43.
Bacardi is offline