/mytime - [Updated] compare your time to others.

/mytime - [Updated] compare your time to others.

Postby Leeizazombie » 20 Feb 2014, 14:14

Hey, just thought this command could be more interesting with a new update! You can now compare your time to other players!
Here are some previews:

/mytime
Image

/mytime compare (If your hours are greater)
Image

/mytime compare (If your hours are less)
Image


Code:
Code: Select all
using System;

namespace MCDzienny
{
    public class Cmdmytime : Command
    {
        public override string name { get { return "mytime"; } }
        public override string shortcut { get { return "myt"; } }
        public override string type { get { return "other"; } }
        public override bool museumUsable { get { return true; } }
        public override LevelPermission defaultRank { get { return LevelPermission.Guest; } }

        public override void Use(Player p, string message)
        {
            int moretime;
            int p1hours = p.TotalMinutesPlayed / 60;
            int remainingmins = p.TotalMinutesPlayed % 60;
            string two = message.Split(' ')[0];
            if (two != "compare")
            {
                Player.SendMessage(p, "Your first login was: %f" + p.firstLogin.ToShortDateString());
                Player.SendMessage(p, "You've been logged in for: %f" + p.TotalMinutesPlayed + Server.DefaultColor + " minutes.");
                Player.SendMessage(p, "That's: %f" + p1hours + Server.DefaultColor + " hours and %f" + remainingmins + Server.DefaultColor + " minutes.");
               
                return;

            }
            Player who = Player.Find(message.Split(' ')[1]);
            if (two == "compare")
            {
                if (who != null)
                {
                    int p2hours = who.TotalMinutesPlayed / 60;
                    if (p2hours > p1hours)
                    {
                        moretime = p2hours - p1hours;
                        Player.SendMessage(p, "It seems that " + who.color + who.PublicName + Server.DefaultColor + " has spent %7" + moretime + Server.DefaultColor + " hours more than you on the server.");
                        return;
                    }
                    else
                    {
                        moretime = p1hours - p2hours;
                        Player.SendMessage(p, "You have been online %7 " + moretime + Server.DefaultColor + " hours longer than " + who.color + who.PublicName);
                        return;
                    }
                }
                else
                    Player.SendMessage(p, "That player is not online");
                return;
               
            }
        }

        public override void Help(Player p)
        {
            Player.SendMessage(p, "/mytime - Display how long you have been on this server.");
        }
    }
}



Older Version:

Spoiler:
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: /mytime - Display how long you were on the server.

Postby asdfmovie2121 » 21 Feb 2014, 23:23

Thanks it works perfect and with no errors :)
Owner of DeadIsland Survival[New]
asdfmovie2121
 
Posts: 26
Joined: 29 Dec 2012, 13:18

Re: /mytime - Display how long you were on the server.

Postby Leeizazombie » 22 Feb 2014, 13:56

asdfmovie2121 wrote:Thanks it works perfect and with no errors :)

Anytime ;)
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: /mytime - Display how long you were on the server.

Postby _Retaliate_ » 23 Feb 2014, 17:11

Lol, I know where you got your inspiration from.
Image
_Retaliate_
 
Posts: 68
Joined: 26 Sep 2013, 11:16

Re: /mytime - [Updated] compare your time to others.

Postby Leeizazombie » 22 Mar 2014, 15:24

Updated :!:
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 3 guests