Raised This Month: $ Target: $400
 0% 

how to hook chat


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Rolnaaba
Veteran Member
Join Date: May 2006
Old 11-16-2006 , 10:19   how to hook chat
Reply With Quote #1

How cna I hook when people say something in chat and get the message and who said it?
__________________
DO NOT PM me about avp mod.
Rolnaaba is offline
P34nut
AMX Mod X Beta Tester
Join Date: Feb 2006
Location: Netherlands
Old 11-16-2006 , 10:22   Re: how to hook chat
Reply With Quote #2

Code:
 register_clcmd("say", "fnSay")
OR
try SayText event
__________________
All you need to change the world is one good lie and a river of blood

Last edited by P34nut; 11-16-2006 at 11:31.
P34nut is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 11-16-2006 , 10:25   Re: how to hook chat
Reply With Quote #3

Code:
#include <amxmodx> public plugin_init() {     register_plugin("", "", "")         register_clcmd("say", "handle_say")     register_clcmd("say_team", "handle_say") } public handle_say(id) {         new args[128]     read_args(args, 127)         remove_quotes(args)     //... }
[ --<-@ ] Black Rose is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 11-16-2006 , 11:19   Re: how to hook chat
Reply With Quote #4

Quote:
OR
try TextMsg event
It's actually SayText, not TextMsg
VEN is offline
P34nut
AMX Mod X Beta Tester
Join Date: Feb 2006
Location: Netherlands
Old 11-16-2006 , 11:31   Re: how to hook chat
Reply With Quote #5

oops yeah your right.. fixed in my post to
__________________
All you need to change the world is one good lie and a river of blood
P34nut is offline
Rolnaaba
Veteran Member
Join Date: May 2006
Old 11-16-2006 , 12:48   Re: how to hook chat
Reply With Quote #6

wow sry I feel stupid

[EDIT] this is info from wiki:
Quote:
Prints say HUD text. Second parameter can be a predefined string or a custom one. In the last case the last two parameters isn't required.
Some values of the predifined string: #Cstrike_Chat_AllDead, #Cstrike_Chat_All
Name: SayText
Structure:
byte: SenderID
string: String
string: unknown
string: Text
so would this work?
Code:
public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_event("SayText", "hook_say") } public hook_say() {     new talker = read_data(1)     new message = read_data(4)         if(equali(message, "blah")) {         return Rolnaaba_RULES             } }
and if their message is blah case insensative would return I rule?
__________________
DO NOT PM me about avp mod.

Last edited by Rolnaaba; 11-16-2006 at 12:56.
Rolnaaba is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 11-16-2006 , 14:52   Re: how to hook chat
Reply With Quote #7

Code:
public plugin_init() {     register_plugin("", "", "")     register_event("SayText", "hook_say") } public hook_say() {     new talker = read_data(1)     new message[128]     read_data(4, message, 127)         if ( equali(message, "blah") )         return Rolnaaba_RULES }
[ --<-@ ] Black Rose is offline
Rolnaaba
Veteran Member
Join Date: May 2006
Old 11-16-2006 , 17:30   Re: how to hook chat
Reply With Quote #8

ty
__________________
DO NOT PM me about avp mod.
Rolnaaba 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 06:48.


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