Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Help with SSAOW mult. weap. char.
Re: Help with SSAOW mult. weap. char. [message #298564 is a reply to message #298178] Fri, 23 November 2007 19:28 Go to previous messageGo to previous message
Fleetatks is currently offline  Fleetatks
Messages: 58
Registered: April 2005
Karma:
Recruit
reborn wrote on Wed, 21 November 2007 23:55


..........
The buy commands are horrid in my opinion, but they are done with chat hooks. Most people use the LUA plug-in and write the code in LUA, but I have no experiance of this language so I will show you how to do it in C++, which will have more functionality then the LUA plug-in anyway, as you are woring directly with the API.
..........
class mutantChatCommand : public ChatCommandClass {
	void Triggered(int ID,const TokenClass &Text,int ChatType) {
		GameObject *obj = Get_GameObj(ID);
float money = Commands->Get_Money(purchaser);
int team = Commands->Get_Player_Type(obj);
Vector3 position = Commands->Get_Position(obj);
if (money >= 150 && team == 0){
Commands->Give_Money(obj,-150,false);
Change_Character(obj,"M09_Spawning_Mutant");
Commands->Set_Position(obj,position);
	}
else {
Console_Input(StrFormat("ppage %d You do not meet the requirements to buy a mutant",ID).c_str());
}
	}
};
ChatCommandRegistrant<mutantChatCommand> mutantChatCommandReg("!mutant",CHATTYPE_TEAM,0,GAMEMODE_ALL);


The preceeding code checks the players current money, and makes sure they are on team 0 (which is Nod) and allows them to buy the mutant if they have 150 credits or more. It will take 150 credits away from them if they do have the money and grant them the mutant. It will also put them back at the same position they was when they typed the command so it will look more like a change of state.
..........


For this part I need to know: What do I add the code to? And where? I've tried figuring it out on my own but it seems a little bit more complicated then I thought it would be. I extracted the folder and am able to see all the different coding files. I'm able to add to, and create new code files, but I'm not sure where to put the code. I also need help on what I do after I inserted the code, I'm not sure what compile means but I'm assuming is similar to saving/exporting. What file(s) do I add to where? In other words, is there going to be a new .dll file to add to my FDS, or does something go onto my IRC bot? (I use cloudy server)
 
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
Read Message
Read Message
Read Message
Previous Topic: C&C-Renegade-Wallpaper
Next Topic: APB
Goto Forum:
  


Current Time: Sat Nov 30 23:37:50 MST 2024

Total time taken to generate the page: 0.00863 seconds