Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Plugins for SSGM
Plugins for SSGM [message #268789] Tue, 26 June 2007 00:06 Go to next message
Tunaman
Messages: 1190
Registered: January 2005
Karma: 2
General (1 Star)
Are there any tutorials for plugins for SSGM? I'm trying to create a chat hook but I don't really know how.. I looked at how the object hook was created in the tutorial but it seems to be a bit different. =[ I don't really get how a hook works.. I'm just trying to figure it out by looking at the source code.
Could anyone help me out by either explaining how to add more hooks or even show some code or something to make a chat hook and then use it?


http://img694.imageshack.us/img694/9055/tunamanlmao.png
Re: Plugins for SSGM [message #268790 is a reply to message #268789] Tue, 26 June 2007 00:16 Go to previous messageGo to next message
Hex is currently offline  Hex
Messages: 858
Registered: March 2004
Karma: 0
Colonel
in plugin.cpp

chat command

class TestChatCommand : public ChatCommandClass {
	void Triggered(int ID,const TokenClass &Text,int ChatType) {
		Console_Input(StrFormat("ppage %d loltest parameters: %s",ID,Text(1).c_str()).c_str());
	}
};
ChatCommandRegistrant<TestChatCommand> TestChatCommandReg("!test",CHATTYPE_ALL,1,GAMEMODE_ALL);



goztow wrote on Tue, 11 May 2010 08:00

If we had to ban all who ever cheated or ever created a cheat (obj3cts and such) then I don't think there would be many members left here (sad fact).


reborn wrote on Fri, 29 January 2010 23:37

std is for pro's. Razz
Re: Plugins for SSGM [message #268794 is a reply to message #268789] Tue, 26 June 2007 00:25 Go to previous messageGo to next message
Whitedragon is currently offline  Whitedragon
Messages: 832
Registered: February 2003
Location: California
Karma: 1
Colonel
The chat hook is "SSGM_Chat_Hook" in plugin.cpp. You can also implement a chat command through the ChatCommandClass class as Hex suggested, that is the preferred way.

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: Plugins for SSGM [message #268795 is a reply to message #268789] Tue, 26 June 2007 00:28 Go to previous messageGo to next message
Tunaman
Messages: 1190
Registered: January 2005
Karma: 2
General (1 Star)
Thanks a ton! Rocked Over
Sorry I'm pretty new to scripting..


http://img694.imageshack.us/img694/9055/tunamanlmao.png

[Updated on: Tue, 26 June 2007 00:30]

Report message to a moderator

Re: Plugins for SSGM [message #268797 is a reply to message #268789] Tue, 26 June 2007 00:33 Go to previous messageGo to next message
Whitedragon is currently offline  Whitedragon
Messages: 832
Registered: February 2003
Location: California
Karma: 1
Colonel
Here's some more info in ChatCommandClass. Somehow this didn't get into the released version.

class TestChatCommand : public ChatCommandClass {
	void Triggered(int ID,const TokenClass &Text,int ChatType) {
		/* Text is a tokenized version of the command parameters.
		   Text[1] would get the first word after the command.
		   Text(1) would get everything after the command.
		   Text(2,4) would get words 2 through 4.
	   */
		Console_Input(StrFormat("ppage %d loltest parameters: %s",ID,Text(1).c_str()).c_str());
	}
};
ChatCommandRegistrant<TestChatCommand> TestChatCommandReg(
"!test",/* Name of the command. Seperate multiple names with ;. */
CHATTYPE_ALL, /* What type of chat the command can be triggered in. CHATTYPE_ALL, CHATTYPE_TEAM, and CHATTYPE_PUBLIC */
1, /* How many parameters the command needs. !Donate, for example, would need two. One would be the name of the player and the other would be the amount .*/
GAMEMODE_ALL /* The game mode that this command can be used in. */
);


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 - )

[Updated on: Tue, 26 June 2007 00:34]

Report message to a moderator

Re: Plugins for SSGM [message #269524 is a reply to message #268789] Thu, 28 June 2007 22:47 Go to previous messageGo to next message
Genesis2001
Messages: 1397
Registered: August 2006
Karma: 0
General (1 Star)
/me looks upon WD as a god Razz


The things people do with C++ amazes me...I wish I could do this kind of stuff =/


-MathK1LL
Re: Plugins for SSGM [message #269677 is a reply to message #268789] Fri, 29 June 2007 15:48 Go to previous message
Genesis2001
Messages: 1397
Registered: August 2006
Karma: 0
General (1 Star)
*edit* Nvm, Found out where it went.


But...
"!test",/* Name of the command. Seperate multiple names with ;. */


Do I list all the commands I want to add to my server via scripts/plugins in that line?


-MathK1LL

[Updated on: Fri, 29 June 2007 16:04]

Report message to a moderator

Previous Topic: Script Request
Next Topic: Roadkill script?
Goto Forum:
  


Current Time: Sat Dec 21 03:45:29 MST 2024

Total time taken to generate the page: 0.00849 seconds