Author Topic: Admin Slay  (Read 4170 times)

Every server HAS to have a handicap that wont go away, Now I know you can /fetch and ban and kick and all that, But, Why not make a /command(Like /Slay (Persons name) that kills a Player?

I just think it will be useful and fun.

lmao @ gmod ulyesses mod

Code: [Select]
function serverCmdSlay(%client,%victim)
{
     for(%i = 0; %i < ClientGroup.getCount(); %i++)
          {
           %cl = ClientGroup.getObject(%i);
           if(%victim $= %cl.name)
                {
                 %cl.kill();
                 }
          }
}
(Untested)

I made one but it uses the ID and i dont know if the messageall things right.

Oh wait. I Dont have it on this computer.

Code: [Select]
function serverCmdSlay(%client,%victim)
{
     for(%i = 0; %i < ClientGroup.getCount(); %i++)
          {
           %cl = ClientGroup.getObject(%i);
           if(%victim $= %cl.name)
                {
                 %cl.kill();
                 }
          }
}
(Untested)

YYyyeeaahh... About that, What do I do with the code?

open notepad, paste it, save it as kill.cs, save it to Blockland/Add Ons, enable it when you start up a server

Ok, I got it working. I checked it in Addons, But how do I make it work?

Type in /slay and the name of your victim.

E.g, /slay Gmp

The reason why Badspot didn't include this abusive piece of crap is because it is an abusive piece of crap :D

Oh wait, GMP's code won't work. You need to kill the client's player.

Code: [Select]
function serverCmdSlay(%client, %victim)
{
   if(%victim $= "")
  {
      messageClient(%client, "", "\c0One or more of the required fields has been left blank.");
      return;
   }

   for(%i = 0; %i < ClientGroup.getCount(); %i++)
   {
      %cl = ClientGroup.getObject(%i);
      if(%cl.name $= %victim && isObject(%cl.player))
      {
          %cl.player.kill();
           break;
      }
}

That's no admin kill, there's no admin check in it...

I would help but i'm not going to :)

Code: [Select]
function serverCmdSlay(%client, %victim)
{
   if(!%client.isAdmin || !%client.isSuperAdmin)
   return;
   if(%victim $= "")
  {
      messageClient(%client, "", "\c0One or more of the required fields has been left blank.");
      return;
   }

   for(%i = 0; %i < ClientGroup.getCount(); %i++)
   {
      %cl = ClientGroup.getObject(%i);
      if(%cl.name $= %victim && isObject(%cl.player))
      {
          %cl.player.kill();
           break;
      }
}

I think thats right.
« Last Edit: June 26, 2007, 11:09:25 AM by MrPickel »

Code: [Select]
function serverCmdSlay(%client, %victim)
{
if(%client.isSuper) {
   if(%victim $= "")
  {
      messageClient(%client, "", "\c0One or more of the required fields has been left blank.");
      return;
   }

   for(%i = 0; %i < ClientGroup.getCount(); %i++)
   {
      %cl = ClientGroup.getObject(%i);
      if(%cl.name $= %victim && isObject(%cl.player))
      {
          %cl.player.kill();
           break;
      }
}
}
Super only so admins who get adminship from just needing to load a build can't abuse it if the super (if there is one) has to go or something.

Code: [Select]
function serverCmdSlay(%client, %victim)
{
if(%client.isSuperAdmin) {
   if(%victim $= "")
  {
      messageClient(%client, "", "\c0One or more of the required fields has been left blank.");
      return;
   }

   for(%i = 0; %i < ClientGroup.getCount(); %i++)
   {
      %cl = ClientGroup.getObject(%i);
      if(%cl.name $= %victim && isObject(%cl.player))
      {
          %cl.player.kill();
           break;
      }
}
}
Super only so admins who get adminship from just needing to load a build can't abuse it if the super (if there is one) has to go or something.
It's %client.isSuperAdmin, not %client.isSuper