Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Commands
Re: Commands [message #330986 is a reply to message #330984] Sun, 18 May 2008 06:05 Go to previous messageGo to previous message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma:
General (3 Stars)
Make a chat hook in SSGM Smile

//Example of a chat command using the ChatCommandClass.
//Remove this when making a real plugin.
class TestChatCommand : public ChatCommandClass {
	void Triggered(int ID,const TokenClass &Text,int ChatType) {
		/* Text is a tokenized version of the command paramter.
		   Text[1] would get the first word after the command.
		   Text[0] would get everything after the command.
		   Text(3) would get word 3 and everything after it.
		   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.
);



 
Read Message
Read Message
Read Message
Previous Topic: Script Request
Next Topic: Roleplay2 Updates
Goto Forum:
  


Current Time: Sat Jan 11 11:45:29 MST 2025

Total time taken to generate the page: 0.00732 seconds