/kickgriefer, /kb

/kickgriefer, /kb

Postby Leeizazombie » 16 Jul 2013, 04:58

So, I made this so that you don't have to manualy use each command one by one, this command will do it all, and tell everyone who the griefer is, it will make the player spawn, frozen and xundone his/her work, then kicked :) I hope it helps, enjoy!
Code: Select all
using System;
using System.Threading;

namespace MCDzienny
{
   public class Cmdkg : Command
   {
      public override string name { get { return "kickgriefer"; } }
      public override string shortcut { get { return "kg"; } }
      public override string type { get { return "mod"; } }
      public override bool museumUsable { get { return true; } }
      public override LevelPermission defaultRank { get { return LevelPermission.Operator; } }
      public override void Use(Player p, string message)
        {
            if (String.IsNullOrEmpty(message) || message.IndexOf(' ') != -1) { Help(p); return; }

            Player who = Player.Find(message);

            if (who == null)
            {
                Player.SendMessage(p, "Player could not be found.");
                return;
            }
            {
                Player.GlobalMessage("&cGriefer detected!!! --->" + " " + who.color + who.PublicName + "&c");
                Command.all.Find("spawn").Use(who, "");
                Command.all.Find("freeze").Use(p, who.PublicName);
                Player.SendMessage(who, "&cyou should not of griefed, now everything you done will be undone");
                Thread.Sleep(3000);
                Command.all.Find("xundo").Use(null, who.PublicName);
                Thread.Sleep(2000);
                Command.all.Find("kick").Use(p, who.PublicName);
               
               

            }
        }
      public override void Help(Player p)
      {
         Player.SendMessage(p, "/kickgriefer - Does all the neccesssary commands to undo the griefer and kick.  /kg <player>");
      }
   }
}
Owner of:
LeeIzaZombie Freebuild and Lava Survival V2 (Shut Down and updated)
LeeIzaZombie Survival (Comming back soon)

Contact:
Skype: leeizazombie
IRC: irc.geekshed.net, #leeizazombie, #mcclassichosting
User avatar
Leeizazombie
 
Posts: 536
Joined: 10 Jun 2013, 17:45
Location: Ireland.

Re: /kickgriefer, /kb

Postby Clowny » 16 Jul 2013, 06:22

Nice I like the idea how it announces player waits a bit and then kicks the player <ok>
Founder Of MC Classic Hosting Community http://mcclassichosting.webs.com
Founder of MC Classic Software MCReborn http://mcreborn.tk
Professional Hoster and Basic C# Coder
Image
User avatar
Clowny
 
Posts: 112
Joined: 14 Jul 2013, 03:53

Re: /kickgriefer, /kb

Postby tinyCreeper » 16 Jul 2013, 06:52

You know you don't have to add the [space] separately

For instance:
Code: Select all
Player.GlobalMessage("&cGriefer detected!!! --->" + " " + who.color + who.PublicName + "&c");

Could be written as:
Code: Select all
Player.GlobalMessage("&cGriefer detected!!! ---> " + who.color + who.PublicName + "&c");


Also, I'm not sure why the &c is there at the end. Maybe I'm missing something.
But other than that, it is a great command!
tinyCreeper
 
Posts: 48
Joined: 05 Jul 2013, 12:21

Re: /kickgriefer, /kb

Postby Leeizazombie » 16 Jul 2013, 07:29

The space is neccessary because otherwise it will look like:
Griefer detected!!! --->name
it could be the way I have it:
Griefer detected!!! ---> name

&c is the color code for red, in-game we use %c, but in coding it is &c.
and thank you :)
Owner of:
LeeIzaZombie Freebuild and Lava Survival V2 (Shut Down and updated)
LeeIzaZombie Survival (Comming back soon)

Contact:
Skype: leeizazombie
IRC: irc.geekshed.net, #leeizazombie, #mcclassichosting
User avatar
Leeizazombie
 
Posts: 536
Joined: 10 Jun 2013, 17:45
Location: Ireland.

Re: /kickgriefer, /kb

Postby tinyCreeper » 16 Jul 2013, 07:35

No the way I adjusted it, I just simply put the space in the other quotation so it saves you from have an extra

'+ " " +'

And yes I know that is the color code but why do you have an extra one at the end of the line like that?
tinyCreeper
 
Posts: 48
Joined: 05 Jul 2013, 12:21

Re: /kickgriefer, /kb

Postby Leeizazombie » 16 Jul 2013, 08:04

tinyCreeper wrote:No the way I adjusted it, I just simply put the space in the other quotation so it saves you from have an extra

'+ " " +'

And yes I know that is the color code but why do you have an extra one at the end of the line like that?

Oh, well I was gonna use it for something extra, but I left it
Owner of:
LeeIzaZombie Freebuild and Lava Survival V2 (Shut Down and updated)
LeeIzaZombie Survival (Comming back soon)

Contact:
Skype: leeizazombie
IRC: irc.geekshed.net, #leeizazombie, #mcclassichosting
User avatar
Leeizazombie
 
Posts: 536
Joined: 10 Jun 2013, 17:45
Location: Ireland.

Re: /kickgriefer, /kb

Postby Leeizazombie » 16 Jul 2013, 14:05

I misspelled my topic header, can someone change /kb to /kg?
Owner of:
LeeIzaZombie Freebuild and Lava Survival V2 (Shut Down and updated)
LeeIzaZombie Survival (Comming back soon)

Contact:
Skype: leeizazombie
IRC: irc.geekshed.net, #leeizazombie, #mcclassichosting
User avatar
Leeizazombie
 
Posts: 536
Joined: 10 Jun 2013, 17:45
Location: Ireland.

Re: /kickgriefer, /kb

Postby HETAL » 16 Jul 2013, 14:36

I prefer ismellikes automatic antigrief system viewtopic.php?f=19&t=2042
YOU HAVENT SEEN THE LAST OF ME ISMELLIKE
HETAL
 
Posts: 397
Joined: 24 May 2013, 12:10

Re: /kickgriefer, /kb

Postby Leeizazombie » 16 Jul 2013, 14:45

HETAL wrote:I prefer ismellikes automatic antigrief system viewtopic.php?f=19&t=2042

just trying to get coding experience
Owner of:
LeeIzaZombie Freebuild and Lava Survival V2 (Shut Down and updated)
LeeIzaZombie Survival (Comming back soon)

Contact:
Skype: leeizazombie
IRC: irc.geekshed.net, #leeizazombie, #mcclassichosting
User avatar
Leeizazombie
 
Posts: 536
Joined: 10 Jun 2013, 17:45
Location: Ireland.


Return to Custom Commands

Who is online

Users browsing this forum: No registered users and 3 guests

cron