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

[SOLVED] How to find the receiver of TextMsg?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-25-2016 , 15:16   [SOLVED] How to find the receiver of TextMsg?
Reply With Quote #1

PHP Code:
register_message(get_user_msgid("TextMsg"), "msgTextMsg")

public 
msgTextMsg(MsgIdMsgDestMsgEntity) { ... } 
How can I find the message receiver? For example - I want to find the receiver of "This weapon cannot be dropped" message.
__________________

Last edited by OciXCrom; 12-26-2016 at 09:29.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 12-25-2016 , 16:22   Re: How to find the receiver of TextMsg?
Reply With Quote #2

Wouldn't this work
PHP Code:
new name[33]; 
get_user_name(iDestnamecharsmax(name)) 
PHP Code:
register_messageget_user_msgid"TextMsg" ), "Message_TextMsg" );

public 
Message_TextMsg (iMsg,iDest,iEntity)
{
    if ( 
get_msg_arg_int) == print_center && is_valid_ent(iDest))
    {
        static const 
MessageToBlock[] = "#Weapon_Cannot_Be_Dropped";
        
        new 
Messagesizeof MessageToBlock ];
        
get_msg_arg_string2MessagecharsmaxMessage ) );
        
        return 
equalMessageMessageToBlock );
    }
    
    return 
PLUGIN_CONTINUE;

__________________

Last edited by edon1337; 12-25-2016 at 16:24.
edon1337 is offline
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 12-25-2016 , 17:07   Re: How to find the receiver of TextMsg?
Reply With Quote #3

MsgEntity
__________________
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-26-2016 , 09:28   Re: How to find the receiver of TextMsg?
Reply With Quote #4

Quote:
Originally Posted by PRoSToTeM@ View Post
MsgEntity
That worked. Thanks.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 12-26-2016 , 16:29   Re: How to find the receiver of TextMsg?
Reply With Quote #5

Quote:
Originally Posted by PRoSToTeM@ View Post
MsgEntity
Thought MsgDest would be it because Dest - Destination
__________________
edon1337 is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 12-26-2016 , 16:41   Re: How to find the receiver of TextMsg?
Reply With Quote #6

Quote:
Originally Posted by edon1337 View Post
Thought MsgDest would be it because Dest - Destination
MsgEntity is the entity the message is being sent to.
Destination is one of MSG_* constants. It's the destination net buffer.

Last edited by klippy; 12-26-2016 at 16:41.
klippy is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-26-2016 , 18:19   Re: [SOLVED] How to find the receiver of TextMsg?
Reply With Quote #7

Thought so my self but lost courage when tried to use it.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
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 22:50.


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