/autokick add [player] V1

/autokick add [player] V1

Postby Leeizazombie » 20 Dec 2013, 15:27

If you have had any ban evaders on your server rejoining with the same account, then this is the command for you!
WARNING: There's a fault with this version, and if anyone can help I would be much appreciated!
Fault: if add a player called "cheese" for example, any player called "c" or "che" or "chees" ect.. will be kicked however the likes of "cheeset" or "chet" ect.. would be safe.
Coders: I have unfinished work that I'm having problems with and you can finish if you want, they are inside the /* */.

I hope y'all like it! <ok>

Code: Select all
using System;
using System.IO;

namespace MCDzienny
{
   public class CmdAkick : Command
   {
      public override string name { get { return "autokick"; } }
      public override string shortcut { get { return "akick"; } }
      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 Init()
        {

            Player.Joined += (object sender, PlayerEventArgs e) =>
            {
                string list = File.ReadAllText("autokick.txt");
                if (list.Contains(e.Player.name))
                {
                    e.Player.Kick("Auto-Kick: You've been added to an AutoKick system.");
                }
            };
              }
       
        public override void Use(Player p, string message)
        {

            string third = message.Split(' ')[1];
            string second = message.Split(' ')[0];

            if (message == " ")
            {
                Help(p);
                return;
            }

            if (second == "add")
            {
                if (third == "")
                {
                    Player.SendMessage(p, third + "Please Specify a players name!");
                }

                if (!File.Exists("autokick.txt"))
                {
                    File.Create("autokick.txt");
                }

                File.AppendAllText("autokick.txt", third + ", ");
                Player.SendMessage(p, "%f" + third + " %eis now in the Auto Kick List!");
            }

            /* if (second == "list")
             {
                 Player.SendMessage(p, "%cAuto Kick List%f: ");
                 foreach (string list in File.ReadAllLines("autokick.txt"))
                 {
                         Player.SendMessage(p, list);
                 }
             }*/

           /* if (second == "remove")
            {
                if (third == "")
                {

                }

               
            }*/
        }

      public override void Help(Player p)
      {
         Player.SendMessage(p, "/autokick add [player] - Auto kicks players you've added becuase they ban evade.");
      }
   }
}
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: /autokick add [player] V1

Postby HelloWorldCool » 21 Dec 2013, 00:05

Good Stuff but...doesn't this command function just like /ban [player]? :P
Download fCraft maps! - viewtopic.php?f=25&t=3012!



Note: The Developer(s) of MCDzienny have resigned and the software is no longer supported.
Errors are bound to occur and Mojang has not attempted to resolve them.
User avatar
HelloWorldCool
 
Posts: 867
Joined: 18 Oct 2011, 00:19
Location: MCDzienny Forums, HelloWorldCool Forums

Re: /autokick add [player] V1

Postby Leeizazombie » 21 Dec 2013, 02:46

HelloWorldCool wrote:Good Stuff but...doesn't this command function just like /ban [player]? :P

Like I said, the command is for "ban" evaders, people that mask their IP address allowing them to join the server because the IP is not blocked, but they join in as the ranked "banned" but they can just keep joining and spamming ect..
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 7 guests

cron