/fart command

/fart command

Postby Lmfao » 16 Jul 2013, 23:14

Code: Select all
// Created by Lmfao / Lmfao605914

using System;
using System.IO;
using System.Threading;
     
namespace MCDzienny
{
    public class CmdFart : Command
    {
        public override string name { get { return "Fart"; } }
        public override string shortcut { get { return "fart"; } }
        public override string type { get { return "other"; } }
        public override bool museumUsable { get { return false; } }
        public override LevelPermission defaultRank { get { return LevelPermission.Guest; } }
        public CmdFart() { }
        public override void Use(Player p, string message)
        {
            Player .SendMessage(p, "Someone Farted in ur face");
        }

        public override void Help(Player p)
        {
            Player.SendMessage(p, "/help fart - give the player a fart message ");
        }
    }
}
User avatar
Lmfao
 
Posts: 11
Joined: 16 Jul 2013, 23:07

Re: /fart command

Postby Lmfao » 16 Jul 2013, 23:15

Is this right :?:
User avatar
Lmfao
 
Posts: 11
Joined: 16 Jul 2013, 23:07

Re: /fart command

Postby Lmfao » 16 Jul 2013, 23:16

should i add something
User avatar
Lmfao
 
Posts: 11
Joined: 16 Jul 2013, 23:07

Re: /fart command

Postby ismellike » 16 Jul 2013, 23:30

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

You're not supposed to have capital letters.
Other than that it should work, maybe take the return "fart" out for the shortcut.
What a beast...
User avatar
ismellike
Coder
 
Posts: 731
Joined: 31 Oct 2012, 04:04
Location: Kansas

Re: /fart command

Postby Lmfao » 16 Jul 2013, 23:31

thx
User avatar
Lmfao
 
Posts: 11
Joined: 16 Jul 2013, 23:07

Re: /fart command

Postby Clowny » 16 Jul 2013, 23:58

I'm guessing this is one of your first commands and you're beginning to code if so welcome to the family haha I've seen /fart before but not bad, a little tip for now, you don't always need to have a shortcut you can always just leave it blank, don't have it as the same thing as actual command.
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: /fart command

Postby Leeizazombie » 17 Jul 2013, 01:16

May I point out that there is a space in your code:
Code: Select all
Player .SendMessage(p, "Someone Farted in ur face");

In between Player and .SendMessage, I'm not sure if there should be
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: /fart command

Postby Warren1001 » 17 Jul 2013, 01:38

No space between Player .SendMessage, the public command thing isn't needed. You don't need using System.IO; or using System.Threading.
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