Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Scripts detect chat?
Scripts detect chat? [message #178752] Fri, 11 November 2005 01:02 Go to next message
theplague is currently offline  theplague
Messages: 261
Registered: May 2004
Karma: 0
Recruit
umm, how would i go about making scripts.dll detect chat without scrambling though the log files?

http://users.tpg.com.au/ling44/av_firefox.gifhttp://users.tpg.com.au/ling44/av_rg.gif
Re: Scripts detect chat? [message #178767 is a reply to message #178752] Fri, 11 November 2005 06:08 Go to previous messageGo to next message
dead6re is currently offline  dead6re
Messages: 602
Registered: September 2003
Karma: 0
Colonel
The scripts.dll cannot detect any messages from the RenFDS. So you have to search the logs.

Unless im wrong, you can't. Sorry.


Let all your wishes be granted except one, so you will still have something to strieve for.
Re: Scripts detect chat? [message #178843 is a reply to message #178752] Fri, 11 November 2005 16:21 Go to previous messageGo to next message
Whitedragon is currently offline  Whitedragon
Messages: 832
Registered: February 2003
Location: California
Karma: 1
Colonel
You're wrong. Use the chathooks, i think it says how to use them in bhs.txt or console.txt.

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 - )
Re: Scripts detect chat? [message #178895 is a reply to message #178752] Sat, 12 November 2005 01:54 Go to previous messageGo to next message
theplague is currently offline  theplague
Messages: 261
Registered: May 2004
Karma: 0
Recruit
:S it's not in bhs.txt and i can't find console.txt :S

will it also hook the join and leave messages?


http://users.tpg.com.au/ling44/av_firefox.gifhttp://users.tpg.com.au/ling44/av_rg.gif
Re: Scripts detect chat? [message #178906 is a reply to message #178752] Sat, 12 November 2005 03:10 Go to previous messageGo to next message
Whitedragon is currently offline  Whitedragon
Messages: 832
Registered: February 2003
Location: California
Karma: 1
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 - )
Re: Scripts detect chat? [message #178963 is a reply to message #178752] Sat, 12 November 2005 14:35 Go to previous message
theplague is currently offline  theplague
Messages: 261
Registered: May 2004
Karma: 0
Recruit
thanks Razz
i was looking the the wrong place... i was looking for it in aow 1.34 :S it's in scripts 2.1.3 Razz yey


http://users.tpg.com.au/ling44/av_firefox.gifhttp://users.tpg.com.au/ling44/av_rg.gif

[Updated on: Sat, 12 November 2005 15:27]

Report message to a moderator

Previous Topic: More than 1 weapon from powerup???
Next Topic: How do you find owner of a newly bought tank?
Goto Forum:
  


Current Time: Tue Sep 03 08:20:53 MST 2024

Total time taken to generate the page: 0.00780 seconds