Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » C++ Question
Re: C++ Question [message #340354 is a reply to message #339983] Fri, 11 July 2008 13:07 Go to previous messageGo to previous message
dead6re is currently offline  dead6re
Messages: 602
Registered: September 2003
Karma:
Colonel
class presetbuildChatCommand : public ChatCommandClass {
	void Triggered(int ID,const TokenClass &Text,int ChatType) {
		GameObject *obj = Get_GameObj(ID);


		char *preset = (char *)Text[1].c_str();

		Vector3 position;
		position = Commands->Get_Position(obj);
		position.Z += 0;
		position.X += (float)(5*cos(Commands->Get_Facing(Get_GameObj(ID))*(3.14 / 180)));
		position.Y += (float)(5*sin(Commands->Get_Facing(Get_GameObj(ID))*(3.14 / 180)));

		Commands->Create_Object(preset, position);
		Console_Input(StrFormat("msg WORKS!").c_str());
		Commands->Set_Facing(obj, Commands->Get_Facing(obj) - 180);
	}	
};
ChatCommandRegistrant<presetbuildChatCommand> presetbuildChatCommandReg("!pbuild",CHATTYPE_ALL,1,GAMEMODE_AOW);


I would just check where the position is because you are altering it, I've had enough core 4 [intergration of trig functions] this year so I'm not checking it.

My other advice would be to make sure you are sending a valid preset as found in renedit.


Let all your wishes be granted except one, so you will still have something to strieve for.
 
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: Steath effect skin
Next Topic: DUB Hummer
Goto Forum:
  


Current Time: Thu Dec 26 14:40:43 MST 2024

Total time taken to generate the page: 0.00817 seconds