/faketnt command

/faketnt command

Postby Lmfao » 17 Jul 2013, 01:53

Code: Select all
Created by Lmfao

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
//using System.IO;
//using System.Threading;
     
namespace MCDzienny
{
    public class Cmdfaketnt : Command
    {

      public override string name { get { return "faketnt"; } }

        public override string shortcut { get { return "fake"; } }

        public override string type { get { return "other"; } }

        public override bool museumUsable { get { return false; } }

        public override LevelPermission defaultRank { get { return LevelPermission.operator; } }

        public Cmdfaketnt() { }
Player who = Player.Find( myString);

Player.GlobalMessage("myString Exploded to Bits");
        {

        {
            Player.SendMessage(p, "/faketnt - fake explodes player ");
        }
    }
}
       
User avatar
Lmfao
 
Posts: 11
Joined: 16 Jul 2013, 23:07

Re: /faketnt command

Postby Lmfao » 17 Jul 2013, 01:55

did i do something wrong :?:
User avatar
Lmfao
 
Posts: 11
Joined: 16 Jul 2013, 23:07

Re: /faketnt command

Postby Leeizazombie » 17 Jul 2013, 02:06

Try this:
Code: Select all
Player who = Player.Find(message);

Player.GlobalMessage(who.PublicName + " Exploded to Bits");
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: /faketnt command

Postby Clowny » 17 Jul 2013, 02:10

First off I suggest you post these in "help in coding" section first instead of here because since you're just starting you're getting many errors. Post it here when you're pretty sure its all good. First off "Created by Lmfao" needs to have // so it's not read by the system and you're using way too many things for your system. The only one you need for this one is using System; I believe and why do you have // on 2 of them? lastly this;
Code: Select all
      public override string name { get { return "faketnt"; } }

        public override string shortcut { get { return "fake"; } }

        public override string type { get { return "other"; } }

        public override bool museumUsable { get { return false; } }

        public override LevelPermission defaultRank { get { return LevelPermission.operator; } }

should be together no space.
I'm sorry but there's a lot of mistakes in my opinion I'll let someone else help
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: /faketnt command

Postby Clowny » 17 Jul 2013, 02:11

Leeizazombie wrote:Try this:
Code: Select all
Player who = Player.Find(message);

Player.GlobalMessage(who.PublicName + " Exploded to Bits");

and what lee said...
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: /faketnt command

Postby joppiesaus » 17 Jul 2013, 09:23

This wont work at all.
There is no overriding use or help method at all.
You could do whatever you want, but it wont work.

Copy your code, generate a new skeleton class(or use Ismellike's CodeR), and put everything in the "Use" method.

I'll explain:
The "Use" method will be called by the server if someone uses it.
There is no "Use" method, so nothing can be called. Everything is just defined from each other right now. So nothing will work.

EDIT: And also there are many compiler errors. That text at the top of the code "Created by LMFAO" will give lots of errors. If you put // before it, the compiler
will see it as a comment, and it will be ignored. I suggest that you look in the help section or something. You don't really know how to code.
joppiesaus
 
Posts: 379
Joined: 20 Aug 2012, 07:28
Location: in a obsedian house, with glass in it so i can see the lava!

Re: /faketnt command

Postby Breakdown901 » 17 Jul 2013, 17:40

Ok, here is a working version of /faketnt.

Code: Select all
//Created by Lmfao
//Edited by Breakdown901
using System;
namespace MCDzienny
{
   public class CmdFaketnt : Command
   {
      public override string name { get { return "faketnt"; } }
      public override string shortcut { get { return "ft"; } }
      public override string type { get { return "other"; } }
      public override bool museumUsable { get { return false; } }
      public override LevelPermission defaultRank { get { return LevelPermission.Operator; } }
      public override void Use(Player p, string message)
      {
         if (message == "") { Help(p); return; }

                Player who = Player.Find(message);

                if (who == null)
                {
                    Player.SendMessage(p, "Player not found!");
                    return;
                }

                else
            {
               Player.GlobalMessage(who.color + who.PublicName + Server.DefaultColor + " was &cblown up!");
            }
            if (message == "me")
            {
               Player.GlobalMessage(p, p.name + Server.DefaultColor + " was &cblown up!");
            }
         }

      
      public override void Help(Player p)
      {
         Player.SendMessage(p, "/faketnt - /faketnt [player] - Fakes blowing up a player");
         Player.SendMessage(p, "/faketnt me - Fakes blowing up yourself.");
      }
   }
}
Owner of:
Breakdown901 Lava Survival/Zombie Survival/Freebuild
Host of NeonGaming Lava Survival.
Breakdown901
 
Posts: 320
Joined: 24 May 2013, 12:54

Re: /faketnt command

Postby Warren1001 » 18 Jul 2013, 23:52

Code: Select all
// Created by Lmfao
using System;
namespace MCDzienny
{
    public class CmdFaketnt : Command
    {
        public override string name { get { return "faketnt"; } }
        public override string shortcut { get { return "fake"; } }
        public override string type { get { return "other"; } }
        public override bool museumUsable { get { return false; } }
        public override LevelPermission defaultRank { get { return LevelPermission.Operator; } }
        public override void Use(Player p, string message)
        {
            if (message == null)
            {
                Help(p);
                return;
            }
            Player who = Player.Find(message);
            if (who == null || who.hidden)
            {
                Player.SendMessage(p, "Player could not be found.");
                return;
            }
            Player.GlobalMessage(who.color + who.PublicName + " &swas exploded to bits.");
        }
        public override void Help(Player p)
        {
            Player.SendMessage(p, "/faketnt - fake explodes a player. ");
        }
    }
}
Warren1001
 
Posts: 197
Joined: 08 Aug 2012, 03:50


Return to Custom Commands

Who is online

Users browsing this forum: No registered users and 4 guests

cron