Raised This Month: $ Target: $400
 0% 

TextMsg - Alter content


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
regalis
Veteran Member
Join Date: Jan 2007
Location: F*cking Germany
Old 05-08-2007 , 09:34   TextMsg - Alter content
Reply With Quote #1

Hi there
I have a big problem with messages...
I can block messages without problems

- But is it possible to alter the content of the message and let the message pass my plugin?
For example add a timestamp like "[10:453] #Fire_in_the_hole"....

Code:
#include <amxmodx>
#include <amxmisc>

public plugin_init()
{
    register_message(get_user_msgid("TextMsg"), "block_message");
}

public block_message(msg_id, msg_dest, entity)
{
    if(get_msg_args() == 5)
    {
        if(get_msg_argtype(5) == ARG_STRING)
        {
            new value5[64];
            get_msg_arg_string(5 ,value5 ,63);
            if(equal(value5, "#Fire_in_the_hole"))
            {
                return PLUGIN_HANDLED; //blocks the message
                //How do i alter the message content??
            }
        }
    }
    return PLUGIN_CONTINUE;
}
Here is the message which i logged with DS's msglogging.amxx
(http://forums.alliedmods.net/showthread.php?p=65983)
Code:
/*
MessageBegin (TextMsg "77") (Destination "One<1>") (Args "5") (Entity "1") (Classname "player") (Netname "~regalis~") (Origin "0.000000 0.000000 0.000000")
Arg 1 (Byte "5")
Arg 2 (String "1")
Arg 3 (String "#Game_radio")
Arg 4 (String "~regalis~")
Arg 5 (String "#Fire_in_the_hole")
MessageEnd (TextMsg "77")
*/
Any help will be appreciated!

greetz regalis
__________________

Last edited by regalis; 05-08-2007 at 09:36.
regalis is offline
 



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 06:34.


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