/Hug - Need a Warm Hug?

/Hug - Need a Warm Hug?

Postby Clowny » 14 Jul 2013, 18:48

I didn't spot a hug command here in the list so decided to post the one I was able to make, I tested it and it fully works this is my first command I've posted here :D
Code: Select all
//Created By Clowny
using System;
namespace MCDzienny
{
   public class CmdHug : Command
   {
      public override string name { get { return "hug"; } }
      public override string shortcut { get { return "hg"; } }
      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.Split(' ')[0]);
                      if (who == null)
        {
          Player.SendMessage(p, "Player is not online.");
          return;
     }
     else
          {
              Player.GlobalChat(p, p.color + p.name + Server.DefaultColor + " gave " + who.color + who.name + Server.DefaultColor + " a warm hug.", false);
            }

        }     
      
      public override void Help(Player p)
      {
         Player.SendMessage(p, "/hug - Gives Someone Nice Warm Hug");
      }
   }
}
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: /Hug - Need a Warm Hug?

Postby Breakdown901 » 14 Jul 2013, 19:09

Nice :)
Owner of:
Breakdown901 Lava Survival/Zombie Survival/Freebuild
Host of NeonGaming Lava Survival.
Breakdown901
 
Posts: 320
Joined: 24 May 2013, 12:54

Re: /Hug - Need a Warm Hug?

Postby ane200055 » 14 Jul 2013, 20:35

LOL, This is like /high5 but /hug instead..
Not bad. :)
Website: http://ane200055.co.vu
The Developer of The XtraIRC IRC Client: http://xtrairc.tk
C# coder.
User avatar
ane200055
 
Posts: 98
Joined: 30 Jun 2013, 09:07
Location: United Kingdom

Re: /Hug - Need a Warm Hug?

Postby Clowny » 14 Jul 2013, 20:40

Haha yeah that was the concept I was desperate to find out (high5) and I might even further it by adding more options such as /hug tight, /hug intimate and so on XD
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: /Hug - Need a Warm Hug?

Postby ane200055 » 14 Jul 2013, 20:43

Clowny wrote:Haha yeah that was the concept I was desperate to find out (high5) and I might even further it by adding more options such as /hug tight, /hug intimate and so on XD

/hug tight , That a good idea. :)
Website: http://ane200055.co.vu
The Developer of The XtraIRC IRC Client: http://xtrairc.tk
C# coder.
User avatar
ane200055
 
Posts: 98
Joined: 30 Jun 2013, 09:07
Location: United Kingdom

Re: /Hug - Need a Warm Hug?

Postby Clowny » 14 Jul 2013, 20:46

Yeah so then instead of (you) gave (player) a warm hug. I'd be something like (you) hugged (player) tightly, maybe a little too tightly...
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: /Hug - Need a Warm Hug?

Postby Clowny » 17 Jul 2013, 01:43

For lee or anyone willing to help... ok so this is what I have so far for the update but i'm having a little error...
Code: Select all
//Created By Clowny
using System;
namespace MCDzienny
{
   public class CmdHug : Command
   {
      public override string name { get { return "hug"; } }
      public override string shortcut { get { return "hg"; } }
      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.Split(' ')[0]);
                      if (who == null)
        {
          Player.SendMessage(p, "Player is not online.");
          return;
     }
     else
          {
              Player.GlobalChat(p, p.color + p.name + Server.DefaultColor + " gave " + who.color + who.name + Server.DefaultColor + " a warm hug.", false);
            }
            else if (message == "tight")
            {
             Player.GlobalMessage(p, p.color + p.name + Server.DefaultColor + " hugged " + who.color + who.name + Server.DefaultColor + " tightly, maybe a little too tightly...", false);
            }
        }

           public override void Help(Player p)
      {
         Player.SendMessage(p, "/hug - Gives Someone Nice Warm Hug");
      }
   }
}
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: /Hug - Need a Warm Hug?

Postby HETAL » 17 Jul 2013, 01:46

to quote something in a message you have to use \
YOU HAVENT SEEN THE LAST OF ME ISMELLIKE
HETAL
 
Posts: 397
Joined: 24 May 2013, 12:10

Re: /Hug - Need a Warm Hug?

Postby Clowny » 17 Jul 2013, 01:53

that has nothing to do with it... the problem was it was "else if" instead of just "if"
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: /Hug - Need a Warm Hug?

Postby Leeizazombie » 17 Jul 2013, 02:15

Clowny wrote:that has nothing to do with it... the problem was it was "else if" instead of just "if"

The problem is:
Code: Select all
  }
     else
          {
Remove it and see if it works.
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.

Next

Return to Custom Commands

Who is online

Users browsing this forum: No registered users and 5 guests