Raised This Month: $ Target: $400
 0% 

Get netname of message


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 06-07-2007 , 20:07   Get netname of message
Reply With Quote #1

Is there a way to get the netname of a hooked message? I need this because the message I am hooking has the netname of the player it is affecting, but doesn't have an argument for the player.

Also, what is the difference between a register_event and register_message?
hlstriker is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 06-08-2007 , 12:45   Re: Get netname of message
Reply With Quote #2

As for first part i'm not quite sure what are you talking about.

As for second part. The first one is a post version of forward and the second one is a pre version of forward and therefore it is allow to block or alter the whole message.
VEN is offline
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 06-08-2007 , 12:50   Re: Get netname of message
Reply With Quote #3

Ok thanks a ton, that really cleared things up.

For what you didn't understand:
I am hooking a message that doesn't have the users id in it. I notice that it says "Netname <playername>" in the message though. Is there a way to get that netname from the message to use in my plugin, or some other way to find out which player the message is affecting.

Last edited by hlstriker; 06-08-2007 at 12:56.
hlstriker is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 06-08-2007 , 14:49   Re: Get netname of message
Reply With Quote #4

Use Message Logging plugin by Damaged Soul then copy/paste the result for that message here.
VEN is offline
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 06-08-2007 , 15:12   Re: Get netname of message
Reply With Quote #5

Quote:
MessageBegin (Concuss "78") (Destination "One<1>") (Args "1") (Entity "1") (Classname "player") (Netname "hlstriker") (Origin "0.000000 0.000000 0.000000")
L 06/08/2007 - 15:053: Arg 1 (Byte "99")
L 06/08/2007 - 15:053: MessageEnd (Concuss "78")
This message will keep displaying until Arg 1s Byte is 0. The byte is the amount of "Dizziness" you have when you get conced on TFC.

This works to get the players id with register_event. Would I be able to do something like that with register_message?
Code:
public plugin_init() {     register_event("Concuss", "function", "b"); } public function(id) {     // id is the player with the message }

Edit: Are there tags for amxx code besides the [ small][ /small]?
hlstriker is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 06-08-2007 , 16:26   Re: Get netname of message
Reply With Quote #6

Yes hook prototype for register_message would be function(msgid, dest, id). You can find more info in amxmodx/scripting/include/ also you can refer to functions reference.
VEN 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 10:41.


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