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

Mute Weapon Shots


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   General Purpose       
baneado
Veteran Member
Join Date: Dec 2012
Location: amxmodx-es.com
Old 08-08-2021 , 04:50   Mute Weapon Shots
Reply With Quote #1

This has been requested on so many post I read.
Finally, it's possible.

Description
The plugin will allow players to individually disable hearing weapon shots from other players.
It was made for "infinite ammo" servers or for zombies in zombie mods.

Command:
Say /mute to disable the shots sound

For developers:
The method used is changing groupinfo at PlaybackEvent.
Why is this possible? See these lines: https://github.com/dreamstalker/rehl...cmds.cpp#L1259

I want to change the command:
Go to this line
PHP Code:
register_clcmd("say /mute""clcmd_saymute"); 
and change by the command you want, example
PHP Code:
register_clcmd("say /hello""clcmd_saymute"); 
Attached Files
File Type: sma Get Plugin or Get Source (mute_weapon_shoots.sma - 227 views - 3.6 KB)

Last edited by baneado; 08-20-2021 at 13:37.
baneado is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 08-08-2021 , 06:27   Re: Mute Weapon Shoots
Reply With Quote #2

Interesting....

Now its possible to change the weapon fire sounds without recreating a whole new weapon !! Good Job
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 08-08-2021 at 06:27.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-08-2021 , 06:30   Re: Mute Weapon Shoots
Reply With Quote #3

Quote:
Originally Posted by Natsheh View Post
Interesting....

Now its possible to change the weapon fire sounds without recreating a whole new weapon !! Good Job
I don't think this is the case. This method allows you to mute the sounds from other players, not your own sounds.
__________________

Last edited by HamletEagle; 08-08-2021 at 06:31.
HamletEagle is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 08-08-2021 , 06:57   Re: Mute Weapon Shoots
Reply With Quote #4

I think its also possible to change the weapon entity pev_groupinfo so it wont emit the sound for the client
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 08-08-2021 at 06:58.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
baneado
Veteran Member
Join Date: Dec 2012
Location: amxmodx-es.com
Old 08-08-2021 , 14:50   Re: Mute Weapon Shoots
Reply With Quote #5

Quote:
Originally Posted by Natsheh View Post
I think its also possible to change the weapon entity pev_groupinfo so it wont emit the sound for the client
Not possible, look at code from ReHLDS I've posted.

It's related to invoker and receiver, not weapon entities.
baneado is offline
Snake.
Senior Member
Join Date: Jul 2017
Old 08-08-2021 , 15:14   Re: Mute Weapon Shots
Reply With Quote #6

Thank you!
Snake. is offline
Send a message via Skype™ to Snake.
deprale
Senior Member
Join Date: Oct 2018
Location: Leeds
Old 08-08-2021 , 20:25   Re: Mute Weapon Shots
Reply With Quote #7

Looks interesting, could also be useful for making new mods, like a "hitman" sniper mod, where you just mute the AWP for everyone (instead of using scout with damage modifier ).
Certainly can be applied on KZ as well if you support runs with multiple weapons, cba ppl running with m249 infinite ammo spamming whole map(yes some ppl actually like hearing jump sounds )


Question: Would this be able to also block knife slash sounds? Or nades hitting textures sounds?
__________________
deprale is offline
baneado
Veteran Member
Join Date: Dec 2012
Location: amxmodx-es.com
Old 08-09-2021 , 04:07   Re: Mute Weapon Shots
Reply With Quote #8

Quote:
Originally Posted by deprale View Post
Looks interesting, could also be useful for making new mods, like a "hitman" sniper mod, where you just mute the AWP for everyone (instead of using scout with damage modifier ).
Certainly can be applied on KZ as well if you support runs with multiple weapons, cba ppl running with m249 infinite ammo spamming whole map(yes some ppl actually like hearing jump sounds )


Question: Would this be able to also block knife slash sounds? Or nades hitting textures sounds?
If you want to mute an invoker for all players, will be better to return supercede instead changing groupinfo for all.

Knife sounds can be blocked at FM_EmitSound.

About nades, I don't know. Just test emitsound forward too.
baneado is offline
iclassdon
AlliedModders Donor
Join Date: May 2006
Old 08-10-2021 , 12:10   Re: Mute Weapon Shots
Reply With Quote #9

Can you add support to mute wav and mp3 if possible?

Last edited by iclassdon; 08-10-2021 at 12:11.
iclassdon is offline
Send a message via MSN to iclassdon
baneado
Veteran Member
Join Date: Dec 2012
Location: amxmodx-es.com
Old 08-10-2021 , 17:55   Re: Mute Weapon Shots
Reply With Quote #10

Quote:
Originally Posted by iclassdon View Post
Can you add support to mute wav and mp3 if possible?
The plugin is blocking an event to a receiver, that result he won't listen shot sounds.

Really, plugin isn't blocking any sound (weapon fire sounds can't be blocked, you can just make a workaround to not be played to other players different from shooter).

If you want to block any sound, just hook FM_EmitSound and test if it will work. Not all sounds can be catched in that forward.

Last edited by baneado; 08-10-2021 at 17:59.
baneado 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 03:03.


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