Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » chat hook logic in scripts.dll 2.1.2
chat hook logic in scripts.dll 2.1.2 [message #153491] Sun, 08 May 2005 08:57 Go to next message
jonwil is currently offline  jonwil
Messages: 3557
Registered: February 2003
Karma: 0
General (3 Stars)

I keep getting people asking me how to use the new chat hook logic in scripts.dll 2.1.2 but I just dont have the time to do up an example

Is there any C/C++ people out there who can help by doing up an example for me?


Jonathan Wilson aka Jonwil
Creator and Lead Coder of the Custom scripts.dll
Renegade Engine Guru
Creator and Lead Coder of TT.DLL
Official member of Tiberian Technologies
chat hook logic in scripts.dll 2.1.2 [message #153509] Sun, 08 May 2005 10:31 Go to previous messageGo to next message
laeubi is currently offline  laeubi
Messages: 799
Registered: February 2003
Location: Germany
Karma: 0
Colonel

I'm not very good at C... sorry :-\

www.laeubi.de Find Mods, Maps, Tool, Files and More!
< All Tutorials you ever searched for >
< contact me >
"Don't say it is imposible... just find a solution!"
chat hook logic in scripts.dll 2.1.2 [message #153511] Sun, 08 May 2005 10:41 Go to previous message
Cat998
Messages: 1082
Registered: January 2004
Location: Austria, Vienna
Karma: 0
General (1 Star)
Moderator/Captain

I know there is any1 that knows howto Sad

bhs.txt :
Quote:


There is also a hook that lets custom scripts.dll mods (e.g. server-side mods) get access to all f2/f3 chat that passes through the server.
You create a function of the form
void Chat_Hook(int PlayerID,int Type,const char *Message)
Then you pass the function to AddChatHook (defined in engine.h)
Then, the function gets called everytime f2/f3 chat passes through the server.
PlayerID is the player ID of the player that sent the chat.
Type is 1 for team mesasge and 0 for everyone message.
Message is the message itself. If you need to save the message data for later use, copy the string, dont save the pointer passed into your chat
hook function, copy the data somewhere else.
You can only have one chat hook function registered at any one time. Also, if you want to have no chat hook at all registered, pass NULL to AddChatHook.
This works on the server regardless of if clients have bhs.dll

This functionality is quite useful if you want to make new !xxx commands, especially since you can use the player ID to verify that the person using the command
is authorized to use it. It also means you can do all the things that you would otherwise need new console commands to do.



When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter then "Yes"

Programming is like sex: one mistake and you have to support it for the rest of your life

Want the best answers? Ask the best questions!

"So long, and thanks for all the fish."
Previous Topic: level edit
Next Topic: CTF tutorial wanted
Goto Forum:
  


Current Time: Sun Dec 22 21:48:26 MST 2024

Total time taken to generate the page: 0.00710 seconds