AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Get netname of message (https://forums.alliedmods.net/showthread.php?t=56158)

hlstriker 06-07-2007 20:07

Get netname of message
 
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?

VEN 06-08-2007 12:45

Re: Get netname of message
 
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.

hlstriker 06-08-2007 12:50

Re: Get netname of message
 
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.

VEN 06-08-2007 14:49

Re: Get netname of message
 
Use Message Logging plugin by Damaged Soul then copy/paste the result for that message here.

hlstriker 06-08-2007 15:12

Re: Get netname of message
 
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:05:33: Arg 1 (Byte "99")
L 06/08/2007 - 15:05:33: 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]?

VEN 06-08-2007 16:26

Re: Get netname of message
 
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.


All times are GMT -4. The time now is 10:41.

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