AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Block NVG Sound? (https://forums.alliedmods.net/showthread.php?t=333917)

Stefanos 08-17-2021 07:22

Block NVG Sound?
 
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)

Celena Luna 08-17-2021 10:19

Re: Block NVG Sound?
 
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

Stefanos 08-17-2021 10:21

Re: Block NVG Sound?
 
yes i dont understand anything there, is there plugin that will block that sound :/

Celena Luna 08-17-2021 11:05

Re: Block NVG Sound?
 
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



Stefanos 09-30-2021 18:17

Re: Block NVG Sound?
 
i still can hear sound played after i add this plugin.

DJEarthQuake 10-02-2021 08:22

Re: Block NVG Sound?
 
Use the ON sound. The OFF sound is more like a scope click.

Celena Luna 10-03-2021 23:51

Re: Block NVG Sound?
 
I updated the code on previous post. Can you check it?

Stefanos 10-09-2021 19:18

Re: Block NVG Sound?
 
still not working


All times are GMT -4. The time now is 08:49.

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