Raised This Month: $51 Target: $400
 12% 

[CSGO:REQ] mute weapon pickup sound


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wjdrkfka3
Junior Member
Join Date: Nov 2022
Old 11-06-2022 , 04:10   [CSGO:REQ] mute weapon pickup sound
Reply With Quote #1

I am a SM beginner running a few servers.

I need some plugin, no pickup(weapons,grenades...) sound.

I already searched many times that i coundn't find anything.

Could you help me?
wjdrkfka3 is offline
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
wjdrkfka3
Junior Member
Join Date: Nov 2022
Old 11-09-2022 , 05:24   Re: [CSGO:REQ] mute weapon pickup sound
Reply With Quote #3

Quote:
Originally Posted by Bacardi View Post
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;

wow thank you.

but when i compile the code, i got an error

//// MuteWeaponPickupSound.sp
//
// C:\Users\garam\Desktop\감옥서버 플러그인 소스모드\MuteWeaponPickupSound.sp(6) : error 100: function prototypes do not match
//
// 1 Error.
//
// Compilation Time: 0.2 sec
// ----------------------------------------
wjdrkfka3 is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 11-09-2022 , 05:36   Re: [CSGO:REQ] mute weapon pickup sound
Reply With Quote #4

works fine from
https://www.sourcemod.net/compiler.php
__________________
Do not Private Message @me
Bacardi is offline
wjdrkfka3
Junior Member
Join Date: Nov 2022
Old 11-09-2022 , 08:46   Re: [CSGO:REQ] mute weapon pickup sound
Reply With Quote #5

Quote:
Originally Posted by Bacardi View Post
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;

Quote:
Originally Posted by Bacardi View Post

Thank you so much!
wjdrkfka3 is offline
alasfourom
Senior Member
Join Date: Feb 2022
Location: Saudi Arabia
Old 11-09-2022 , 18:19   Re: [CSGO:REQ] mute weapon pickup sound
Reply With Quote #6

Quote:
Originally Posted by Bacardi View Post
soundEntry, "Player.PickupWeapon", true)
soundEntry, "BaseCombatCharacter.AmmoPickup", true)
soundEntry, "Player.PickupGrenade", true)
[/PHP]
May I know where can I find these in game sounds, since I will try to block some other sounds using your method.
__________________
alasfourom is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 11-09-2022 , 19:37   Re: [CSGO:REQ] mute weapon pickup sound
Reply With Quote #7

AddNormalSoundHook "soundEntry" show those.

Then you can enable from client console:
sv_max_allowed_developer 2
developer 2
sv_cheats 1
snd_show 1

- Yellow text is, sound emit from server side.
- Blue text is, sound emit from client side.


From ...scripts/game_sounds.txt you find "sound entries"
https://developer.valvesoftware.com/wiki/Soundscripts
Bacardi is offline
alasfourom
Senior Member
Join Date: Feb 2022
Location: Saudi Arabia
Old 11-10-2022 , 03:23   Re: [CSGO:REQ] mute weapon pickup sound
Reply With Quote #8

Quote:
Originally Posted by Bacardi View Post
AddNormalSoundHook "soundEntry" show those.

Then you can enable from client console:
sv_max_allowed_developer 2
developer 2
sv_cheats 1
snd_show 1

- Yellow text is, sound emit from server side.
- Blue text is, sound emit from client side.


From ...scripts/game_sounds.txt you find "sound entries"
https://developer.valvesoftware.com/wiki/Soundscripts
Excellent, thank you Bacardi 👍🏻
__________________
alasfourom is offline
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 10:56.


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