[SSGM 4.0 Plugn] Kill Harvester Console Commands [message #461506] |
Tue, 10 January 2012 09:48 |
iRANian
Messages: 4308 Registered: April 2011
Karma: 0
|
General (4 Stars) |
|
|
This simple plugin adds two console commands to the FDS to allow for destroying both teams' harvester.
killharvgdi ;Destroys the GDI harvester.
killharvnod ;Destroys the Nod harvester.
You can contact me by PM'ing me on renegadeforums.com under the name "iRANian" or on the usual IRC servers under the nick "Iran".
Long time and well respected Renegade community member, programmer, modder and tester.
Scripts 4.0 private beta tester since May 2011.
My Renegade server plugins releases
[Updated on: Mon, 02 July 2012 06:44] Report message to a moderator
|
|
|
|
|
|
|
Re: [SSGM 4.0 Plugn] Kill Harvester Console Commands [message #463589 is a reply to message #461774] |
Sun, 04 March 2012 13:19 |
|
Creed3020
Messages: 1438 Registered: February 2003 Location: Toronto, Canada
Karma: 0
|
General (1 Star) |
|
|
Ethenal wrote on Mon, 16 January 2012 16:24 | This is actually quite useful; n00bstories has an internet interface on which you can blow up any of a team's vehicles, including the harvester. This has its uses in certain situations, such as when two days ago I was playing Under on Jelly Marathon and somebody got the GDI harv stuck on a rock in the tib field. As a result, even after several minutes of pushing it around with vehicles, it still came back to the rock and we had no credits coming in (we were holding Nod back inside their base at the time, so they weren't about to do anything to it). Quite an annoying bug, and this would be the perfect fix.
|
The scenario you described is exactly why we have this ability to blow up the harvester.
Nice work iRANian, this is a useful set of commands for the whole community.
|
|
|
Re: [SSGM 4.0 Plugn] Kill Harvester Console Commands [message #463590 is a reply to message #461506] |
Sun, 04 March 2012 13:43 |
iRANian
Messages: 4308 Registered: April 2011
Karma: 0
|
General (4 Stars) |
|
|
The actual programming part of this simple plugin only took 2 minutes and involved copy pasting functions around that I've used for the Reset Match (!ready command used by cw.cc) plugin and another plugin that added console commands. Actually getting a new plugin started (you need to follow a lot of steps to create a new plugin coding project) and writing the readme took around 15 minutes.
It's quite amazing how easily some of these issues are to fix, I wrote a beacon deploy sound spamming plugin in 20 minutes of actual programming, and I'm intending to release it after it's been tested (it does some fancy stuff with timers to reset a counter), 45 minutes total to detect a really annoying exploit.
Long time and well respected Renegade community member, programmer, modder and tester.
Scripts 4.0 private beta tester since May 2011.
My Renegade server plugins releases
|
|
|
|
|
Re: [SSGM 4.0 Plugn] Kill Harvester Console Commands [message #489025 is a reply to message #461506] |
Fri, 15 August 2014 20:10 |
|
Gen_Blacky
Messages: 3250 Registered: September 2006
Karma: 1
|
General (3 Stars) |
|
|
Someone make this man a plugin from these example commands please.
class CommandKILLVEHICLES :
public ConsoleFunctionClass
{
public:
const char* Get_Name()
{
return "killvehicles";
}
const char* Get_Help()
{
return "KILLVEHICLES - Destroys all vehicles.";
}
void Activate(const char* argumentsString)
{
int count = 0;
for (SLNode<VehicleGameObj> *x = GameObjManager::VehicleGameObjList.Head();x;x = x->Next())
{
VehicleGameObj *veh = x->Data();
Vector3 pos = Commands->Get_Position(veh);
if ( Functions::IsTank_Obj(veh) )
{
Commands->Destroy_Object(veh);
Commands->Create_Explosion("Explosion_with_Debris_small",pos,veh);
count++;
}
}
if ( count >= 1 )
{
Console_Output("[BB] All Vehicle's Destroyed.\n");
}
}
};
class CommandKILLVEHICLE :
public ConsoleFunctionClass
{
public:
const char* Get_Name()
{
return "killvehicle";
}
const char* Get_Help()
{
return "KILLVEHICLE <clientId> - Destroy a player's vehicle.";
}
void Activate(const char* argumentsString)
{
CommandLineParser arguments(argumentsString);
const char* clientIdentifier = arguments.getString();
if (!clientIdentifier || clientIdentifier[0] == '\0')
Console_Output("Please enter a client identifier.");
else
{
const int clientId = getClientIdByIdentifier(clientIdentifier);
if (!isClientId(clientId))
{
Console_Output("Please enter a valid client identifier.");
}
else
{
int killtype = arguments.getInt();
GameObject *obj = Get_GameObj(clientId);
GameObject *Veh = Get_Vehicle(obj);
Vector3 pos = Commands->Get_Position(obj);
if (Veh)
{
if (Get_Vehicle_Driver(Veh) == obj)
{
if (killtype == 1)
{
Commands->Apply_Damage(Veh,99999.0f,"BlamoKiller",0);
}
else
{
Commands->Destroy_Object(Veh);
Commands->Create_Explosion("Explosion_with_Debris_small",pos,obj);
}
Console_Output("[BB] Player's Vehicle Destroyed.\n");
}
}
}
}
}
};
class CommandKILL :
public ConsoleFunctionClass
{
public:
const char* Get_Name()
{
return "Kill";
}
const char* Get_Help()
{
return "KILL <clientId> <killtype> - Kills the player's character (if they're driving a vehicle it will kill that too).";
}
void Activate(const char* argumentsString)
{
CommandLineParser arguments(argumentsString);
const char* clientIdentifier = arguments.getString();
if (!clientIdentifier || clientIdentifier[0] == '\0')
Console_Output("Please enter a client identifier.");
else
{
const int clientId = getClientIdByIdentifier(clientIdentifier);
if (!isClientId(clientId))
{
Console_Output("Please enter a valid client identifier.");
}
else
{
int killtype = arguments.getInt();
GameObject *obj = Get_GameObj(clientId);
GameObject *Veh = Get_Vehicle(obj);
Vector3 pos = Commands->Get_Position(obj);
if (Veh)
{
if (Get_Vehicle_Driver(Veh) == obj)
{
Commands->Destroy_Object(obj);
Commands->Destroy_Object(Veh);
Commands->Create_Explosion("Explosion_with_Debris_small",pos,obj);
}
}
if (PData[clientId]->Spectating == true)
{
Console_Output("[BB] Player %ls cannot be killed while in spectate mode. Use !spectate command.\n",Get_Wide_Player_Name(Get_GameObj(clientId)));
return;
}
if ( obj )
{
if(!killtype)
{
Commands->Apply_Damage(obj,99999.0f,"BlamoKiller",obj);
Console_Output("Player has killed theirself.");
Commands->Create_2D_WAV_Sound("humiliation.wav");
}
else if(killtype == 1)
{
Commands->Destroy_Object(obj);
Console_Output("[BB] Player has been killed silently.");
}
else if(killtype == 2)
{
Commands->Destroy_Object(obj);
Set_Deaths(clientId, Get_Deaths(clientId) - 1);
Console_Output("[BB] Player has been killed silently no death.");
}
else
{
Commands->Apply_Damage(obj,99999.0f,"BlamoKiller",0);
Console_Output("Player has been killed.");
}
}
}
}
}
};
class CommandKILLHARV :
public ConsoleFunctionClass
{
public:
const char* Get_Name()
{
return "killharv";
}
const char* Get_Help()
{
return "KILLHARV <team> - Destroy a team harvester.";
}
void Activate(const char* argumentsString)
{
StringClass OriginalString = argumentsString;
CommandLineParser arguments(argumentsString);
int team = arguments.getInt();
if ( !team )
{
Console_Output("Please enter a valid team ID.\n");
}
else
{
Functions::Kill_Harvester(team);
}
}
};
void Functions::Kill_Harvester(int Team)
{
SLNode<SmartGameObj> *x = GameObjManager::SmartGameObjList.Head();
while (x)
{
GameObject *o = x->Data();
if (o)
{
if (o->As_VehicleGameObj())
{
int TeamType = Commands->Get_Player_Type(o);
if (TeamType == Team)
{
if (Is_Harvester(o) || Is_Harvester_Preset(o))
{
Commands->Destroy_Object(o);
//Commands->Apply_Damage(o,99999,"Death",0);
}
}
}
}
x = x->Next();
}
}
[Updated on: Fri, 15 August 2014 20:10] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|