Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » SSGM Chat Hook
SSGM Chat Hook [message #274298] Thu, 19 July 2007 17:09 Go to previous message
Genesis2001
Messages: 1397
Registered: August 2006
Karma:
General (1 Star)
Can someone help me with this? I'm trying to figure out how to add commands and I think figured it out, but don't know the syntax for adding commands. Dont Get It

void Chat(int ID, TextMessageEnum Type, const wchar_t *Msg2) {
	if (!Data->Plugins.empty()) {
		std::vector<PluginInfo*>::const_iterator it;
		for (it = Data->Plugins.begin();it != Data->Plugins.end(); ++it) {
			if ((*it)->Type == Plugin) {
				if ((*it)->ChatHookHandle) {
					(*it)->ChatHookHandle(ID,Type,Msg2);	
				}
			}
		}
	}

	if (Type == 2) {
		return;
	}
	if (Settings->Gamelog && Settings->NewGamelog) {
		Gamelog_Chat_Hook(ID,Type,Msg2);
	}

	std::string Msg = WideCharToString(Msg2);
	if (Msg[0] == '!' && !Data->Commands.empty()) {
		TokenClass Text(Msg);
		std::string Command = Text[1];
		Text.erase(1);
		Data->Trigger_Chat_Command(ID,Type,Command,Text);
	}
}



I'm pretty sure that this is where I'd add the commands, but don't know the syntax. :/
	if (Type == 2) {
		return;
	}





-MathK1LL
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: 3ds max 9 problem
Next Topic: Anti Alias without 3.4.1
Goto Forum:
  


Current Time: Sun Dec 01 04:47:29 MST 2024

Total time taken to generate the page: 0.00893 seconds