/cry4help

/cry4help

Postby keystirras » 04 Dec 2013, 05:54

Hello, This is the first command i have ever made, It wouldn't be possible if Leeisazombie didn't teach me! This is just a simple command, So please be nice :P
Code: Select all
using System;

namespace MCDzienny
{
    public class CmdCrying : Command
    {
        public override string name { get { return "cry4help"; } }

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

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

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

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

        public override void Use(Player p, string message)
      {
            Player.GlobalMessage(p.name + " is crying for help!!!");
            return;
      }
        public override void Help(Player p)
        {
            Player.SendMessage(p, "/cry4help - Use /cry4help for fun all it does is cry's for help!");
        }
    }
}
keystirras
 
Posts: 31
Joined: 13 Dec 2012, 06:03

Re: /cry4help

Postby Leeizazombie » 04 Dec 2013, 20:22

Well done, looks usefull is some ways!
Might I suggest you add the players color too: p.color, and then a color code like :%e so that the whole message isn't the players color.
So for example:
Code: Select all
Player.GlobalMessage(p.color + p.name + "%e is crying for help!!!");

Btw I'm not sure that you need to have the "return;"
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: /cry4help

Postby keystirras » 05 Dec 2013, 20:00

Code: Select all
using System;

namespace MCDzienny
{
    public class CmdCrying : Command
    {
        public override string name { get { return "cry4help"; } }

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

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

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

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

        public override void Use(Player p, string message)
      {
            Player.GlobalMessage(p.color + p.name + "%e is crying for help!!!");
            return;
      }
        public override void Help(Player p)
        {
            Player.SendMessage(p, "/cry4help - Use /cry4help for fun all it does is cry's for help!");
        }
    }
}

Thanks lee i updated it
keystirras
 
Posts: 31
Joined: 13 Dec 2012, 06:03

Re: /cry4help

Postby joppiesaus » 09 Dec 2013, 19:29

Nice! But "return" isn't needed cause it will end it automaticly.
joppiesaus
 
Posts: 379
Joined: 20 Aug 2012, 07:28
Location: in a obsedian house, with glass in it so i can see the lava!


Return to Custom Commands

Who is online

Users browsing this forum: No registered users and 5 guests

cron