How do I use CPE options? (I have attempt code)

How do I use CPE options? (I have attempt code)

Postby Leeizazombie » 25 Feb 2014, 21:53

I tried to make a test command:

using System;
using System.IO;
using MCDzienny.Cpe;

namespace MCDzienny
{
public class CmdWeather : Command
{
public override string name { get { return "weather"; } }
public override string shortcut { get { return ""; } }
public override string type { get { return "information"; } }
public override bool museumUsable { get { return true; } }
public override LevelPermission defaultRank { get { return LevelPermission.Guest; } }
byte sun = 0;
byte rain = 1;
byte snow = 2;
public override void Use(Player p, string message)
{

if (message == "sun")
{
p.Cpe.EnvWeatherType = 0;
return;
}
if (message == "rain")
{
p.Cpe.EnvWeatherType = 1;
return;
}
if (message == "snow")
{
p.Cpe.EnvWeatherType = 2;
return;
}
else
Player.SendMessage(p, "Please enter a valid weather type. (sun, rain, snow)");

}

public override void Help(Player p)
{
Player.SendMessage(p, "/weather - Change your weather (CPE ONLY)");
}
}
}


I read http://wiki.vg/Classic_Protocol_Extension#EnvWeatherType to find out the byte's for the weather, but it doesn't effect the weather, what am I doing wrong?
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: How do I use CPE options? (I have attempt code)

Postby dzienny » 26 Feb 2014, 10:31

I guess you know the answer by now. It's described in the KB document.
User avatar
dzienny
Administrator
 
Posts: 1181
Joined: 23 Jan 2011, 14:27


Return to Help in Coding

Who is online

Users browsing this forum: No registered users and 1 guest

cron