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

Remove Spawn Event Sounds


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DrunkenKoZ
Greetings, mortal.
Join Date: Aug 2008
Old 07-24-2022 , 09:20   Remove Spawn Event Sounds
Reply With Quote #1

I'm trying to remove the buying spawn events sounds when people respawn in deathmatch. The sounds that play when you buy equipment. I've been searching for it and tried a couple of things, but nothing seems to work. Any ideas on how I could achieve this?

Last edited by DrunkenKoZ; 07-24-2022 at 09:34.
DrunkenKoZ is offline
backwards
AlliedModders Donor
Join Date: Feb 2014
Location: USA
Old 07-24-2022 , 21:14   Re: Remove Spawn Event Sounds
Reply With Quote #2

which game?
__________________
I highly recommend joining the SourceMod Discord Server for real time support.
backwards is offline
DrunkenKoZ
Greetings, mortal.
Join Date: Aug 2008
Old 07-24-2022 , 22:26   Re: Remove Spawn Event Sounds
Reply With Quote #3

Quote:
Originally Posted by backwards View Post
which game?
It would be for Counter-Strike Source
DrunkenKoZ is offline
backwards
AlliedModders Donor
Join Date: Feb 2014
Location: USA
Old 07-25-2022 , 01:09   Re: Remove Spawn Event Sounds
Reply With Quote #4

This should work:

PHP Code:
#include <sdktools>

public OnPluginStart()
{
    
AddNormalSoundHook(view_as<NormalSHook>(Hook_NormalSound));
}

public 
Action Hook_NormalSound(int[] clientsint &numClientschar[] sampleint &clientint &channelfloat &volumeint &levelint &pitchint &flagschar[] soundEntryint &seed)

    if(
StrEqual(sample"items/itempickup.wav") || StrEqual(sample"items/ammopickup.wav") || StrEqual(sample"weapons/knife/knife_deploy1.wav"))
    {
        
volume 0.0
        return 
Plugin_Changed
    }
    
    return 
Plugin_Continue;

__________________
I highly recommend joining the SourceMod Discord Server for real time support.
backwards is offline
DrunkenKoZ
Greetings, mortal.
Join Date: Aug 2008
Old 07-25-2022 , 02:53   Re: Remove Spawn Event Sounds
Reply With Quote #5

Quote:
Originally Posted by backwards View Post
This should work:

PHP Code:
#include <sdktools>

public OnPluginStart()
{
    
AddNormalSoundHook(view_as<NormalSHook>(Hook_NormalSound));
}

public 
Action Hook_NormalSound(int[] clientsint &numClientschar[] sampleint &clientint &channelfloat &volumeint &levelint &pitchint &flagschar[] soundEntryint &seed)

    if(
StrEqual(sample"items/itempickup.wav") || StrEqual(sample"items/ammopickup.wav") || StrEqual(sample"weapons/knife/knife_deploy1.wav"))
    {
        
volume 0.0
        return 
Plugin_Changed
    }
    
    return 
Plugin_Continue;

Error compiling with the following;
Code:
//// soundhook.sp
//
// soundhook.sp(5) : error 100: function prototypes do not match
//
// 1 Error.
//
// Compilation Time: 0.17 sec
// ----------------------------------------
Code:
   AddNormalSoundHook(view_as<NormalSHook>(Hook_NormalSound));
DrunkenKoZ is offline
backwards
AlliedModders Donor
Join Date: Feb 2014
Location: USA
Old 07-25-2022 , 03:43   Re: Remove Spawn Event Sounds
Reply With Quote #6

Really strange that it compiles for me on sourcemod 1.11 without any issue. Are you running an older version of sourcemod?

replace:

PHP Code:
public Action Hook_NormalSound(int[] clientsint &numClientschar[] sampleint &clientint &channelfloat &volumeint &levelint &pitchint &flagschar[] soundEntryint &seed
with:

PHP Code:
public Action Hook_NormalSound(int clients[MAXPLAYERS], int &numClientschar sample[PLATFORM_MAX_PATH], int &entityint &channelfloat &volumeint &levelint &pitchint &flagschar soundEntry[PLATFORM_MAX_PATH], int &seed
from https://github.com/alliedmodders/sourcepawn/issues/523
__________________
I highly recommend joining the SourceMod Discord Server for real time support.
backwards is offline
DrunkenKoZ
Greetings, mortal.
Join Date: Aug 2008
Old 07-26-2022 , 09:15   Re: Remove Spawn Event Sounds
Reply With Quote #7

I use the latest version of sourcemod/metamod. More specifically 1.11.0.6906. The problem was that it said it "compiled" with one error, but didn't actually output the smx.

The second one worked though, thank you for the help.

Last edited by DrunkenKoZ; 07-26-2022 at 09:15.
DrunkenKoZ 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 19:12.


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