Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Questions (player objects, stealth vehs)
Re: Questions (player objects, stealth vehs) [message #416577 is a reply to message #413375] Sun, 03 January 2010 05:27 Go to previous message
Hubba is currently offline  Hubba
Messages: 40
Registered: October 2009
Karma:
Recruit
Thanks Reborn. Could someone check if this is right? It works but is this an ok way to do it?. Should i add something more?


I added these lines to my !ramp command
int playerid = Get_Player_ID(obj);

vector2d[playerid].push_back(Commands->Get_ID(turret)); // Turret = the object


And this is what the !sellall command looks like
class sellallChatCommand : public ChatCommandClass {
   void Triggered(int ID,const TokenClass &Text,int ChatType) {
	   GameObject *obj = Get_GameObj(ID);
	   int playerid = Get_Player_ID(obj);

	for (unsigned int i=0; i<vector2d[playerid].size(); i++) // Loop through all the object if there are any.
	{	
		Commands->Destroy_Object(Commands->Find_Object(vector2d[playerid][i])); 
	}
	
	vector2d[playerid].clear(); // clears all the elements in the vector.

   }
};
ChatCommandRegistrant<sellallChatCommand> sellallChatCommandReg("!sellall",CHATTYPE_ALL,0,GAMEMODE_AOW);

[Updated on: Sun, 03 January 2010 05:28]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: A few skins
Next Topic: C++ code help please.
Goto Forum:
  


Current Time: Sat Oct 19 05:29:56 MST 2024

Total time taken to generate the page: 0.00649 seconds