I'm trying and i already do it
but when server restart all values back to 0 again
public byte gotitems = 0;
Code:
if (CurrentNPC == 790) { if (Control == 1) { SendPacket(General.MyPackets.NPCSay("You sure you want to Items Trojan?")); SendPacket(General.MyPackets.NPCLink("Yes please.", 5)); SendPacket(General.MyPackets.NPCLink("Not,Good Bye.", 255)); SendPacket(General.MyPackets.NPCSetFace(30)); SendPacket(General.MyPackets.NPCFinish()); } if (Control == 5) { if (MyChar.ItemsInInventory < 33) { if (MyChar.gotitems == 1) { SendPacket(General.MyPackets.NPCSay("lol")); SendPacket(General.MyPackets.NPCLink("Ops, Sorry.", 255)); SendPacket(General.MyPackets.NPCSetFace(30)); SendPacket(General.MyPackets.NPCFinish()); } else { MyChar.AddItem("135999-12-7-255-13-13", 0, (uint)General.Rand.Next(346623472));//ConquestArmor MyChar.AddItem("410339-12-7-255-13-13", 0, (uint)General.Rand.Next(346623472));//Sparks Blade MyChar.AddItem("410339-12-7-255-13-13", 0, (uint)General.Rand.Next(346623472));//Sparks Blade MyChar.AddItem("120249-12-7-255-13-13", 0, (uint)General.Rand.Next(346623472));//Neck MyChar.AddItem("150249-12-7-255-13-13", 0, (uint)General.Rand.Next(346623472));//Ring MyChar.AddItem("160249-12-7-255-13-13", 0, (uint)General.Rand.Next(346623472));//Bota MyChar.AddItem("112389-12-7-255-13-13", 0, (uint)General.Rand.Next(346623472));//Coronet MyChar.AddItem("117399-12-7-255-13-13", 0, (uint)General.Rand.Next(346623472));//Brinco MyChar.updateitems(); } } else { SendPacket(General.MyPackets.NPCSay("you must have 7 spots in your inventory")); SendPacket(General.MyPackets.NPCLink("Ops, Sorry.", 255)); SendPacket(General.MyPackets.NPCSetFace(30)); SendPacket(General.MyPackets.NPCFinish()); } } }
Code:
public static void updateitems(Character Charr) { try { MySqlCommand Command = null; Command = new MySqlCommand("UPDATE `Characters` SET `gotitems` = '1' WHERE `Account` = '" + Charr.MyClient.Account + "'", ExternalDatabase.Connection); Command.ExecuteNonQuery(); } catch (Exception Exc) { General.WriteLine(Convert.ToString(Exc)); } }