Raised This Month: $ Target: $400
 0% 

How to block a sound


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 08-26-2009 , 08:34   How to block a sound
Reply With Quote #1

Simple question... how can i block a sound that is in the "sound" folder? In "cstrike", not "valve".

Thx to much.
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 08-26-2009 , 08:38   Re: How to block a sound
Reply With Quote #2

FM_EmitSound ?
__________________
xPaw is offline
Old 08-27-2009, 01:09
Alucard^
This message has been deleted by Alucard^. Reason: my mistake
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 08-27-2009 , 01:28   Re: How to block a sound
Reply With Quote #4

Sry, i forget about that... now i tried this but doesn't work:

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

#define PLUGIN    "Warped block sound"
#define AUTHOR    "Alucard"
#define VERSION    "1.0"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    new 
mapname[32]
    
get_mapname(mapnamecharsmax(mapname) )
    
    if(
equali(mapname"surf_warped") )
        
register_forward(FM_EmitSound,"MapSound")
}

public 
MapSound(idchannel, const sound[])
{
    if(
equal(sound"ravesound.wav") )
        return 
FMRES_SUPERCEDE
    
    
return FMRES_IGNORED

Is wrong?

Thx.
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...

Last edited by Alucard^; 08-27-2009 at 01:54.
Alucard^ is offline
Send a message via Skype™ to Alucard^
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-27-2009 , 01:38   Re: How to block a sound
Reply With Quote #5

That would be right if the sound is at:
cstrike/sound/ravesound.wav
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 08-27-2009 , 01:48   Re: How to block a sound
Reply With Quote #6

Hmm and... what is wrong?

The specific destination of file? ("ravesound.wav")

Or the FM_EmitSound to detect a sound that is in "cstrike/sound"?

Or something new that i have to do into the FM_EmitSound?

Thx.

EDIT: Also, changed equali to equal cuz is useless to use that here ><
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...

Last edited by Alucard^; 08-27-2009 at 01:54.
Alucard^ is offline
Send a message via Skype™ to Alucard^
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-27-2009 , 01:53   Re: How to block a sound
Reply With Quote #7

I said that if the sound file for that map is located at: cstrike/sound/ravesound.wav then your plugin should work fine.
EmitSound hooks sound files from the cstrike/sound directory.

Example, if you are hooking the cstrike/sound/weapons/knife_deploy1.wav , then you would use "weapons/knife_deploy1.wav" in the plugin.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 08-27-2009 , 02:04   Re: How to block a sound
Reply With Quote #8

Oh, i misunderstand what you said...

So, my plugin should work fine, the problem is that don't work o.o

P.S: Is a sound of the map (surf_warped) maybe this is the problem? =/
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 08-27-2009 , 17:06   Re: How to block a sound
Reply With Quote #9

This should work. Didn't test it though...

PHP Code:
public plugin_precache()
    
register_forward(FM_KeyValue"fwd_KeyValue");

public 
fwd_KeyValue(const iEnt, const hKvd)
{
    if(
pev_valid(iEnt))
    {
        new 
szValue[48];
        
get_kvd(hKvdKV_ValueszValuesizeof(szValue)-1);
        if(
equal(szValue"ravesound.wav"))
            return 
FMRES_SUPERCEDE;
    }
    
    return 
FMRES_IGNORED;

hlstriker is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 09-02-2009 , 06:32   Re: How to block a sound
Reply With Quote #10

Hi... i post to say: "Thx hlstriker"...

The code work perfect...

Thx to much.

EDIT: Oh and, i have another question... how to block the sound for only certains players...? I dont want the complete code, i want the method.
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...

Last edited by Alucard^; 09-02-2009 at 06:38.
Alucard^ is offline
Send a message via Skype™ to Alucard^
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 15:08.


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