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

Solved [HELP] Replacing "Fire In The Hole"


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hellmonja
Senior Member
Join Date: Oct 2015
Old 01-17-2017 , 12:24   [HELP] Replacing "Fire In The Hole"
Reply With Quote #1

Like the title says, that's all I want to do. It seems simple enough but for some reason it doesn't work. When I remove the codes for the custom messages it works but when it's there it doesn't do anything, not even block the original sound.
PHP Code:
public Message_Audio(msg_idmsg_destmsg_entity)
{
    if(
get_msg_args() != || get_msg_argtype(2) != ARG_STRING)
        return 
PLUGIN_CONTINUE


    
new arg2[20], wpn get_user_weapon(msg_entity);
    
get_msg_arg_string(2arg219);
    
    if(
equal(arg2[1], "!MRAD_FIREINHOLE"))
    {

        if(
wpn == CSW_HEGRENADE)
        {
            
emessage_begin(MSG_ONE_UNRELIABLEg_iMsgSendAudio_msg_entity);
            
ewrite_byte(msg_entity);
            
ewrite_string(grenade_snds[random_num(01)]);
            
ewrite_short(PITCH_NORM);
            
emessage_end();
        }
        
        return 
PLUGIN_HANDLED

    
}

    return 
PLUGIN_CONTINUE

I've checked the API, the forums, some Russian sites I had to translate, and everything I could think of to google. I just want some help. Please don't make feel a lot more stupid than I already am...
__________________

Last edited by hellmonja; 01-21-2017 at 13:09. Reason: Solved...
hellmonja is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 01-17-2017 , 13:21   Re: [HELP] Replacing "Fire In The Hole"
Reply With Quote #2

I have posted this for a member here - https://forums.alliedmods.net/showpo...66&postcount=5

This have what u want
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-17-2017 , 15:57   Re: [HELP] Replacing "Fire In The Hole"
Reply With Quote #3

Why are you using emessage?
__________________
HamletEagle is offline
PartialCloning
Senior Member
Join Date: Dec 2015
Old 01-18-2017 , 20:14   Re: [HELP] Replacing "Fire In The Hole"
Reply With Quote #4

Your code works for me.
PartialCloning is offline
hellmonja
Senior Member
Join Date: Oct 2015
Old 01-19-2017 , 03:06   Re: [HELP] Replacing "Fire In The Hole"
Reply With Quote #5

Quote:
Originally Posted by HamletEagle View Post
Why are you using emessage?
Perhaps not the best version that I should have posted here. I already have a number of versions of this plugin and as it turns out this the latest I was working on. But they all behave in a similar way: Anything I put before the "PLUGIN_HANDLED" line cancels out any effect the plugin has, even the effect of blocking the default radio sound.

Quote:
Originally Posted by PartialCloning View Post
Your code works for me.
Interesting. Then I should reinstall a fresh copy of vanilla CS and test it there. This CS I use for testing has seen countless plugins already...
__________________
hellmonja is offline
PartialCloning
Senior Member
Join Date: Dec 2015
Old 01-19-2017 , 06:56   Re: [HELP] Replacing "Fire In The Hole"
Reply With Quote #6

emessage_begin means it'll be sent to other plugins, most likely you have other plugins blocking it. Try it without the e, message_begin, write_byte ..etc
PartialCloning is offline
hellmonja
Senior Member
Join Date: Oct 2015
Old 01-21-2017 , 13:11   Re: [HELP] Replacing "Fire In The Hole"
Reply With Quote #7

It worked! Thanks! Sorry it took the weekend to get back here. But I did a clean install of CS. Now it's working as it should. Thanks again...
__________________
hellmonja 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 05:22.


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