Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Scripts detect chat?
Re: Scripts detect chat? [message #178906 is a reply to message #178752] Sat, 12 November 2005 03:10 Go to previous messageGo to previous message
Whitedragon is currently offline  Whitedragon
Messages: 832
Registered: February 2003
Location: California
Karma:
Colonel
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)
If the chathook is called Chat_Hook, put the line AddChatHook(Chat_Hook); somewhere in your code. (e.g. somewhere that is called on startup)
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


Black-Cell.net
Network Administrator (2003 - )

DragonServ, Renegade's first IRC interface bot
Creator and lead coder (2002 - )

Dragonade, Renegade's first server side modification
Lead coder (2005 - )
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: More than 1 weapon from powerup???
Next Topic: How do you find owner of a newly bought tank?
Goto Forum:
  


Current Time: Fri Jan 17 08:23:55 MST 2025

Total time taken to generate the page: 0.00869 seconds