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. */
);
[Updated on: Tue, 26 June 2007 00:34]
Report message to a moderator