[Question]problem with a comand

05/26/2011 06:10 thesamuraivega#1
Hi
I create my commands
I have problem here:

Code:
ushort _screen;
          _screen = ushort.Parse(Data[1]);                                          client.Entity.AddFlag(Network.GamePackets.Update.Flags.[COLOR="Red"]([/COLOR]uint.Parse(Data[1])));
:confused: why?

and in this npc have error:

Code:
                                        case 1:
                                            {
                                                if (client.Inventory.Contains(711214, 1) && client.Inventory.Contains(711215, 1) && client.Inventory.Contains(711216, 1) && client.Inventory.Contains(711217, 1) && client.Inventory.Contains(711218, 1) && client.Inventory.Contains(711219, 1) && client.Inventory.Contains(711220, 1))
                                                {
                                                    client.Inventory.Remove(711214, 1);
                                                    client.Inventory.Remove(721255, 1);
                                                    client.Inventory.Remove(721256, 1);
                                                    client.Inventory.Remove(721257, 1);
                                                    client.Inventory.Remove(721258, 1);
                                                    client.Inventory.Remove(721259, 1);
                                                    client.Inventory.Remove(721220, 1);
                                                    dialog.Text("Good select you prize gratz");
                                                    dialog.Option("Stone +5!.", 3);
                                                    dialog.Option("SandRaider Garment!.", 4);
                                                    dialog.Option("PenitenceAmulet!.", 5);
                                                    dialog.Option("Item Super!.", 6);
                                                    dialog.Send();
                                                    break;
                                                }
                                                else
                                                {
                                                    dialog.Text("You no have the letters C O N Q U E R!");
                                                    dialog.Option("OK ty!.", 255);
                                                    dialog.Send();
                                                    break;
                                                }
                                            }
Always says "You no have the letters C O N Q U E R!" ... why?
:confused:

ty:)
05/26/2011 18:56 _DreadNought_#2
client.Entity.AddFlag(Network.GamePackets.Update.F lags.(uint.Parse(Data[1])));
..
Doesnt work as simple as that, You can try compare it to an enum and have it select it.
05/26/2011 20:32 pro4never#3
You could enum.tryParse though to pull it via string xD
05/26/2011 21:56 _DreadNought_#4
or TryDefine.
05/27/2011 00:58 thesamuraivega#5
and in the npc? pliz help and more thanks!!!!
05/27/2011 20:33 zTek#6
You forgot a break;

else
{
dialog.Text("You no have the letters C O N Q U E R!");
dialog.Option("OK ty!.", 255);
dialog.Send();
break;
}
break;
}
05/27/2011 20:47 thesamuraivega#7
Quote:
Originally Posted by zTek View Post
You forgot a break;

else
{
dialog.Text("You no have the letters C O N Q U E R!");
dialog.Option("OK ty!.", 255);
dialog.Send();
break;
}
break;
}
lolz is unreachable code