-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

Donavon
  • 323
  • 2
  • 6
  • 11

1 Answers1

0

Like you did in all the cases

add this to your code and it will work for you

Convert.ToUInt32(Splitter[1])
Mohit S
  • 13,723
  • 6
  • 34
  • 69