Command and Conquer: Renegade Official Forums - RDF feed
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
I got sick of searching so ill just ask what happened to tokenclass and if it hasnt been replaced with something else, any ideas how to solve this its about adding multiple scripts with or without parameters to an object. if (stricmp(Scripts,"")!=0 && stricmp(ScriptParams,"")!=0) { TokenClass ScriptsParse= TokenClass(Scripts,0); TokenClass ScriptParamsParse= TokenClass(ScriptParams,0); for(int i=0;i<ScriptsParse.size()+1;i++) { if (stricmp(ScriptParamsParse[i].c_str(),"!")!=0) { Attach_Script_Once(obj,ScriptsParse[i].c_str(),ScriptParamsParse[i].c_str()); } else { Attach_Script_Once(obj,ScriptsParse[i].c_str(),""); } } }
Couldn't find any references to "TokenClass" in 3.4.4's code, it must be an SSGM plugin or something similar.
yea it actually is off ssgm itself its where chatcommand stuff is located too
Copied directly from ssgm, if you wanted to use it without ssgm you should rename its calls so you don't end up stepping on someone elses' toes. class TokenClass { private: std::vector<std::string> Tokens; int vecsize; void Build(const std::string &Text,int Pos) { Tokens.clear(); vecsize = 0; char *Tokenz = new char[Text.size()+1]; sprintf(Tokenz,"%s",Text.c_str()); char *p = strtok(Tokenz," "); std::string Temp2,All; if (!Pos) { Tokens.push_back(Text); } else { int i = 0; while (i < Pos) { p = strtok(0," "); ++i; } } while (p) { Temp2 = p; Tokens.push_back(Temp2); p = strtok(0," "); ++vecsize; if (Pos) { All += Temp2; if (p) All += std::string(" "); } } if (Pos) { Tokens.insert(Tokens.begin(),All); } delete[] Tokenz; } public: TokenClass(const TokenClass &Copy) { Tokens = Copy.Tokens; vecsize = Copy.vecsize; } TokenClass() { } TokenClass(const std::string &Text,int Pos = 0) { Build(Text,Pos); } TokenClass& operator=(const TokenClass &Copy) { Tokens = Copy.Tokens; vecsize = Copy.vecsize; return *this; } TokenClass& operator=(const std::string &Text) { Build(Text,0); return *this; } inline std::string operator[](int Pos) const { if (vecsize < Pos) { return ""; } return Tokens[Pos]; } std::string operator()(int Start,int End = 0) const { if (vecsize < Start || vecsize < End) { return ""; } std::string Ret; if (!End) { End = Tokens.size(); } int i = Start; while (i <= End && i <= vecsize) { Ret += Tokens[i]; ++i; if (i <= End) Ret += std::string(" "); } return Ret; } inline int size() const { return vecsize; } inline void erase(int Pos) { if (vecsize < Pos) return; Tokens.erase(Tokens.begin()+Pos); vecsize--; } inline void replace(int Pos,const std::string &Rep) { if (vecsize < Pos || !Pos) return; Tokens[Pos] = Rep;; } inline void eraseglobal(int Pos) { if (vecsize < Pos) return; std::string Temp = Tokens[0]; Temp.replace(Temp.find(Tokens[Pos]),Tokens[Pos].size()+1,""); Tokens[0] = Temp; erase(Pos); } inline void Add(const std::string &Text,int Pos = 0) { if (!Pos) { Tokens.push_back(Text); ++vecsize; } else if (vecsize < Pos) { return; } else { Tokens.insert(Tokens.begin()+Pos,Text); ++vecsize; } } };
i could only wish it was that easy it gives tons of compiler errors with std class shit and all wich gives me even more problems i rather follow the guidelines and dont use std::
Are you running 4.0? If not just add using namespace std; to the top of the file, you don't have to use the std stuff but the token class did and probably always did, and thus needs to.
im running 4.0 im trying to convert my mod to 4.0 but lots of functions are different or dissappeared ive been trying to convert the old command class but ive noticed that the new vector class doesnt has a function to determine its bgin. now im not dumb (i hope) and begin = 0. so i just use 0 but on the internet i found that if my vector is empty ill get an exeption bcause vector[0] is invalid this is what ive become after converting Chatcommandclass.h Toggle Spoiler /* Renegade Scripts.dll SSGM chat command classes and functions Copyright 2007 Whitedragon(MDB), Jonathan Wilson This file is part of the Renegade scripts.dll The Renegade scripts.dll is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. See the file COPYING for more details. In addition, an exemption is given to allow Run Time Dynamic Linking of this code with any closed source module that does not contain code covered by this licence. Only the source code to the module(s) containing the licenced code has to be released. */ #include "General.h" #ifndef COMMANDS_H #define COMMANDS_H #define CHATTYPE_PUBLIC 0 #define CHATTYPE_TEAM 1 #define CHATTYPE_ALL 2 #define GAMEMODE_ALL 0 #define GAMEMODE_AOW 1 #define GAMEMODE_CTF 2 #define GAMEMODE_SNIPING 3 #define GAMEMODE_500SNIPING 4 #define GAMEMODE_INFANTRY 5 class TokenClass { private: DynamicVectorClass<StringClass> Tokens; int vecsize; void Build(const StringClass &Text,int Pos) { Tokens.Clear(); vecsize = 0; char *Tokenz = new char[Text.Get_Length()+1]; sprintf(Tokenz,"%s",Text); char *p = strtok(Tokenz," "); StringClass Temp2,All; if (!Pos) { Tokens.Add(Text); } else { int i = 0; while (i < Pos) { p = strtok(0," "); ++i; } } while (p) { Temp2 = p; Tokens.Add(Temp2); p = strtok(0," "); ++vecsize; if (Pos) { All += Temp2; if (p) All += StringClass(" "); } } if (Pos) { Tokens.Insert(0,All); } delete[] Tokenz; } public: TokenClass(const TokenClass &Copy) { Tokens = Copy.Tokens; vecsize = Copy.vecsize; } TokenClass() { } TokenClass(const StringClass &Text,int Pos = 0) { Build(Text,Pos); } TokenClass& operator=(const TokenClass &Copy) { Tokens = Copy.Tokens; vecsize = Copy.vecsize; return *this; } TokenClass& operator=(const StringClass &Text) { Build(Text,0); return *this; } inline StringClass operator[](int Pos) const { if (vecsize < Pos) { return ""; } return Tokens[Pos]; } StringClass operator()(int Start,int End = 0) const { if (vecsize < Start || vecsize < End) { return ""; } StringClass Ret; if (!End) { End = Tokens.Length(); } int i = Start; while (i <= End && i <= vecsize) { Ret += Tokens[i]; ++i; if (i <= End) Ret += StringClass(" "); } return Ret; } inline int size() const { return vecsize; } inline void erase(int Pos) { if (vecsize < Pos) return; Tokens.Delete(0+Pos); vecsize--; } inline void replace(int Pos,const StringClass &Rep) { if (vecsize < Pos || !Pos) return; Tokens[Pos] = Rep;; } inline void eraseglobal(int Pos) { if (vecsize < Pos) return; StringClass Temp = Tokens[0]; Temp.crop(Temp.Format(Tokens[Pos]),Tokens[Pos].Get_Length()+1); Tokens[0] = Temp; erase(Pos); } inline void Add(const StringClass &Text,int Pos = 0) { if (!Pos) { Tokens.Add(Text); ++vecsize; } else if (vecsize < Pos) { return; } else { Tokens.Insert(0+Pos,Text); ++vecsize; } } }; struct DataStruct; struct ChatCommandInfo; class ChatCommandClass { public: ChatCommandInfo *Info; virtual void Error(int ID,int ErrorType,int Param); virtual void Triggered(int ID,const TokenClass &Text,int ChatType) = 0; }; struct ChatCommandInfo { StringClass Command; ChatCommandClass *Ptr; int ChatType; int NumParams; int GameMode; }; class ChatCommandList { public: static DynamicVectorClass<ChatCommandInfo*> *List; static void Add_Chat_Command(ChatCommandClass *Ptr,const char *Command,int ChatType,int NumParams,int GameMode); }; template <class T> class ChatCommandRegistrant : public ChatCommandList { public: ChatCommandRegistrant(const char *Command,int ChatType,int NumParams,int GameMode) { char *Comm = newstr(Command); char *p = strtok(Comm,";"); while (p) { ChatCommandClass *Temp = new T; Add_Chat_Command(Temp,p,ChatType,NumParams,GameMode); p = strtok(0,";"); } delete[] Comm; } }; #endif Chatcommandclass.cpp Toggle Spoiler /* Renegade Scripts.dll SSGM chat command classes and functions Copyright 2007 Whitedragon(MDB), Jonathan Wilson This file is part of the Renegade scripts.dll The Renegade scripts.dll is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. See the file COPYING for more details. In addition, an exemption is given to allow Run Time Dynamic Linking of this code with any closed source module that does not contain code covered by this licence. Only the source code to the module(s) containing the licenced code has to be released. */ #include "General.h" void ChatCommandClass::Error(int ID,int ErrorType,int Param) { if (ID) { if (ErrorType == 1) { StringClass Msg; Msg.Format("ppage %d Insufficient parameters. This command requires atleast %d parameter(s), you only supplied %d.",ID,Info->NumParams,Param); Console_Input(Msg); } } } DynamicVectorClass<ChatCommandInfo*> *ChatCommandList::List = 0; void ChatCommandList::Add_Chat_Command(ChatCommandClass *Ptr,const char *Command,int ChatType,int NumParams,int GameMode) { ChatCommandInfo *Temp = new ChatCommandInfo; Temp->Ptr = Ptr; Temp->Command = Command; Temp->ChatType = ChatType; Temp->NumParams = NumParams; Temp->GameMode = GameMode; Ptr->Info = Temp; if (!List) { List = new DynamicVectorClass<ChatCommandInfo*>; } List->Add(Temp); } ive just copied those out of the old ssgm and edited them
im gonna use this its used in more then 50 commands aint gonna reamke em all i aint sick ^^ Gen_Blacky wrote on Wed, 05 October 2011 19:14 use the 4.0 chat hook. this is every command i have and as far as i see chathook just hooks into chat everytime something is written i have to find out myself what is written etc. Toggle Spoiler /* Renegade Scripts.dll KamBot Plugin Code Copyright 2009 Michael Kovacs This file is part of the Renegade scripts.dll The Renegade scripts.dll is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. See the file COPYING for more details. In addition, an exemption is given to allow Run Time Dynamic Linking of this code with any closed source module that does not contain code covered by this licence. Only the source code to the module(s) containing the licenced code has to be released. */ #include "General.h" class KamBotChatCommand : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text, int ChatType) { StringClass Msg; Msg.Format("CMSGP %d 0,255,0 %s v%s by %s",ID,PluginName,PluginVersion,PluginAuthor); Console_Input(Msg); Msg.Format("CMSGP %d 0,255,0 ================================================== ",ID); Console_Input(Msg); Msg.Format("CMSGP %d 0,255,0 !characters !defences, !powerups, !vpowerups, !weapons, !vtach, !detach, !metach",ID); Console_Input(Msg); } }; ChatCommandRegistrant<KamBotChatCommand> KamBotChatCommandReg("!kambot;!extra;!extras;!misc;!help",CHATTYPE_ALL,0,GAMEMODE_ALL); /*------------------O--------------------------------------------------------O | __ ___ .______ | CHARACTERS | | | |/ / | _ \ O--------------------------------------------------------O | | ' / | |_) | | - List of purchasable characters and their costs | | | < | _ < | | | | . \ | |_) | | | | |__|\__\ |______/ | | | | | \-------------------O------------------------------------------------------*/ class KB_Purchase_Char_List : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { StringClass Msg; int TEAM = Get_Team(ID); if (!Is_Building_Dead(Find_Soldier_Factory(TEAM))) { Msg.Format("pamsg %d !defender (1000), !saboteur (3000), !soldier (750), !officer (2500), !commando (4000), !raveshaw (8000), !petrova (10000), !ultima (10000), !kamuix (3500), !thief (1000),!spy (10000)",ID); Console_Input(Msg); } else if (Is_Building_Dead(Find_Soldier_Factory(TEAM))) { Msg.Format("pamsg %d !defender (2000), !saboteur (6000), !soldier (1500), !officer (5000), !commando (8000), !raveshaw (16000), !petrova (20000), !ultima (20000), !kamuix (7000), !thief (2000), !spy (20000)",ID); Console_Input(Msg); Msg.Format("pamsg %d Prices are doubled because your Soldier Factory is destroyed.",ID); Console_Input(Msg); } } }; ChatCommandRegistrant<KB_Purchase_Char_List> KB_Purchase_Char_List_Reg("!buy;!char;!chars;!character;!characters",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Char_Me : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Me(obj); } }; ChatCommandRegistrant<KB_Purchase_Char_Me> KB_Purchase_Char_Me_Reg("!me",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Char_Defender : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Char(obj,"Defender",2,1000,"M09_Shuman",75,75,"SkinVehicleHeavy","ShieldVehicleHeavy","POW_LaserRifle_Player CnC_POW_RepairGun_Player CnC_MineProximity_05","JFW_Health_Regen JFW_Armour_Regen","01.00,5,5 01.00,5,5"); } }; ChatCommandRegistrant<KB_Purchase_Char_Defender> KB_Purchase_Char_Defender_Reg("!defender",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Char_Saboteur : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Char(obj,"Saboteur",2,3000,"CnC_Nod_FlameThrower_2SF",250,100,"SkinFlesh","ShieldKevlar","POW_MineRemote_Player CnC_POW_MineRemote_01 CnC_POW_MineRemote_02 POW_MineTimed_Player CnC_POW_MineTimed_Player_01 CnC_POW_MineTimed_Player_02 CnC_POW_RepairGun_Player","",""); } }; ChatCommandRegistrant<KB_Purchase_Char_Saboteur> KB_Purchase_Char_Saboteur_Reg("!saboteur",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Char_Soldier : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Char(obj,"Soldier",2,750,"GDI_MP",150,100,"SkinFlesh","ShieldKevlar","CnC_POW_AutoRifle_Player_Nod CnC_POW_AutoRifle_Player_GDI POW_GrenadeLauncher_Player POW_Shotgun_Player POW_Flamethrower_Player POW_TiberiumAutoRifle_Player POW_ChemSprayer_Player","",""); } }; ChatCommandRegistrant<KB_Purchase_Char_Soldier> KB_Purchase_Char_Soldier_Reg("!soldier",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Char_Officer : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Char(obj,"Officer",2,2500,"M01_Capt_Duncan",200,100,"SkinFlesh","ShieldKevlar","POW_Chaingun_Player POW_Chaingun_Player_Nod POW_SniperRifle_Player POW_SniperRifle_Player_Nod POW_TiberiumFlechetteGun_Player POW_LaserRifle_Player POW_LaserChaingun_Player POW_RocketLauncher_Player POW_RepairGun_Player","",""); } }; ChatCommandRegistrant<KB_Purchase_Char_Officer> KB_Purchase_Char_Officer_Reg("!officer",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Char_Commando : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Char(obj,"Commando",2,4000,"GDI_Logan_Sheppard",250,100,"SkinVehicleLight","ShieldVehicleLight","CnC_POW_RocketLauncher_Player POW_Ramjetrifle CnC_POW_VoltAutoRifle_Player_Nod POW_VoltAutoRifle_Player CnC_POW_RepairGun_Player","",""); } }; ChatCommandRegistrant<KB_Purchase_Char_Commando> KB_Purchase_Char_Commando_Reg("!commando",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Char_Raveshaw : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Char(obj,"Raveshaw",2,8000,"Mutant_3Boss_Raveshaw",1000,1000,"SkinMutant","ShieldChemWarrior","POW_RamjetRifle_Player","",""); } }; ChatCommandRegistrant<KB_Purchase_Char_Raveshaw> KB_Purchase_Char_Raveshaw_Reg("!rave;!raveshaw",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Char_Petrova : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Char(obj,"Petrova",2,10000,"Mutant_3Boss_Petrova",1200,1200,"SkinMutant","SkinMutant","","",""); } }; ChatCommandRegistrant<KB_Purchase_Char_Petrova> KB_Purchase_Char_Petrova_Reg("!pet;!petrova",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Char_Ultima : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Char(obj,"Ultima",2,10000,"Nod_Kane",500,500,"SkinMutant","SkinMutant","POW_Uplink CnC_POW_AutoRifle_Player_Nod CnC_POW_AutoRifle_Player_GDI POW_GrenadeLauncher_Player POW_Shotgun_Player POW_Flamethrower_Player POW_TiberiumAutoRifle_Player POW_ChemSprayer_Player POW_Chaingun_Player POW_Chaingun_Player_Nod POW_SniperRifle_Player POW_SniperRifle_Player_Nod POW_TiberiumFlechetteGun_Player POW_LaserRifle_Player POW_LaserChaingun_Player POW_RocketLauncher_Player POW_RepairGun_Player CnC_POW_RocketLauncher_Player POW_Ramjetrifle POW_Railgun_Player POW_PersonalIonCannon_Player CnC_POW_VoltAutoRifle_Player_Nod POW_VoltAutoRifle_Player CnC_POW_RepairGun_Player POW_MineRemote_Player CnC_POW_MineRemote_01 CnC_POW_MineRemote_02 POW_MineTimed_Player CnC_POW_MineTimed_Player_01 CnC_POW_MineTimed_Player_02 POW_MineProximity_Player CnC_MineProximity_05","JFW_Blow_Up_On_Death JFW_Health_Regen JFW_Armour_Regen","Explosion_NukeBeacon 01.00,5,5 01.00,5,5"); } }; ChatCommandRegistrant<KB_Purchase_Char_Ultima> KB_Purchase_Char_Ultima_Reg("!ultima",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Char_Kamuix : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); int TEAM = Get_Team(ID); if (TEAM==0) { KB_Purchase_Char(obj,"Kamuix",0,3500,"CnC_Nod_FlameThrower_1Off",150,100,"SkinVehicleLight","ShieldChemWarrior","POW_Ramjetrifle POW_LaserChaingun_Player POW_MineRemote_Player CnC_POW_Nuclear_Missle_Beacon","",""); } if (TEAM==1) { KB_Purchase_Char(obj,"Kamuix",1,3500,"CnC_Nod_FlameThrower_1Off",150,100,"SkinVehicleLight","ShieldChemWarrior","POW_Ramjetrifle POW_LaserChaingun_Player POW_MineRemote_Player CnC_POW_IonCannonBeacon_Player","",""); } } }; ChatCommandRegistrant<KB_Purchase_Char_Kamuix> KB_Purchase_Char_Kamuix_Reg("!kamuix",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Char_Thief : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Char(obj,"Thief",2,1000,"CnC_Nod_FlameThrower_2SF",200,100,"SkinFlesh","ShieldKevlar","POW_LaserChaingun_Player","JFW_Clear_Weapons_Create KB_Char_Thief","! !"); } }; ChatCommandRegistrant<KB_Purchase_Char_Thief> KB_Purchase_Char_Thief_Reg("!thief",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Char_Spy : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Char(obj,"Spy",2,10000,"CnC_Nod_FlameThrower_2SF",200,100,"SkinFlesh","ShieldKevlar","","KB_Char_Spy","!"); } }; ChatCommandRegistrant<KB_Purchase_Char_Spy> KB_Purchase_Char_Spy_Reg("!spy",CHATTYPE_ALL,0,GAMEMODE_ALL); /*------------------O--------------------------------------------------------O | __ ___ .______ | DEFENCES | | | |/ / | _ \ O--------------------------------------------------------O | | ' / | |_) | | - List of purchasable defences and their costs | | | < | _ < | | | | . \ | |_) | | | | |__|\__\ |______/ | | | | | \-------------------O------------------------------------------------------*/ class KB_Purchase_Def_List : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { StringClass Msg; int TEAM = Get_Team(ID); if (!Is_Building_Dead(Find_Power_Plant(TEAM))) { if (TEAM == 0) { Msg.Format("pamsg %d !turret (600), !samsite (1500), !gunsamsite (1750), !missilesamsite (2000), !obelisk (10000)",ID); Console_Input(Msg); } if (TEAM == 1) { Msg.Format("pamsg %d !guardtower (600), !miniagt (1800), !heavyguardtower (2300), !advancedguardtower (10000)",ID); Console_Input(Msg); } Msg.Format("pamsg %d !gun (400), !cannon (400), !rockets (400), !gate (800), !bgate(1500), !shack (900), !moab (3000), !tower(3500), !pt(1500), !fb(2500), !hpgen(2000) ,!basegapgen (7500)",ID); Console_Input(Msg); } else if (Is_Building_Dead(Find_Power_Plant(TEAM))) { if (TEAM == 0) { Msg.Format("pamsg %d !turret (1200), !samsite (3000), !gunsamsite (3500), !missilesamsite (4000), !obelisk (20000)",ID); Console_Input(Msg); } if (TEAM == 1) { Msg.Format("pamsg %d !guardtower (1200), !miniagt (3900), !heavyguardtower (4600), !advancedguardtower (20000)",ID); Console_Input(Msg); } Msg.Format("pamsg %d !gun (800), !cannon (800), !rockets (800), !gate (1600), !bgate(3000), !shack (1800), !moab (6000), !tower(7000), !pt(3000), !fb(5000), !hpgen(2000) ,!basegapgen (15000)",ID); Console_Input(Msg); Msg.Format("pamsg %d Prices are doubled because your Power Plant is destroyed.",ID); Console_Input(Msg); } } }; ChatCommandRegistrant<KB_Purchase_Def_List> KB_Purchase_Def_List_Reg("!def;!defense;!defence;!defenses;!defences;!make;!build;!deploy",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Def_Nod_Turret : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Def(obj,"Nod Turret",0,600,"Nod_Turret_MP_Improved",0,0,0,"KB_Def_Nod_Turret","!"); } }; ChatCommandRegistrant<KB_Purchase_Def_Nod_Turret> KB_Purchase_Def_Nod_Turret_Reg("!t;!turret",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Def_Nod_SAMSite : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Def(obj,"Nod SAM Site",0,1500,"SAM_Site_Quick_Turn",0,0,0,"KB_Def_Nod_SAMSite","!"); } }; ChatCommandRegistrant<KB_Purchase_Def_Nod_SAMSite> KB_Purchase_Def_Nod_SAMSite_Reg("!ss;!samsite",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Def_Nod_GunSAMSite : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Def(obj,"Nod Gun SAM Site",0,1750,"SAM_Site_Quick_Turn",0,0,0,"KB_Def_Nod_GunSAMSite","!"); } }; ChatCommandRegistrant<KB_Purchase_Def_Nod_GunSAMSite> KB_Purchase_Def_Nod_GunSAMSite_Reg("!gss;!gunsamsite",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Def_Nod_MissileSAMSite : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Def(obj,"Nod Missile SAM Site",0,2000,"SAM_Site_Quick_Turn",0,0,0,"KB_Def_Nod_MissileSAMSite","!"); } }; ChatCommandRegistrant<KB_Purchase_Def_Nod_MissileSAMSite> KB_Purchase_Def_Nod_MissileSAMSite_Reg("!mss;!missilesamsite",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Def_Nod_Obelisk : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Def(obj,"Nod Obelisk of Light",0,10000,"GDI Gunboat",0,-5.0,0,"KB_Def_Nod_Obelisk","!"); } }; ChatCommandRegistrant<KB_Purchase_Def_Nod_Obelisk> KB_Purchase_Def_Nod_Obelisk_Reg("!obi;!obelisk",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Def_GunEmplacement : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); int TEAM = Get_Team(ID); if (TEAM == 0) { KB_Purchase_Def(obj,"Gun Emplacement",2,400,"CnC_Nod_Gun_Emplacement",0,0,1.0,"KB_Def_GunEmplacement","!"); } else { KB_Purchase_Def(obj,"Gun Emplacement",2,400,"CnC_GDI_Gun_Emplacement",0,0,1.0,"KB_Def_GunEmplacement","!"); } } }; ChatCommandRegistrant<KB_Purchase_Def_GunEmplacement> KB_Purchase_Def_GunEmplacement_Reg("!g;!gun",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Def_CannonEmplacement : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Def(obj,"Cannon Emplacement",2,400,"CnC_Cannon_Emplacement",0,0,1.0,"KB_Def_CannonEmplacement","!"); } }; ChatCommandRegistrant<KB_Purchase_Def_CannonEmplacement> KB_Purchase_Def_CannonEmplacement_Reg("!c;!cannon",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Def_RocketEmplacement : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Def(obj,"Rocket Emplacement",2,400,"CnC_Rocket_Emplacement",0,0,1.0,"KB_Def_RocketEmplacement","!"); } }; ChatCommandRegistrant<KB_Purchase_Def_RocketEmplacement> KB_Purchase_Def_RocketEmplacement_Reg("!r;!rockets",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Def_Gate : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Def2(obj,"Gate",800,"GDI Gunboat",0,0,0,"KB_Def_Gate","!"); } }; ChatCommandRegistrant<KB_Purchase_Def_Gate> KB_Purchase_Def_Gate_Reg("!gate",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Def_Shack : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Def2(obj,"Shack",900,"GDI Gunboat",0,0,(float)-0.3,"KB_Def_Shack","!"); } }; ChatCommandRegistrant<KB_Purchase_Def_Shack> KB_Purchase_Def_Shack_Reg("!shack",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Def_MOAB : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Def2(obj,"MOAB - Mother Of All Bombs",3000,"Simple_MetalDrum_06",0,0,0,"KB_Def_MOAB","!"); } }; ChatCommandRegistrant<KB_Purchase_Def_MOAB> KB_Purchase_Def_MOAB_Reg("!moab",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Def_GDI_GuardTower : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Def(obj,"GDI Guard Tower",1,600,"GDI_Guard_Tower",0,0,5.5,"KB_Def_GDI_GuardTower","!"); } }; ChatCommandRegistrant<KB_Purchase_Def_GDI_GuardTower> KB_Purchase_Def_GDI_GuardTower_Reg("!gt;!guardtower",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Def_GDI_MiniAdvancedGuardTower : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Def(obj,"GDI Mini Advanced Guard Tower",1,1800,"GDI_Guard_Tower",0,0,5.5,"KB_Def_GDI_MiniAGT","!"); } }; ChatCommandRegistrant<KB_Purchase_Def_GDI_MiniAdvancedGuardTower> KB_Purchase_Def_GDI_MiniAdvancedGuardTower_Reg("!ma;!miniagt;!miniadvancedguardtower",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Def_GDI_HeavyGuardTower : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Def(obj,"GDI Heavy Guard Tower",1,2300,"GDI_Guard_Tower",0,0,5.5,"KB_Def_GDI_HeavyGuardTower","!"); } }; ChatCommandRegistrant<KB_Purchase_Def_GDI_HeavyGuardTower> KB_Purchase_Def_GDI_HeavyGuardTower_Reg("!hgt;!heavygt;!heavyguardtower",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Def_GDI_AdvancedGuardTower : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Def(obj,"GDI Advanced Guard Tower",1,10000,"GDI Gunboat",0,0,0,"KB_Def_GDI_AGT","!"); } }; ChatCommandRegistrant<KB_Purchase_Def_GDI_AdvancedGuardTower> KB_Purchase_Def_GDI_AdvancedGuardTower_Reg("!agt;!advancedguardtower",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Def_Gapgen : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); int TEAM = Get_Team(ID); if (TEAM == 0) { KB_Purchase_Def(obj,"Gapgen",0,7500,"GDI Gunboat",0,0,0,"KB_Def_Gapgen","!"); } else { KB_Purchase_Def(obj,"Gapgen",1,7500,"GDI Gunboat",0,0,0,"KB_Def_Gapgen","!"); } } }; ChatCommandRegistrant<KB_Purchase_Def_Gapgen> KB_Purchase_Def_Gapgen_Reg("!basegapgen;!bgg",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Def_PT : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); int TEAM = Get_Team(ID); if (TEAM == 0) { KB_Purchase_Def(obj,"PT",0,1500,"GDI Gunboat",0,0,0,"KB_Def_PT","!"); } else { KB_Purchase_Def(obj,"PT",1,1500,"GDI Gunboat",0,0,0,"KB_Def_PT","!"); } } }; ChatCommandRegistrant<KB_Purchase_Def_PT> KB_Purchase_Def_PT_Reg("!pt",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Def_PTgun : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); int TEAM = Get_Team(ID); if (TEAM == 0) { KB_Purchase_Def(obj,"Forward base",0,2500,"GDI Gunboat",0,0,0,"KB_Def_PTgun","!"); } else { KB_Purchase_Def(obj,"Forward base",1,2500,"GDI Gunboat",0,0,0,"KB_Def_PTgun","!"); } } }; ChatCommandRegistrant<KB_Purchase_Def_PTgun> KB_Purchase_Def_PTgun_Reg("!fb",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Def_Tower : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); int TEAM = Get_Team(ID); if (TEAM == 0) { KB_Purchase_Def(obj,"obitower",0,3500,"GDI Gunboat",0,0,0,"KB_Def_Tower","!"); } else { KB_Purchase_Def(obj,"agttower",1,3500,"GDI Gunboat",0,0,0,"KB_Def_Tower","!"); } } }; ChatCommandRegistrant<KB_Purchase_Def_Tower> KB_Purchase_Def_Tower_Reg("!tower",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Def_HPgen : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); int TEAM = Get_Team(ID); if (TEAM == 0) { KB_Purchase_Def(obj,"HPgen",0,2000,"GDI Gunboat",0,0,0,"KB_Def_HPgen","!"); } else { KB_Purchase_Def(obj,"HPgen",1,2000,"GDI Gunboat",0,0,0,"KB_Def_HPgen","!"); } } }; ChatCommandRegistrant<KB_Purchase_Def_HPgen> KB_Purchase_Def_HPgen_Reg("!hpgen",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Def_BaseGate : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Def2(obj,"Basegate",1500,"GDI Gunboat",0,0,0,"KB_Def_AGate","!"); } }; ChatCommandRegistrant<KB_Purchase_Def_BaseGate> KB_Purchase_Def_BaseGate_Reg("!basegate;!bgate",CHATTYPE_ALL,0,GAMEMODE_ALL); /*------------------O--------------------------------------------------------O | __ ___ .______ | INFANTRY POWERUPS | | | |/ / | _ \ O--------------------------------------------------------O | | ' / | |_) | | - List of purchasable upgrades for infantry and costs | | | < | _ < | | | | . \ | |_) | | | | |__|\__\ |______/ | | | | | \-------------------O------------------------------------------------------*/ class KB_Purchase_Pow_List : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { StringClass Msg; int TEAM = Get_Team(ID); if (!Is_Building_Dead(Find_Soldier_Factory(TEAM))) { Msg.Format("pamsg %d !health (5 per point), !shield (5 per point), !flamesuit (150), !chemsuit (300), !skinvehicle(1200), !skinmutant (1600), !regen(1500), !poison(250), !freezer (1500)",ID); Console_Input(Msg); } else if (Is_Building_Dead(Find_Soldier_Factory(TEAM))) { Msg.Format("pamsg %d !health (10 per point), !shield (10 per point), !flamesuit (300), !chemsuit (600), !skinvehicle(2400), !skinmutant (3200), !regen(3000), !poison(500), !freezer (3000)",ID); Console_Input(Msg); Msg.Format("pamsg %d Prices are doubled because your Soldier Factory is destroyed.",ID); Console_Input(Msg); } } }; ChatCommandRegistrant<KB_Purchase_Pow_List> KB_Purchase_Pow_List_Reg("!pow;!powerup;!powerups",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Pow_HP : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { StringClass Msg,Msg2; GameObject *obj = Get_GameObj(ID); int TEAM = Get_Team(ID); if (Text.size()>0) { KB_Purchase_Pow_Life(obj,"Augmented Health",2,(float)atof(Text[1]),0); } else { Msg.Format("pamsg %d Cost is 10 credits per Health Point. (double because your Soldier Factory is destroyed)",ID); Msg2.Format("pamsg %d Cost is 5 credits per Health Point.",ID); ((Is_Building_Dead(Find_Soldier_Factory(TEAM)))? Console_Input(Msg) : Console_Input(Msg)); Msg.Format("pamsg %d Syntax: !health <amount>",ID); Console_Input(Msg); } } }; ChatCommandRegistrant<KB_Purchase_Pow_HP> KB_Purchase_Pow_HP_Reg("!hp;!health",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Pow_AP : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { StringClass Msg,Msg2; GameObject *obj = Get_GameObj(ID); int TEAM = Get_Team(ID); if (Text.size()>0) { KB_Purchase_Pow_Life(obj,"Augmented Armour",2,0,(float)atof(Text[1])); } else { Msg.Format("pamsg %d Cost is 10 credits per Shield Strength Point. (double because your Soldier Factory is destroyed)",ID); Msg2.Format("pamsg %d Cost is 5 credits per Shield Strength Point.",ID); ((Is_Building_Dead(Find_Soldier_Factory(TEAM)))? Console_Input(Msg) : Console_Input(Msg2)); Msg.Format("pamsg %d Syntax: !shield <amount>",ID); Console_Input(Msg); } } }; ChatCommandRegistrant<KB_Purchase_Pow_AP> KB_Purchase_Pow_AP_Reg("!ap;!armour;!armor;!shield;!shieldstrength",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Pow_FlameSuit : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Pow(obj,"Flame Suit",2,150,0,0,"SkinFlameThrower","ShieldFlameThrower","","","",false); } }; ChatCommandRegistrant<KB_Purchase_Pow_FlameSuit> KB_Purchase_Pow_FlameSuit_Ref("!flamesuit",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Pow_ChemSuit : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Pow(obj,"Chem Suit",2,300,0,0,"SkinChemWarrior","SkieldChemWarrior","","","",false); } }; ChatCommandRegistrant<KB_Purchase_Pow_ChemSuit> KB_Purchase_Pow_ChemSuit_Reg("!chemsuit",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Pow_SkinMutant : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Pow(obj,"Mutant Skin",2,1600,0,0,"SkinMutant","SkinMutant","","","",false); } }; ChatCommandRegistrant<KB_Purchase_Pow_SkinMutant> KB_Purchase_Pow_SkinMutant_Reg("!skinmutant;!mutantskin",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Pow_SkinVehicle : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Pow(obj,"Vehicle Skin",2,1200,0,0,"SkinVehicleLight","ShieldVehicleLight","","","",false); } }; ChatCommandRegistrant<KB_Purchase_Pow_SkinVehicle> KB_Purchase_Pow_SkinVehicle_Reg("!skinvehicle;!vehicleskin",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Pow_Freezer : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); int TEAM = Get_Team(ID); if (TEAM == 1){KB_Purchase_Pow(obj,"Freezer",1,1500,0,0,"","","POW_PersonalIonCannon_Player","KB_Char_Freezer","!",false);} if (TEAM == 0){KB_Purchase_Pow(obj,"Freezer",0,1500,0,0,"","","POW_Railgun_Player","KB_Char_Freezer","!",false);} } }; ChatCommandRegistrant<KB_Purchase_Pow_Freezer> KB_Purchase_Pow_Freezer_Reg("!freezer",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Pow_Poison : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); int TEAM = Get_Team(ID); if (TEAM == 1){KB_Purchase_Pow(obj,"Poison",1,250,0,0,"","","POW_AutoRifle_Player","KB_Char_Poison","!",false);} if (TEAM == 0){KB_Purchase_Pow(obj,"Poison",0,250,0,0,"","","POW_AutoRifle_Player_Nod","KB_Char_Poison","!",false);} } }; ChatCommandRegistrant<KB_Purchase_Pow_Poison> KB_Purchase_Pow_Poison_Reg("!poison",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Pow_Regen : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Pow(obj,"Regen",2,1500,0,0,"","","","JFW_Health_Regen JFW_Armour_Regen","0.75,5,5 0.75,5,5",false); } }; ChatCommandRegistrant<KB_Purchase_Pow_Regen> KB_Purchase_Pow_Regen_Reg("!regen",CHATTYPE_ALL,0,GAMEMODE_ALL); /*------------------O--------------------------------------------------------O | __ ___ .______ | VEHICLE POWERUPS | | | |/ / | _ \ O--------------------------------------------------------O | | ' / | |_) | | - List of purchasable upgrades for vehicles and costs | | | < | _ < | | | | . \ | |_) | | | | |__|\__\ |______/ | | | | | \-------------------O------------------------------------------------------*/ class KB_Purchase_Pow_Veh_List : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { StringClass Msg; int TEAM = Get_Team(ID); if (!Is_Building_Dead(Find_Vehicle_Factory(TEAM))) { Msg.Format("pamsg %d !gapgen (10000), !vupgrade (original cost of vehicle)",ID); Console_Input(Msg); } else if (Is_Building_Dead(Find_Vehicle_Factory(TEAM))) { Msg.Format("pamsg %d !gapgen (20000), !vupgrade (double original cost of vehicle)",ID); Console_Input(Msg); Msg.Format("pamsg %d Prices are doubled because your Vehicle Factory is destroyed.",ID); Console_Input(Msg); } } }; ChatCommandRegistrant<KB_Purchase_Pow_Veh_List> KB_Purchase_Pow_Veh_List_Ref("!vpow;!vpowerup;!vpowerups",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Pow_Veh_GAPGEN : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Pow_Veh(obj,"Mobile GAP Generator",2,10000,false,false,"KB_GAP_Generator","!"); } }; ChatCommandRegistrant<KB_Purchase_Pow_Veh_GAPGEN> KB_Purchase_Pow_Veh_GAPGEN_Reg("!gapgen",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Pow_Veh_Upgrade : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Pow_Veh(obj,"Vehicle Upgrade",2,0,false,true,"",""); } }; ChatCommandRegistrant<KB_Purchase_Pow_Veh_Upgrade> KB_Purchase_Pow_Veh_Upgrade_Reg("!vup;!vupgrade;!vehicleupgrade",CHATTYPE_ALL,0,GAMEMODE_ALL); /*------------------O--------------------------------------------------------O | __ ___ .______ | WEAPONRY | | | |/ / | _ \ O--------------------------------------------------------O | | ' / | |_) | | - List of purchasable weapons and their costs | | | < | _ < | | | | . \ | |_) | | | | |__|\__\ |______/ | | | | | \-------------------O------------------------------------------------------*/ class KB_Purchase_Weap_List : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { int TEAM = Get_Team(ID); StringClass Msg; if (!Is_Building_Dead(Find_Soldier_Factory(TEAM))) { if ( TEAM == 1) { Msg.Format("pamsg %d !shotgun (50), !grenades (50), !rifle (50), !repgun (350), !strongrepgun (700), !proxy (350)",ID); Console_Input(Msg); Msg.Format("pamsg %d !chaingun (175), !rocketlauncher (225), !sniperrifle (500), !ramjetrifle (1000), !volt (1000), !agtgun(1500)",ID); Console_Input(Msg); Msg.Format("pamsg %d !tibrifle (1000), !flechette (450), !strongrocketlauncher (400), !pic (1000)",ID); Console_Input(Msg); } else { Msg.Format("pamsg %d !shotgun (50), !flamethrower (50), !rifle (50), !repgun (350), !strongrepgun (700), !proxy (350)",ID); Console_Input(Msg); Msg.Format("pamsg %d !chaingun (175), !rocketlauncher (225), !sniperrifle (500), !ramjetrifle (1000), !volt (1000), !agtgun(1500)",ID); Console_Input(Msg); Msg.Format("pamsg %d !!chemsprayer (150), !laserchain (450), !laserrifle (400), !rail (1000)",ID); Console_Input(Msg); } } else if (Is_Building_Dead(Find_Soldier_Factory(TEAM))) { if ( TEAM == 1) { Msg.Format("pamsg %d !shotgun (100), !grenades (100), !rifle (100), !repgun (700), !strongrepgun (1400), !proxy (700)",ID); Console_Input(Msg); Msg.Format("pamsg %d !chaingun (350), !rocketlauncher (450), !sniperrifle (1000), !ramjetrifle (2000), !volt (2000), !agtgun(3000)",ID); Console_Input(Msg); Msg.Format("pamsg %d !tibrifle (2000), !flechette (900), !strongrocketlauncher (800), !pic (2000)",ID); Console_Input(Msg); } else { Msg.Format("pamsg %d !shotgun (100), !grenades (100), !rifle (100), !repgun (700), !strongrepgun (1400), !proxy (700)",ID); Console_Input(Msg); Msg.Format("pamsg %d !chaingun (350), !rocketlauncher (450), !sniperrifle (1000), !ramjetrifle (2000), !volt (2000), !agtgun(3000)",ID); Console_Input(Msg); Msg.Format("pamsg %d !!chemsprayer (300), !laserchain (900), !laserrifle (800), !rail (2000)",ID); Console_Input(Msg); } } } }; ChatCommandRegistrant<KB_Purchase_Weap_List> KB_Purchase_Weap_List_Reg("!wpn;!weap;!weaps;!weapon;!weapons",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Weap_Autorifle : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); int TEAM = Get_Team(ID); if (TEAM==0) { KB_Purchase_Pow_Weapon(obj,"Autorifle",0,50,"POW_AutoRifle_Player_Nod"); } else { KB_Purchase_Pow_Weapon(obj,"Autorifle",2,50,"POW_AutoRifle_Player"); } } }; ChatCommandRegistrant<KB_Purchase_Weap_Autorifle> KB_Purchase_Weap_Autorifle_Reg("!rifle;!autorifle",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Weap_Shotgun : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Pow_Weapon(obj,"Shotgun",2,50,"POW_Shotgun_Player"); } }; ChatCommandRegistrant<KB_Purchase_Weap_Shotgun> KB_Purchase_Weap_Shotgun_Reg("!shotgun",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Weap_Flamethrower : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Pow_Weapon(obj,"Flamethrower",0,50,"POW_Flamethrower_Player"); } }; ChatCommandRegistrant<KB_Purchase_Weap_Flamethrower> KB_Purchase_Weap_Flamethrower_Reg("!flame;!flames;!flamethrower",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Weap_GrenadeLauncher : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Pow_Weapon(obj,"Grenade Launcher",1,50,"POW_GrenadeLauncher_Player"); } }; ChatCommandRegistrant<KB_Purchase_Weap_GrenadeLauncher> KB_Purchase_Weap_GrenadeLauncher_Reg("!grenade;!grenades;!grenader;!grenadelauncher",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Weap_ChemSprayer : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Pow_Weapon(obj,"Chem Sprayer",0,150,"POW_ChemSprayer_Player"); } }; ChatCommandRegistrant<KB_Purchase_Weap_ChemSprayer> KB_Purchase_Weap_ChemSprayer_Reg("!chem;!chemspray;!chemsprayer",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Weap_TiberiumAutoRifle : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Pow_Weapon(obj,"Tiberium Auto Rifle",1,1000,"POW_TiberiumAutoRifle_Player"); } }; ChatCommandRegistrant<KB_Purchase_Weap_TiberiumAutoRifle> KB_Purchase_Weap_TiberiumAutoRifle_Reg("!tibgun;!tibauto;!tibrifle;!tiberiumautorifle",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Weap_Chaingun : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); int TEAM = Get_Team(ID); if (TEAM==0) { KB_Purchase_Pow_Weapon(obj,"Chaingun",0,175,"POW_Chaingun_Player_Nod"); } else { KB_Purchase_Pow_Weapon(obj,"Chaingun",2,175,"POW_Chaingun_Player"); } } }; ChatCommandRegistrant<KB_Purchase_Weap_Chaingun> KB_Purchase_Weap_Chaingun_Reg("!chaingun",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Weap_RocketLauncher : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Pow_Weapon(obj,"Rocket Launcher",2,225,"POW_RocketLauncher_Player"); } }; ChatCommandRegistrant<KB_Purchase_Weap_RocketLauncher> KB_Purchase_Weap_RocketLauncher_Reg("!rl;!rocketlauncher",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Weap_iRocketLauncher : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Pow_Weapon(obj,"Improved Rocket Launcher",1,400,"CnC_POW_RocketLauncher_Player"); } }; ChatCommandRegistrant<KB_Purchase_Weap_iRocketLauncher> KB_Purchase_Weap_iRocketLauncher_Reg("!irl;!irockets;!improvedrocketlauncher;!srockets;!strongrocketlauncher",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Weap_LaserRifle : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Pow_Weapon(obj,"Laser Rifle",0,400,"POW_LaserRifle_Player"); } }; ChatCommandRegistrant<KB_Purchase_Weap_LaserRifle> KB_Purchase_Weap_LaserRifle_Reg("!laser;!laserrifle",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Weap_LaserChaingun : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Pow_Weapon(obj,"Laser Chaingun",0,450,"POW_LaserChaingun_Player"); } }; ChatCommandRegistrant<KB_Purchase_Weap_LaserChaingun> KB_Purchase_Weap_LaserChaingun_Reg("!lcg;!laserchain;!laserchaingun",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Weap_TiberiumFlechetteGun : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Pow_Weapon(obj,"Tiberium Flechette Gun",1,450,"POW_TiberiumFlechetteGun_Player"); } }; ChatCommandRegistrant<KB_Purchase_Weap_TiberiumFlechetteGun> KB_Purchase_Weap_TiberiumFlechetteGun_Reg("!flechette;!tiberiumflechette",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Weap_SniperRifle : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); int TEAM = Get_Team(ID); if (TEAM==0) { KB_Purchase_Pow_Weapon(obj,"Sniper Rifle",0,500,"POW_SniperRifle_Player_Nod"); } else { KB_Purchase_Pow_Weapon(obj,"Sniper Rifle",2,500,"POW_SniperRifle_Player"); } } }; ChatCommandRegistrant<KB_Purchase_Weap_SniperRifle> KB_Purchase_Weap_SniperRifle_Reg("!sniper;!sniperrifle",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Weap_RamjetRifle : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Pow_Weapon(obj,"Ramjet Rifle",2,1000,"POW_RamjetRifle_Player");/*ramjet 4 shot is possible if you grant powerup pow ramjetrifle2*/ } }; ChatCommandRegistrant<KB_Purchase_Weap_RamjetRifle> KB_Purchase_Weap_RamjetRifle_Reg("!ramjet;!ramjetrifle",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Weap_Railgun : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Pow_Weapon(obj,"Railgun",0,1000,"POW_Railgun_Player"); } }; ChatCommandRegistrant<KB_Purchase_Weap_Railgun> KB_Purchase_Weap_Railgun_Reg("!rg;!rail;!railgun",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Weap_PersonalIonCannon : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Pow_Weapon(obj,"Personal Ion Cannon",1,1000,"POW_PersonalIonCannon_Player"); } }; ChatCommandRegistrant<KB_Purchase_Weap_PersonalIonCannon> KB_Purchase_Weap_PersonalIonCannon_Reg("!pic;!personalioncannon",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Weap_VoltAutoRifle : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); int TEAM = Get_Team(ID); if (TEAM==0) { KB_Purchase_Pow_Weapon(obj,"Volt Auto Rifle",0,1000,"CnC_POW_VoltAutoRifle_Player_Nod"); } else { KB_Purchase_Pow_Weapon(obj,"Volt Auto Rifle",2,1000,"POW_VoltAutoRifle_Player"); } } }; ChatCommandRegistrant<KB_Purchase_Weap_VoltAutoRifle> KB_Purchase_Weap_VoltAutoRifle_Reg("!volt;!voltautorifle",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Weap_RepairGun : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Pow_Weapon(obj,"Repair Gun",2,350,"POW_RepairGun_Player"); } }; ChatCommandRegistrant<KB_Purchase_Weap_RepairGun> KB_Purchase_Weap_RepairGun_Reg("!repgun;!repairgun",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Weap_iRepairGun : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Pow_Weapon(obj,"Improved Repair Gun",2,700,"CnC_POW_RepairGun_Player"); } }; ChatCommandRegistrant<KB_Purchase_Weap_iRepairGun> KB_Purchase_Weap_iRepairGun_Reg("!irepgun;!improvedrepairgun;!srepgun;!strongrepairgun",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Weap_MineProximity : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Pow_Weapon(obj,"Proximity Mines",2,350,"CnC_MineProximity_05"); } }; ChatCommandRegistrant<KB_Purchase_Weap_MineProximity> KB_Purchase_Weap_MineProximity_Reg("!mines;!proxy;!proxies;!mineproximity",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_Purchase_Weap_AgtGun : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); KB_Purchase_Pow_Weapon(obj,"AGT gun",2,1500,"POW_Uplink"); } }; ChatCommandRegistrant<KB_Purchase_Weap_AgtGun> KB_Purchase_Weap_AgtGun_Reg("!agtgun;",CHATTYPE_ALL,0,GAMEMODE_ALL); //class KB_Purchase_Weap_MineRemote : public ChatCommandClass //{ // void Triggered(int ID,const TokenClass &Text,int ChatType) // { // GameObject *obj = Get_GameObj(ID); // KB_Purchase_Pow_Weapon(obj,"Remote C4",2,200,"CnC_POW_MineRemote_01"); // } //}; //ChatCommandRegistrant<KB_Purchase_Weap_MineRemote> KB_Purchase_Weap_MineRemote_Reg("!mote;!remote;!mineremote",CHATTYPE_ALL,0,GAMEMODE_ALL); //class KB_Purchase_Weap_MineRemote2 : public ChatCommandClass //{ // void Triggered(int ID,const TokenClass &Text,int ChatType) // { // GameObject *obj = Get_GameObj(ID); // KB_Purchase_Pow_Weapon(obj,"Remote C4 (x2)",2,400,"CnC_POW_MineRemote_02"); // } //}; //ChatCommandRegistrant<KB_Purchase_Weap_MineRemote2> KB_Purchase_Weap_MineRemote2_Reg("!2motes;!2remotes;!2mineremotes",CHATTYPE_ALL,0,GAMEMODE_ALL); //class KB_Purchase_Weap_MineRemote8 : public ChatCommandClass //{ // void Triggered(int ID,const TokenClass &Text,int ChatType) // { // GameObject *obj = Get_GameObj(ID); // KB_Purchase_Pow_Weapon(obj,"Remote C4 (x8)",2,1600,"POW_MineRemote_Player"); // } //}; //ChatCommandRegistrant<KB_Purchase_Weap_MineRemote8> KB_Purchase_Weap_MineRemote8_Reg("!8motes;!8remotes;!8mineremotes",CHATTYPE_ALL,0,GAMEMODE_ALL); //class KB_Purchase_Weap_MineTimed : public ChatCommandClass //{ // void Triggered(int ID,const TokenClass &Text,int ChatType) // { // GameObject *obj = Get_GameObj(ID); // KB_Purchase_Pow_Weapon(obj,"Timed C4",2,300,"CnC_POW_MineTimed_Player_01"); // } //}; //ChatCommandRegistrant<KB_Purchase_Weap_MineTimed> KB_Purchase_Weap_MineTimed_Reg("!timed;!minetimed",CHATTYPE_ALL,0,GAMEMODE_ALL); //class KB_Purchase_Weap_MineTimed2 : public ChatCommandClass //{ // void Triggered(int ID,const TokenClass &Text,int ChatType) // { // GameObject *obj = Get_GameObj(ID); // KB_Purchase_Pow_Weapon(obj,"Timed C4 (x2)",2,600,"CnC_POW_MineTimed_Player_02"); // } //}; //ChatCommandRegistrant<KB_Purchase_Weap_MineTimed2> KB_Purchase_Weap_MineTimed2_Reg("!2timed;!2minetimed",CHATTYPE_ALL,0,GAMEMODE_ALL); //class KB_Purchase_Weap_MineTimed4 : public ChatCommandClass //{ // void Triggered(int ID,const TokenClass &Text,int ChatType) // { // GameObject *obj = Get_GameObj(ID); // KB_Purchase_Pow_Weapon(obj,"Timed C4 (x4)",2,1200,"POW_MineTimed_Player"); // } //}; //ChatCommandRegistrant<KB_Purchase_Weap_MineTimed4> KB_Purchase_Weap_MineTimed4_Reg("!4timed;!4minetimed",CHATTYPE_ALL,0,GAMEMODE_ALL); /*------------------O--------------------------------------------------------O | __ ___ .______ | VTACH | | | |/ / | _ \ O--------------------------------------------------------O | | ' / | |_) | | - List of the vtach commands | | | < | _ < | | | | . \ | |_) | | | | |__|\__\ |______/ | | | | | \-------------------O------------------------------------------------------*/ class KB_detach_command : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); GameObject *veh = Get_Vehicle(obj); if(Is_Script_Attached(veh,"KB_CarryAll")) { Commands->Attach_Script(veh,"KB_Detach",""); } } }; ChatCommandRegistrant<KB_detach_command> KB_detach_command_Reg("!detach",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_detach_Command : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); GameObject *veh = Get_Vehicle(obj); if (Is_VTOLVehicle(veh)) { if(Is_Script_Attached(veh,"KB_CarryAll")) { StringClass Msg; Msg.Format("ppage %d You have to detach first",ID); Console_Input(Msg); } else { Commands->Attach_Script(veh,"KB_CarryAll",""); } } } }; ChatCommandRegistrant<KB_detach_Command> KB_detach_Command_Reg("!vtach",CHATTYPE_ALL,0,GAMEMODE_ALL); class KB_ChatCommand : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); StringClass Msg; if(Is_Script_Attached(obj,"KB_Carrytest")) { Remove_Script(obj,"KB_Carrytest"); Msg.Format("ppage %d You allow people to attach your veh",ID); Console_Input(Msg); } else { Attach_Script_Once(obj,"KB_Carrytest",""); Msg.Format("ppage %d You refuse people to attach your vehicle",ID); Console_Input(Msg); } } }; ChatCommandRegistrant<KB_ChatCommand> KB_ChatCommandReg("!notach",CHATTYPE_ALL,0,GAMEMODE_ALL); to bad for me nothin works i guess i can start remaking everythin maybe ill get done one day...
It wouldnt take you that long to convert them to 4.0 ive got fk loads more than that do do and i did them in about 2 hours ish
yea i did it during electronics class was bring ass hell and converting was easy as soon as i found out how it took me longer then 2 hours tho