/EnvColor [option] [RGB color format] | #CPE |

/EnvColor [option] [RGB color format] | #CPE |

Postby Leeizazombie » 26 Feb 2014, 20:54

Here it is, my first CPE command for MCDzienny! :)

You can change the map appearance on everyone's client (if they use ClassiCube).
Good thing I tested, or xWom clients would be crashing! :lol:
Syntax: /envcolor [sky, fog, light, shadow, cloud] [RGB Color Format]

What are RGB Colors? Take a look at this link: http://www.rapidtables.com/web/color/RGB_Color.htm, it will guide you in making colors!

Example, I want the sky to be black, so I would type /envcolor sky 0 0 0

This command will effect ALL CPE client users.

Code:
Code: Select all
using System;
using System.IO;

namespace MCDzienny
{
    public class CmdEnvColor : Command
    {
        public override string name { get { return "envcolor"; } }
        public override string shortcut { get { return "ecolor"; } }
        public override string type { get { return "mod"; } }
        public override bool museumUsable { get { return true; } }
        public override LevelPermission defaultRank { get { return LevelPermission.Operator; } }
        public override void Use(Player p, string message)
        {
            string option = message.Split(' ')[0];
            short red = Convert.ToInt16(message.Split(' ')[1]);
            short green = Convert.ToInt16(message.Split(' ')[2]);
            short blue = Convert.ToInt16(message.Split(' ')[3]);

            if (option == "sky")
            {
               
                foreach (Player pl in Player.players)
                {
                    if (pl.IsCpeSupported)
                    Cpe.V1.EnvSetColor(pl, 0, red, green, blue);
                }
                return;
            }

            if (option == "cloud")
            {

                foreach (Player pl in Player.players)
                {
                    if (pl.IsCpeSupported)
                    Cpe.V1.EnvSetColor(pl, 1, red, green, blue);
                }
                return;
            }

            if (option == "fog")
            {

                foreach (Player pl in Player.players)
                {
                    if (pl.IsCpeSupported)
                    Cpe.V1.EnvSetColor(pl, 2, red, green, blue);
                }
                return;
            }

            if (option == "shadow")
            {

                foreach (Player pl in Player.players)
                {
                    if (pl.IsCpeSupported)
                    Cpe.V1.EnvSetColor(pl, 3, red, green, blue);
                }
                return;
            }

            if (option == "sunlight")
            {

                foreach (Player pl in Player.players)
                {
                    if (pl.IsCpeSupported)
                        Cpe.V1.EnvSetColor(pl, 4, red, green, blue);
                }
                return;
            }
            else
                Player.SendMessage(p, "%cError: %7Please use valid options/colors. Refere to /help envcolor");
            return;
        }

        public override void Help(Player p)
        {
            Player.SendMessage(p, "/envcolor [option] [red, green, blue]");
            Player.SendMessage(p, "Options: sky, cloud, fog, shadow, sunlight.");
            Player.SendMessage(p, "Color: red: 0 - 255, green: 0 - 255, blue: 0 - 255");
        }
    }
}


| #CPE |..? :|
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: /EnvColor [option] [RGB color format] | #CPE |

Postby Leeizazombie » 26 Feb 2014, 22:05

Dzienny: Will 1.1.1.0 effect this command? If so can you fix this topic please?

NOTE: May not work due to yet another update :( . Please wait t'Ill fixed! (or approved of)
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: /EnvColor [option] [RGB color format] | #CPE |

Postby Leeizazombie » 26 Feb 2014, 22:13

Nevermind, it gave me no errors, the command should work, if not, please report the bug.
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: /EnvColor [option] [RGB color format] | #CPE |

Postby joppiesaus » 27 Feb 2014, 16:10

Ok awesome... But, what does it change? The color of the air?
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: /EnvColor [option] [RGB color format] | #CPE |

Postby Leeizazombie » 27 Feb 2014, 17:35

Yes, use ClassiCube and try it out with the latest update. :)
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: /EnvColor [option] [RGB color format] | #CPE |

Postby joppiesaus » 27 Feb 2014, 17:52

Leeizazombie wrote:Yes, use ClassiCube and try it out with the latest update. :)

Ok thanks!
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: /EnvColor [option] [RGB color format] | #CPE |

Postby dzienny » 28 Feb 2014, 02:14

You are quick. It's the first command that uses the new CPE API. And, it's nice <ok>

The command should work most of the time, but there are some things to improve:
Spoiler:
User avatar
dzienny
Administrator
 
Posts: 1181
Joined: 23 Jan 2011, 14:27

Re: /EnvColor [option] [RGB color format] | #CPE |

Postby HETAL » 28 Feb 2014, 02:32

Nice command and Nice Job :)
@dzienny MakeHackControl is coming out in the new ClassiCube update, will this be implemented into MCDzienny?
YOU HAVENT SEEN THE LAST OF ME ISMELLIKE
HETAL
 
Posts: 397
Joined: 24 May 2013, 12:10

Re: /EnvColor [option] [RGB color format] | #CPE |

Postby Leeizazombie » 28 Feb 2014, 03:01

Oh! I was wondering why I was having problems with the weather command I was making, when you have = 1, I replaced it with the Byte of the weather, and it wasn't working. :lol:
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 5 guests

cron