-2

I am messing around with a source for a game I play, and I'm making an in game command, but I've ran into a problem.

public enum WeatherType
{
    None = 1,
    Rain = 2,
    Snow = 3,
    RainWind = 4,
    AutumnLeaves = 5,
    CherryBlossomPetals = 7,
    CherryBlossomPetalsWind = 8,
    BlowingCotten = 9,
    Atoms = 10
}     

GC.MyClient.SendPacket(General.MyPackets.Weather(Splitter[1], Convert.ToUInt32(Splitter[2]), Convert.ToUInt32(Splitter[3]), Convert.ToUInt32(Splitter[4])));

The error is on Splitter[1], it says "cannot convert string to WeatherType". Does anyone know how to fix this? Cause I'm really stumped. Thanks

2
  • You have to Type cast it to WeatherType in this case. Commented Aug 17, 2015 at 3:34
  • It may be helpful to show us what Splitter contains, and what General.MyPackets.Weather expects/does Commented Aug 17, 2015 at 3:34

1 Answer 1

0

Like you did in all the cases

add this to your code and it will work for you

Convert.ToUInt32(Splitter[1])
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.