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

[ H3LP ] TakeDamage Sound Block


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DarthMan
Veteran Member
Join Date: Aug 2011
Old 07-03-2017 , 07:11   [ H3LP ] TakeDamage Sound Block
Reply With Quote #1

So i have this set of sounds.

Code:
new const g_szSound[][]{     "sound/player/pl_jumpland2.wav",     "sound/player/pl_fallpain1.wav",     "sound/player/pl_fallpain2.wav",     "sound/player/pl_fallpain3.wav",     "sound/common/bodysplat.wav" }

Any way I can block these sounds from being played when?
Those are damage sounds when the player falls.
Thanks !

Last edited by DarthMan; 07-03-2017 at 07:11.
DarthMan is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-03-2017 , 07:57   Re: [ H3LP ] TakeDamage Sound Block
Reply With Quote #2

Try with FM_EmitSound.
__________________
HamletEagle is offline
DarthMan
Veteran Member
Join Date: Aug 2011
Old 07-03-2017 , 08:06   Re: [ H3LP ] TakeDamage Sound Block
Reply With Quote #3

Quote:
Originally Posted by HamletEagle View Post
Try with FM_EmitSound.
I did, but it doesn't work.

Code:
public FwdEmitSound( id, iChannel, const szSound[ ], Float:fVol, Float:fAttn, iFlags, iPitch ) {     if(!g_IsThisTheMap)         return FMRES_IGNORED;         for(new i = 0; i < sizeof(g_szSound); i++)     {         if( containi(szSound, g_szSound[i]) != -1 )          {              forward_return(FMV_CELL, 0)              return FMRES_SUPERCEDE;         }      }     return FMRES_IGNORED; }

Last edited by DarthMan; 07-03-2017 at 08:07.
DarthMan is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 07-03-2017 , 09:17   Re: [ H3LP ] TakeDamage Sound Block
Reply With Quote #4

try equali insteand of containi, and show the whole code, also did you make some debug tests to see if your public is called ?
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
DarthMan
Veteran Member
Join Date: Aug 2011
Old 07-03-2017 , 09:30   Re: [ H3LP ] TakeDamage Sound Block
Reply With Quote #5

Quote:
Originally Posted by Craxor View Post
try equali insteand of containi, and show the whole code, also did you make some debug tests to see if your public is called ?
This is the whole code that must block the sounds.
If u mean the global var and other stuff, then that's part of a private plugin that I can sadly not share. If I could, I would.

Last edited by DarthMan; 07-03-2017 at 09:39.
DarthMan is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 07-03-2017 , 09:39   Re: [ H3LP ] TakeDamage Sound Block
Reply With Quote #6

Don't ignore what i'm saying.

1. Post the whole code ( plugin init register_forward Fm_EmitSound registration) + Use equali insteand of containi() + Do some debugs tests to see if your public is called, if someone give you an advice read the whole reply!
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
DarthMan
Veteran Member
Join Date: Aug 2011
Old 07-03-2017 , 10:00   Re: [ H3LP ] TakeDamage Sound Block
Reply With Quote #7

Quote:
Originally Posted by Craxor View Post
Don't ignore what i'm saying.

1. Post the whole code ( plugin init register_forward Fm_EmitSound registration) + Use equali insteand of containi() + Do some debugs tests to see if your public is called, if someone give you an advice read the whole reply!
Yeah ik but 99% fo the time, no matter what I do and what issue I ahve and how ti can be solved, ppl always tell me to post the whole code and not just what points to that function, and they give reasons that everytime u ask for help even if u ask for a certain fucntion, there can be ppl looking for stuff that u made so it's usefull to post the whole code all the time and if possible, even release it on the forum and wait for approval. Reason y I can't do this is ebcause if i would do that then i'll kinda be forced to release my whole maxMod set of plug-ins on the web because ppl would always ask for the whole code. I only post the whole code when I feel it's rly necessary and has to do with my issue, else there simply is no need to. If 100% of all plugins ever made in the world were on allied, then everyone could benefit from them and a lot fo servers will lose players because they would copy the other servers. Some people want to do private stuff in order to attract ppl, because they would nowhere else find that stuff.
DarthMan is offline
DarthMan
Veteran Member
Join Date: Aug 2011
Old 07-03-2017 , 10:07   Re: [ H3LP ] TakeDamage Sound Block
Reply With Quote #8

Quote:
Originally Posted by Craxor View Post
Don't ignore what i'm saying.

1. Post the whole code ( plugin init register_forward Fm_EmitSound registration) + Use equali insteand of containi() + Do some debugs tests to see if your public is called, if someone give you an advice read the whole reply!
Code:
public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         if (!g_IsTFC)         FallDamage();     else     {         RegisterHam(Ham_TakeDamage, "player", "hw_TakeDamage", 0);         register_forward( FM_EmitSound, "FwdEmitSound" );     }         GetChecks(); }


Code:
public FwdEmitSound( id, iChannel, const szSound[ ], Float:fVol, Float:fAttn, iFlags, iPitch ) {     if(!g_IsThisTheMap)         return FMRES_IGNORED;         for(new i = 0; i < sizeof(g_szSound); i++)     {         if( containi(szSound, g_szSound[i]) != -1 )          {              forward_return(FMV_CELL, 0)              return FMRES_SUPERCEDE;         }      }     return FMRES_IGNORED; }

Last edited by DarthMan; 07-03-2017 at 10:07.
DarthMan is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-03-2017 , 10:48   Re: [ H3LP ] TakeDamage Sound Block
Reply With Quote #9

Do some debug to see if EmitSound is called for your sounds.
__________________
HamletEagle is offline
DarthMan
Veteran Member
Join Date: Aug 2011
Old 07-03-2017 , 11:30   Re: [ H3LP ] TakeDamage Sound Block
Reply With Quote #10

Quote:
Originally Posted by HamletEagle View Post
Do some debug to see if EmitSound is called for your sounds.
Good idea, I will try that, but I guess the problem is that those are client-side sounds so they can not be blocked.
DarthMan 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 07:45.


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