Good way to hook the chat?
Hello, guys. I'm looking for good way to hook the chat for this plugin - http://forums.alliedmods.net/showthread.php?t=124688. I'll fully rewritten it with the new hooking way. Thanks advance! :)
|
Re: Good way to hook the chat?
Register a clcmd by doing
register_clcmd( "say", "Say_Handler" ); |
Re: Good way to hook the chat?
register_message(get_user_msgid("SayText"), "Message_SayText")
|
Re: Good way to hook the chat?
Quote:
PHP Code:
|
Re: Good way to hook the chat?
No, you have to think it a way completely different, you don't even have to bother with what was actually written by the player.
If your focus is to use such a plugin, i can post you a version i have, if your focus is to release a plugin, then you have to figure out by yourself. Anything you have to do is to simulate a channel (string 2) and use %s1 (name), %s2 (what was written), and %s3 (Location in cz with team chat). |
Re: Good way to hook the chat?
I want to update the Country Chat plugin, becouse you said that the hook way is not good. Thank you for support, I'll do it myself. :)
|
Re: Good way to hook the chat?
Yes, because you copy/pasted admin chat color plugin by Arion that has bugs.
Hook say and say_team commands can also be a fine method, you just have to make it a good way, now you know the 2 possible methods. register_message against register_clcmd : With register_message you won't have to figure out who should receive or not message because you hook all sent messages, you also directly hook message type (say_team, dead say_team, say, dead say, spectator say). With register_clcmd you hook the command so you just hook it once but you have to manually send all messages that have to be received by players, you have to figure out teams, alives players etc.... For all those arguments, i personnally prefer register_message method, but both are fine. I won't discuss specifically your plugin here because it has already be done in your thread. |
Re: Good way to hook the chat?
...
|
Re: Good way to hook the chat?
PHP Code:
|
Re: Good way to hook the chat?
I know how to hook the chat with this method, thank you anyways. :)
Btw I tried this: PHP Code:
|
| All times are GMT -4. The time now is 14:30. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.