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

how to block SendAudio?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Owyn
Veteran Member
Join Date: Nov 2007
Old 07-07-2010 , 05:21   how to block SendAudio?
Reply With Quote #1

i do
PHP Code:
register_messageget_user_msgid"SendAudio" ),"message_sendaudio" ); 

public 
message_sendaudiomsg_idmsg_destmsg_entity )
{
    static 
message[10];
    
get_msg_arg_string2messagesizeof message );

    switch( 
message[7] )
    {
        
// -- %!MRAD_terwin ; %!MRAD_ctwin ; %!MRAD_rounddraw
        
case 'c''t''r' : return end();
    }

    return 
PLUGIN_CONTINUE;
}

public 
end()
{
    
log_amx("blocked message");
    return 
PLUGIN_HANDLED;

we get "blocked message" and I don't hear "Terrorist Win" etc sounds but event is called

PHP Code:
register_event("SendAudio","end_round","a","2=%!MRAD_terwin","2=%!MRAD_ctwin","2=%!MRAD_rounddraw");

public 
end_round()
{
    
log_amx("is still called");

we get "is still called" =\
__________________
☜ Free Mozy ☂backup\҉sync user
Quote:
Американский форум - Задаёшь вопрос, потом тебе отвечают.
Израильский форум - Задаёшь вопрос, потом тебе задают вопрос.
Русский форум - Задаёшь вопрос, потом тебе долго рассказывают, какой ты мудак.
Owyn is offline
Send a message via ICQ to Owyn
Brreaker
Senior Member
Join Date: Oct 2009
Location: Constanta, Romania
Old 07-07-2010 , 12:41   Re: how to block SendAudio Event?
Reply With Quote #2

PHP Code:
register_event("SendAudio","end_round","a","2=%!MRAD_terwin","2=%!MRAD_ctwin","2=%!MRAD_rounddraw");

public 
end_round()
{
    return 
PLUGIN_HANDLED;

__________________
There are 10 kinds of people.Those who understand binary, and those who don't.
Also, for those who understand binary, there is a donation tab too!
No steam || PM support!
Brreaker is offline
Send a message via MSN to Brreaker Send a message via Yahoo to Brreaker
Owyn
Veteran Member
Join Date: Nov 2007
Old 07-07-2010 , 12:57   Re: how to block SendAudio Event?
Reply With Quote #3

have you tested before post?
__________________
☜ Free Mozy ☂backup\҉sync user
Quote:
Американский форум - Задаёшь вопрос, потом тебе отвечают.
Израильский форум - Задаёшь вопрос, потом тебе задают вопрос.
Русский форум - Задаёшь вопрос, потом тебе долго рассказывают, какой ты мудак.
Owyn is offline
Send a message via ICQ to Owyn
Brreaker
Senior Member
Join Date: Oct 2009
Location: Constanta, Romania
Old 07-07-2010 , 13:22   Re: how to block SendAudio Event?
Reply With Quote #4

No, but when you return PLUGIN_HANDLED on an event, you just block it
__________________
There are 10 kinds of people.Those who understand binary, and those who don't.
Also, for those who understand binary, there is a donation tab too!
No steam || PM support!
Brreaker is offline
Send a message via MSN to Brreaker Send a message via Yahoo to Brreaker
Owyn
Veteran Member
Join Date: Nov 2007
Old 07-07-2010 , 13:40   Re: how to block SendAudio Event?
Reply With Quote #5

No, it blocks nothing
__________________
☜ Free Mozy ☂backup\҉sync user
Quote:
Американский форум - Задаёшь вопрос, потом тебе отвечают.
Израильский форум - Задаёшь вопрос, потом тебе задают вопрос.
Русский форум - Задаёшь вопрос, потом тебе долго рассказывают, какой ты мудак.
Owyn is offline
Send a message via ICQ to Owyn
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-07-2010 , 13:43   Re: how to block SendAudio Event?
Reply With Quote #6

Block a message doesn't block the corresponding event from being sent, you have to think to another way to do what you wanna do.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Owyn
Veteran Member
Join Date: Nov 2007
Old 07-07-2010 , 14:00   Re: how to block SendAudio Event?
Reply With Quote #7

"Block a message doesn't block" anything at all, even a message itself

1st plugin returns PLUGIN_HANDLED to event, 2nd plugin below 1st one still gets the event
__________________
☜ Free Mozy ☂backup\҉sync user
Quote:
Американский форум - Задаёшь вопрос, потом тебе отвечают.
Израильский форум - Задаёшь вопрос, потом тебе задают вопрос.
Русский форум - Задаёшь вопрос, потом тебе долго рассказывают, какой ты мудак.
Owyn is offline
Send a message via ICQ to Owyn
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-07-2010 , 14:03   Re: how to block SendAudio Event?
Reply With Quote #8

Quote:
Originally Posted by Owyn View Post
"Block a message doesn't block" anything at all, even a message itself

1st plugin returns PLUGIN_HANDLED to event, 2nd plugin below 1st one still gets the event

It actually blocks the sound from being sent, as a player you can't hear it.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Owyn
Veteran Member
Join Date: Nov 2007
Old 07-07-2010 , 14:21   Re: how to block SendAudio Event?
Reply With Quote #9

Quote:
Originally Posted by ConnorMcLeod View Post
It actually blocks the sound from being sent, as a player you can't hear it.
Actually it doesn't you still can hear it

that's why i tried working with messages
__________________
☜ Free Mozy ☂backup\҉sync user
Quote:
Американский форум - Задаёшь вопрос, потом тебе отвечают.
Израильский форум - Задаёшь вопрос, потом тебе задают вопрос.
Русский форум - Задаёшь вопрос, потом тебе долго рассказывают, какой ты мудак.
Owyn is offline
Send a message via ICQ to Owyn
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-07-2010 , 15:55   Re: how to block SendAudio?
Reply With Quote #10

If you block a SendAudio message using register_message and returning PLUGIN_HANDLED, sound is not sent, that's what i wrote since the begining.

But events are called in plugins, that's what you noticed and you are right.

So, depending on what you want to do, you have to think differently.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 23:19.


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