Home » Renegade Discussions » Mod Release Forum » [Code] SSGM2.02 Custom Commands
[Code] SSGM2.02 Custom Commands [message #381190] |
Sat, 18 April 2009 18:44 |
|
YazooGang
Messages: 742 Registered: August 2008 Location: US
Karma: 0
|
Colonel |
|
|
Custom commands .
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 |
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?
("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 #381433 is a reply to message #381258] |
Mon, 20 April 2009 04:06 |
|
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!
http://www.wittebolx.com
|
|
|
|
|
|
Re: [Code] SSGM2.02 Custom Commands [message #381581 is a reply to message #381433] |
Mon, 20 April 2009 19:20 |
|
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
|
|
|
Goto Forum:
Current Time: Sun Nov 03 21:18:11 MST 2024
Total time taken to generate the page: 0.00730 seconds
|