Raised This Month: $32 Target: $400
 8% 

Block NVG Sound?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Stefanos
Senior Member
Join Date: May 2020
Old 08-17-2021 , 07:22   Block NVG Sound?
Reply With Quote #1

So i want to remove NVG sound, because when u are dead u can still press and other players will hear that sound when u turn off/on nightvision, so i want to remove it, or add spam protection so you cannot spam that button, i tried with unpreacacher but my whole console i spammed with:

SV_BuildSoundMsg: items/nvg_off.wav not precached (0)
SV_BuildSoundMsg: items/nvg_off.wav not precached (0)
SV_BuildSoundMsg: items/nvg_off.wav not precached (0)
SV_BuildSoundMsg: items/nvg_off.wav not precached (0)
SV_BuildSoundMsg: items/nvg_off.wav not precached (0)
SV_BuildSoundMsg: items/nvg_off.wav not precached (0)
SV_BuildSoundMsg: items/nvg_off.wav not precached (0)
SV_BuildSoundMsg: items/nvg_off.wav not precached (0)
SV_BuildSoundMsg: items/nvg_off.wav not precached (0)
Stefanos is offline
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 08-17-2021 , 10:19   Re: Block NVG Sound?
Reply With Quote #2

unprecacher won't actually stop the sound from playing, it just unprecache it so there is more slot of more custom sounds/models to be precache (because the game have the precache limit of 512)

You have to hook FM_EmitSound then block the sound there
Here is the TUT that you can follow: https://forums.alliedmods.net/showthread.php?t=45461
__________________
My plugin:

Last edited by Celena Luna; 08-17-2021 at 10:20.
Celena Luna is offline
Stefanos
Senior Member
Join Date: May 2020
Old 08-17-2021 , 10:21   Re: Block NVG Sound?
Reply With Quote #3

yes i dont understand anything there, is there plugin that will block that sound :/
Stefanos is offline
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 08-17-2021 , 11:05   Re: Block NVG Sound?
Reply With Quote #4

Untested
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

// Global Variables

new g_soundlist[] = {"items/nvg_off.wav""items/nvg_on.wav"}

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

public 
block_sound(entitychannel, const sound[]) {
    
    if ( 
equali(soundg_soundlist[0]) || equali(soundg_soundlist[1]))
        return 
FMRES_SUPERCEDE
    
else
        return 
FMRES_IGNORED

__________________
My plugin:

Last edited by Celena Luna; 10-03-2021 at 23:51.
Celena Luna is offline
Stefanos
Senior Member
Join Date: May 2020
Old 09-30-2021 , 18:17   Re: Block NVG Sound?
Reply With Quote #5

i still can hear sound played after i add this plugin.
Stefanos is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 10-02-2021 , 08:22   Re: Block NVG Sound?
Reply With Quote #6

Use the ON sound. The OFF sound is more like a scope click.
__________________
DJEarthQuake is offline
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 10-03-2021 , 23:51   Re: Block NVG Sound?
Reply With Quote #7

I updated the code on previous post. Can you check it?
__________________
My plugin:
Celena Luna is offline
Stefanos
Senior Member
Join Date: May 2020
Old 10-09-2021 , 19:18   Re: Block NVG Sound?
Reply With Quote #8

still not working
Stefanos is offline
Reply


Thread Tools
Display Modes

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 21:29.


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