Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Editing Existing Code
Re: Editing Existing Code [message #268616 is a reply to message #268581] Sun, 24 June 2007 20:25 Go to previous messageGo to previous message
Whitedragon is currently offline  Whitedragon
Messages: 832
Registered: February 2003
Location: California
Karma:
Colonel
This is something I made for Kamuix. You can use it for what you're trying to do.

else if (stricmp(Msg2,"!Deploy GuardTower") == 0) {
	if (Get_Object_Type(obj) == 1) {
	        int Cost = 500;
	        char message[256];
	        GameObject *obj = Get_GameObj(ID);
		if (Purchase_Item(obj,Cost)) {
			Vector3 Pos = Commands->Get_Position(obj);
			Pos.Z += 5;
GameObject *GT = Commands->Create_Object("GDI_Guard_Tower",Pos);
Commands->Disable_Physical_Collisions(GT);
			sprintf(message,"msg Player %s has deployed a GDI Guard Tower",Get_Player_Name_By_ID(ID));
			Console_Input(message);
		}
		else {
			sprintf(message,"ppage %d Sorry, a Guard Tower costs $500",ID);
			Console_Input(message);
		}
	}
}


Black-Cell.net
Network Administrator (2003 - )

DragonServ, Renegade's first IRC interface bot
Creator and lead coder (2002 - )

Dragonade, Renegade's first server side modification
Lead coder (2005 - )

[Updated on: Sun, 24 June 2007 20:26]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: My First Code
Next Topic: Serverside
Goto Forum:
  


Current Time: Mon Dec 23 12:11:57 MST 2024

Total time taken to generate the page: 0.00848 seconds