Raised This Month: $ Target: $400
 0% 

Blocking Fire in the hole sound and text


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Cheap_Suit
Veteran Member
Join Date: May 2004
Old 06-02-2006 , 16:25   Blocking Fire in the hole sound and text
Reply With Quote #1

I tryed this, but i never got a print out

Code:
public msg_text() {     if(get_msg_args() != 5 || get_msg_argtype(3) != ARG_STRING || get_msg_argtype(5) != ARG_STRING) {         return PLUGIN_CONTINUE     }     new arg3[16]     get_msg_arg_string(3, arg3, 15)     if(!equal(arg3, "#Game_radio")) {         return PLUGIN_CONTINUE     }     new arg5[20]     get_msg_arg_string(5, arg5, 19)     if(equal(arg5, "#Fire_in_the_hole"))     {         client_print(0, print_chat, "blocked")         return PLUGIN_HANDLED     }     return PLUGIN_CONTINUE }
and what about the sound?
__________________
HDD fried, failed to backup files. Sorry folks, just don't have free time anymore. This is goodbye.
Cheap_Suit is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 06-02-2006 , 16:27  
Reply With Quote #2

Did you try catching EmitSound?
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Cheap_Suit
Veteran Member
Join Date: May 2004
Old 06-02-2006 , 16:35  
Reply With Quote #3

I dont think the fire in the hole is emitted
__________________
HDD fried, failed to backup files. Sorry folks, just don't have free time anymore. This is goodbye.
Cheap_Suit is offline
Bo0m!
Veteran Member
Join Date: Mar 2006
Location: New Jersey
Old 06-02-2006 , 16:49  
Reply With Quote #4

The he arena plugin has a block for 'fire in the hole' and it works rather well, maybe you can find what your looking for in it.
Attached Files
File Type: sma Get Plugin or Get Source (he_arena.sma - 1548 views - 8.2 KB)
__________________
Bo0m! is offline
Send a message via AIM to Bo0m! Send a message via MSN to Bo0m! Send a message via Yahoo to Bo0m!
Cheap_Suit
Veteran Member
Join Date: May 2004
Old 06-02-2006 , 16:57  
Reply With Quote #5

I think register_message is broken. I tryed that with my plugin and didnt work. I also tryed the plugin, also didnt block the sound & text.

Thanks anyways
__________________
HDD fried, failed to backup files. Sorry folks, just don't have free time anymore. This is goodbye.
Cheap_Suit is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 06-03-2006 , 12:32  
Reply With Quote #6

It's not broken. This works (tested):
Code:
public plugin_init() {     register_message(get_user_msgid("TextMsg"), "msg_text")     register_message(get_user_msgid("SendAudio"), "msg_audio") } public msg_text() {     if(get_msg_args() != 5 || get_msg_argtype(3) != ARG_STRING || get_msg_argtype(5) != ARG_STRING) {         return PLUGIN_CONTINUE     }     new arg3[16]     get_msg_arg_string(3, arg3, 15)     if(!equal(arg3, "#Game_radio")) {         return PLUGIN_CONTINUE     }     new arg5[20]     get_msg_arg_string(5, arg5, 19)     if(equal(arg5, "#Fire_in_the_hole"))     {         client_print(0, print_chat, "Text blocked")         return PLUGIN_HANDLED     }     return PLUGIN_CONTINUE } public msg_audio() {     if(get_msg_args() != 3 || get_msg_argtype(2) != ARG_STRING) {         return PLUGIN_CONTINUE     }     new arg2[20]     get_msg_arg_string(2, arg2, 19)     if(equal(arg2[1], "!MRAD_FIREINHOLE"))     {         client_print(0, print_chat, "Audio blocked")         return PLUGIN_HANDLED     }     return PLUGIN_CONTINUE }
VEN is offline
Cheap_Suit
Veteran Member
Join Date: May 2004
Old 06-03-2006 , 16:02  
Reply With Quote #7

Thanks for the confirmation. Anyways the audio blocking is successful. But the text one failed. I had to get DS's Message Logging to fix this for myself. I found out that im getting different arguments from the one im checking. Is this only happening to me?

Code:
L 06/03/2006 - 12:56:19: Arg 1 (Byte "3") L 06/03/2006 - 12:56:19: Arg 2 (String "#Game_radio") L 06/03/2006 - 12:56:19: Arg 3 (String "Cheap_Suit") L 06/03/2006 - 12:56:19: Arg 4 (String "#Fire_in_the_hole") L 06/03/2006 - 12:56:19: MessageEnd (TextMsg "77")


BTW Thanks VEN
__________________
HDD fried, failed to backup files. Sorry folks, just don't have free time anymore. This is goodbye.
Cheap_Suit is offline
cigs
Senior Member
Join Date: Jul 2006
Old 08-23-2006 , 17:55   Re: Blocking Fire in the hole sound and text
Reply With Quote #8

It think it only happened to you, Cheap_Suit, cause it works just fine.

Now, I need some help with what I additionally tried to add in this plugin.
I added a custom sound (hepin.wav) sounding like a pin that is getting pulled out of the nade.

Here's what I made from it:

Code:
/*
Fire In The Hole Blocker
*/

#include <amxmodx>

#define PLUGIN "FITHBlocker"
#define VERSION "1.0"
#define AUTHOR "VEN & Cheap_Suit"

#define SOUND_HEPIN "misc/hepin.wav"

public plugin_init()
{
    register_plugin(PLUGIN,VERSION,AUTHOR)
    register_message(get_user_msgid("TextMsg"), "msg_text")
    register_message(get_user_msgid("SendAudio"), "msg_audio")
}


public msg_text()
{
    if(get_msg_args() != 5 || get_msg_argtype(3) != ARG_STRING || get_msg_argtype(5) != ARG_STRING) {
        return PLUGIN_CONTINUE
    }

    new arg3[16]
    get_msg_arg_string(3, arg3, 15)
    if(!equal(arg3, "#Game_radio")) {
        return PLUGIN_CONTINUE
    }

    new arg5[20]
    get_msg_arg_string(5, arg5, 19)
    if(equal(arg5, "#Fire_in_the_hole")) {
            return PLUGIN_HANDLED
    }

    return PLUGIN_CONTINUE
}

public msg_audio()
{
    if(get_msg_args() != 3 || get_msg_argtype(2) != ARG_STRING) {
        return PLUGIN_CONTINUE
    }

    new arg2[20]
    get_msg_arg_string(2, arg2, 19)
    if(equal(arg2[1], "!MRAD_FIREINHOLE"))
    {
        client_cmd(0,"spk %s", SOUND_HEPIN)
        return PLUGIN_HANDLED
    }

    return PLUGIN_CONTINUE
}
As you can see I added
Code:
#define SOUND_HEPIN "misc/hepin.wav"
and
Code:
client_cmd(0,"spk %s", SOUND_HEPIN)
This innitially works.
- But for some reason it doesn't work for some players ingame and it does for others
- And secondly, after about 15 minutes, people (including me) are getting sound problems on the server. (an echo-like soundproblem)
PS: I got confirmed by several people they've download the hepin.wav file

Is there anything wrong with what I added/did?
__________________

Last edited by cigs; 08-24-2006 at 07:12.
cigs is offline
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 08-23-2006 , 18:08   Re: Blocking Fire in the hole sound and text
Reply With Quote #9

try typing room_type 00 in console.
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
cigs
Senior Member
Join Date: Jul 2006
Old 08-23-2006 , 18:33   Re: Blocking Fire in the hole sound and text
Reply With Quote #10

So far so good. Though room_type was allready default on 0. So I've put it on 00. Don't know if that makes any diference.

Haven't tested with other players yet. That will be for tomorow.
Got my thumbs up.

Thx
__________________

Last edited by cigs; 08-23-2006 at 18:47.
cigs 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 16:34.


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