Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Release Forum » [Code] SSGM2.02 Custom Commands
[Code] SSGM2.02 Custom Commands [message #381190] Sat, 18 April 2009 18:44 Go to next message
YazooGang is currently offline  YazooGang
Messages: 742
Registered: August 2008
Location: US
Karma: 0
Colonel
Custom commands Razz.
Made by me and ferkhat!

Preset.
Info: Builds a preset. Works only with the Objects presets.
Usage: !preset <preset name> . Preset names can be found in Level Editor.
class presetChatCommand : public ChatCommandClass {
	void Triggered(int ID,const TokenClass &Text,int ChatType) {	
		GameObject *obj = Get_GameObj(ID);
		const char * Name = Get_Player_Name(obj);

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)));
 {
	GameObject *pobj = Commands->Create_Object(Text[1].c_str(), position);
	Commands->Set_Facing(pobj, Commands->Get_Facing(obj)-180);
 }
	}

};
ChatCommandRegistrant<presetChatCommand> presetChatCommandReg("!preset",CHATTYPE_ALL,1,GAMEMODE_AOW);


Stealth Suit.
Info: Stealths you and/or your vehicle Client needs up-to-date scripts.
Usage: !ss
class ssChatCommand : public ChatCommandClass {
	void Triggered(int ID,const TokenClass &Text,int ChatType) {
		GameObject *obj = Get_GameObj(ID);
		GameObject *X = Get_Vehicle(obj);
							const char * Name = Get_Player_Name(obj);
					Console_Input(StrFormat("msg %s got a Steath Suit.",Name).c_str());
Commands->Enable_Stealth(obj,true);
Commands->Enable_Stealth(X,true);
		}
};
ChatCommandRegistrant<ssChatCommand> ssChatCommandReg("!ss",CHATTYPE_ALL,0,GAMEMODE_AOW);



Fly Mode.
Info: Makes you fly!
Usage: !fly
class flyChatCommand : public ChatCommandClass {
	void Triggered(int ID,const TokenClass &Text,int ChatType) {
		GameObject *obj = Get_GameObj(ID);
							const char * Name = Get_Player_Name(obj);
					Console_Input(StrFormat("msg %s is flying/walking.",Name).c_str());
Toggle_Fly_Mode(obj);

		}
};
ChatCommandRegistrant<flyChatCommand> flyChatCommandReg("!fly",CHATTYPE_ALL,0,GAMEMODE_AOW);



Refill.
Info: Refills your heatlh, armor, and ammo.
Usage: !refill
class cirinChatCommand : public ChatCommandClass {
	void Triggered(int ID,const TokenClass &Text,int ChatType) {	
		GameObject *obj = Get_GameObj(ID);
				
Commands->Give_Powerup(obj,"CnC_POW_Ammo_ClipMax",false);
Commands->Give_Powerup(obj,"CnC_POW_Health_Max",false);
Commands->Give_Powerup(obj,"CnC_POW_Armor_Max",false);
 }


};
ChatCommandRegistrant<cirinChatCommand> cirinChatCommandReg("!refill",CHATTYPE_ALL,0,GAMEMODE_AOW);


Change teams.
Info: Changes your team.
Usage: !team
class teamChatCommand : public ChatCommandClass {
	void Triggered(int ID,const TokenClass &Text,int ChatType) {	
		
		if (Get_Team(ID)==1) {
			Console_Input(StrFormat("team2 %d 0",ID).c_str());
		}
		else if (Get_Team(ID)==0){
			Console_Input(StrFormat("team2 %d 1",ID).c_str());
		}


	}

};
ChatCommandRegistrant<teamChatCommand> teamChatCommandReg("!team",CHATTYPE_ALL,0,GAMEMODE_AOW);


Cinematic Player.
Info: Plays a cinematic .txt files from your FDS Data folder.
Usage: !cin <file.txt>
class cinematicChatCommand : public ChatCommandClass {
	void Triggered(int ID,const TokenClass &Text,int ChatType) {	
		GameObject *obj = Get_GameObj(ID);
		Vector3 position;
		position.Z += 0;

	position = Commands->Get_Position(obj);
	GameObject *X = Commands->Create_Object("Invisible_Object", position);
    Commands->Disable_Physical_Collisions(X);
	Commands->Attach_Script(X,"Test_Cinematic",Text[1].c_str());

	
	}


};
ChatCommandRegistrant<cinematicChatCommand> cinematicChatCommandReg("!cin",CHATTYPE_ALL,1,GAMEMODE_AOW);



Enjoy!

Please tell me if there are errors...
Re: [Code] SSGM2.02 Custom Commands [message #381205 is a reply to message #381190] Sat, 18 April 2009 20:39 Go to previous messageGo to next message
Genesis2001
Messages: 1397
Registered: August 2006
Karma: 0
General (1 Star)
YazooGang wrote on Sat, 18 April 2009 18:44

Cinematic Player.
Info: Plays a cinematic .txt files from your FDS Data folder.
Usage: !cin <file.txt>
class cinematicChatCommand : public ChatCommandClass {
	void Triggered(int ID,const TokenClass &Text,int ChatType) {	
		GameObject *obj = Get_GameObj(ID);
		Vector3 position;
		position.Z += 0;

	position = Commands->Get_Position(obj);
	GameObject *X = Commands->Create_Object("Invisible_Object", position);
    Commands->Disable_Physical_Collisions(X);
	Commands->Attach_Script(X,"Test_Cinematic",Text[1].c_str());

	
	}


};
ChatCommandRegistrant<cinematicChatCommand> cinematicChatCommandReg("!cin",CHATTYPE_ALL,1,GAMEMODE_AOW);



Enjoy!

Please tell me if there are errors...



I guess you got that idea from St0rm? Wink

("suppose" wasn't the right word for that sentence...)

[Updated on: Sat, 18 April 2009 20:42]

Report message to a moderator

Re: [Code] SSGM2.02 Custom Commands [message #381212 is a reply to message #381205] Sat, 18 April 2009 20:48 Go to previous messageGo to next message
YazooGang is currently offline  YazooGang
Messages: 742
Registered: August 2008
Location: US
Karma: 0
Colonel
Yes i did, i asked wilo to play a cinematic and he wouldnt, so i just made one for my server and fooled around with it. It got handy with drop offs.
Re: [Code] SSGM2.02 Custom Commands [message #381258 is a reply to message #381190] Sun, 19 April 2009 03:55 Go to previous messageGo to next message
mrãçķz is currently offline  mrãçķz
Messages: 3069
Registered: August 2007
Karma: 0
General (3 Stars)
Permabanned for trying and failing DDoS
Nice for Beginners, you should post a !build exampole for them,
i think im gonna release my VET system and my script to make
everything to a spawner (vehicles, guns & everything serverside)
Re: [Code] SSGM2.02 Custom Commands [message #381433 is a reply to message #381258] Mon, 20 April 2009 04:06 Go to previous messageGo to next message
wittebolx is currently offline  wittebolx
Messages: 332
Registered: May 2007
Location: the netherlands
Karma: 0
Recruit
Quote:

Stealth Suit.
Info: Stealths you and/or your vehicle Client needs up-to-date scripts.
Usage: !ss
class ssChatCommand : public ChatCommandClass {
void Triggered(int ID,const TokenClass &Text,int ChatType) {
GameObject *obj = Get_GameObj(ID);
GameObject *X = Get_Vehicle(obj);
const char * Name = Get_Player_Name(obj);
Console_Input(StrFormat("msg %s got a Steath Suit.",Name).c_str());
Commands->Enable_Stealth(obj,true);
Commands->Enable_Stealth(X,true);
}
};
ChatCommandRegistrant<ssChatCommand> ssChatCommandReg("!ss",CHATTYPE_ALL,0,GAMEMODE_AOW);



Remember that when a player leaves the game joins afterwards he can see the people that are supposed to be stealthed!


Re: [Code] SSGM2.02 Custom Commands [message #381466 is a reply to message #381190] Mon, 20 April 2009 07:10 Go to previous messageGo to next message
mrãçķz is currently offline  mrãçķz
Messages: 3069
Registered: August 2007
Karma: 0
General (3 Stars)
Permabanned for trying and failing DDoS
Use a Timer for the Stealth
Re: [Code] SSGM2.02 Custom Commands [message #381478 is a reply to message #381190] Mon, 20 April 2009 08:23 Go to previous messageGo to next message
DeathC200 is currently offline  DeathC200
Messages: 220
Registered: June 2008
Location: Hud Base
Karma: 0
Recruit
what do you save these as in order to get them to work cause i want to compile them all in notepad and save it as that file but i do not know what file extension to save it as ??
Re: [Code] SSGM2.02 Custom Commands [message #381511 is a reply to message #381478] Mon, 20 April 2009 11:44 Go to previous messageGo to next message
YazooGang is currently offline  YazooGang
Messages: 742
Registered: August 2008
Location: US
Karma: 0
Colonel
DeathC200 wrote on Mon, 20 April 2009 17:23

what do you save these as in order to get them to work cause i want to compile them all in notepad and save it as that file but i do not know what file extension to save it as ??

Ok your WAY WAY WAY behind all of this. http://www.renegadeforums.com/index.php?t=msg&th=26642&start=0&rid=2 4114 Try that, but i'm not gonna be your teacher.
Re: [Code] SSGM2.02 Custom Commands [message #381581 is a reply to message #381433] Mon, 20 April 2009 19:20 Go to previous message
Gen_Blacky is currently offline  Gen_Blacky
Messages: 3250
Registered: September 2006
Karma: 1
General (3 Stars)
wittebolx wrote on Mon, 20 April 2009 06:06

Quote:

Stealth Suit.
Info: Stealths you and/or your vehicle Client needs up-to-date scripts.
Usage: !ss
class ssChatCommand : public ChatCommandClass {
void Triggered(int ID,const TokenClass &Text,int ChatType) {
GameObject *obj = Get_GameObj(ID);
GameObject *X = Get_Vehicle(obj);
const char * Name = Get_Player_Name(obj);
Console_Input(StrFormat("msg %s got a Steath Suit.",Name).c_str());
Commands->Enable_Stealth(obj,true);
Commands->Enable_Stealth(X,true);
}
};
ChatCommandRegistrant<ssChatCommand> ssChatCommandReg("!ss",CHATTYPE_ALL,0,GAMEMODE_AOW);



Remember that when a player leaves the game joins afterwards he can see the people that are supposed to be stealthed!


just reattach the script every time a player joins


http://s18.postimage.org/jc6qbn4k9/bricks3.png
Previous Topic: Egypt Volcano
Next Topic: [skin] nod chrome buggy
Goto Forum:
  


Current Time: Sun Nov 03 21:18:11 MST 2024

Total time taken to generate the page: 0.00730 seconds