Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Commands
Commands [message #330984] Sun, 18 May 2008 05:52 Go to next message
Hades is currently offline  Hades
Messages: 22
Registered: August 2005
Karma: 0
Recruit
Hey if this has already been covered sorry .

How would you go about making commands such as !ramjet or similiar things.

Thanks in advance


http://shadow-gaming.net/ranks/sig.jpg
Re: Commands [message #330986 is a reply to message #330984] Sun, 18 May 2008 06:05 Go to previous messageGo to next message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
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.
);



Re: Commands [message #330987 is a reply to message #330984] Sun, 18 May 2008 06:07 Go to previous message
Hades is currently offline  Hades
Messages: 22
Registered: August 2005
Karma: 0
Recruit
Awesome thanks

http://shadow-gaming.net/ranks/sig.jpg
Previous Topic: Script Request
Next Topic: Roleplay2 Updates
Goto Forum:
  


Current Time: Fri Jan 10 18:59:54 MST 2025

Total time taken to generate the page: 0.00674 seconds