Plugins for SSGM [message #268789] |
Tue, 26 June 2007 00:06 |
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?
|
|
|
Re: Plugins for SSGM [message #268790 is a reply to message #268789] |
Tue, 26 June 2007 00:16 |
|
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.
|
|
|
|
Re: Plugins for SSGM [message #268794 is a reply to message #268789] |
Tue, 26 June 2007 00:25 |
|
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 #268797 is a reply to message #268789] |
Tue, 26 June 2007 00:33 |
|
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
|
|
|
|
|