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...