[Help]tradind almost done...

07/12/2009 05:01 brugo#1
hi all, i downloaded that source [Relese]Source CoEmu V2 For All now Have Some Npc Work , coz the original dont have the trade system, and im new to c#.. but, this trade system is ALMOST working, its accept, money, cps, close, but the itens dont trade it..... when i remove the /*.... /* from the part of the code whos make the trade done, 2 errors came...

Code:
case 6://Add an item
                                           {
                                               ClientSocket Who = Nano.ClientPool[(int)CSocket.Client.TradingWith];
                                               if (Who.Client.Inventory.Count + CSocket.Client.MyTradeSideCount < 40)
                                               {
                                                   //string Item = CSocket.Client.FindItem(UID);
                                                   Struct.ItemInfo Item = CSocket.Client.Inventory[(int)UID];
                                                   Who.Send(ConquerPacket.TradeItem(UID, Item));
                                                   //Who.MyClient.SendPacket(General.MyPackets.TradeItem(UID, Item));
                                                   CSocket.Client.MyTradeSide.Add(UID);
                                                   CSocket.Client.MyTradeSideCount++;
                                               }
                                               else
                                               {
                                                   CSocket.Send(ConquerPacket.TradePacket(CSocket.Client.ID, 11));
                                                   Who.Send(ConquerPacket.TradePacket(CSocket.Client.ID, 11));
                                                   CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "[Trade]Your trade partner can't hold any more items.", Struct.ChatType.Top));
                                               }
                                               break;
                                           }
got that errors:



Error 1 The best overloaded method match for 'CoEmu_v2_GameServer.Packets.ConquerPacket.TradeIt em(uint, string)' has some invalid arguments C:\Documents and Settings\Administrador\Desktop\CoEmu v2\CoEmu v2\CoEmu v2 GameServer\PacketProcessor.cs 1871 61 CoEmu v2 GameServer


Error 2 Argument '2': cannot convert from 'CoEmu_v2_GameServer.Structs.Struct.ItemInfo' to 'string' C:\Documents and Settings\Administrador\Desktop\CoEmu v2\CoEmu v2\CoEmu v2 GameServer\PacketProcessor.cs 1871 90 CoEmu v2 GameServer


if someone use that same source and alread fix that, can help me??

sry for my english, real sry
07/12/2009 05:48 taylor2846#2
Code:
        public static byte[] TradeItem(int UID, int itemid, int Plus, int Minus, int Enchant, int soc1, int soc2, int currentdura, int maxdura, int Location, int Color/*, int Free, int Progress, int Suspicious, int Locked, int Effect*/)
        {
            PacketBuilder Packet = new PacketBuilder(1008, 48);
            Packet.Long(UID);
            Packet.Long(itemid);
            Packet.Int(1);
            Packet.Int(1);
            Packet.Int(1);
            Packet.Int(1);
            Packet.Short(2);
            Packet.Int(255);
            Packet.Long(0);
            //Packet.Int(Effect);
            Packet.Int(soc1);
            Packet.Int(soc2);
            Packet.Short(2);
            Packet.Int(Plus);
            Packet.Int(Minus);
            //Packet.Int(Free);
            Packet.Long(Enchant);
            Packet.Int(0);
            //Packet.Short(Suspicious);
            //Packet.Short(Locked);
            Packet.Long(Color);
            //Packet.Long(Progress);
            return Packet.getFinal();
        }
        public static byte[] Trade(int UID, int Option)
        {
            PacketBuilder Packet = new PacketBuilder(1056, 12);
            Packet.Long(UID);
            Packet.Long(Option);
            return Packet.getFinal();
        }
		public class ItemInfo
		{
			public int UID;
			public int ItemID;
			public int Plus;
			public int Bless;
			public int Enchant;
			public int Soc1;
			public int Soc2;
			public int Dura;
			public int MaxDura;
			public int Position;
			public int Color = 4;
		}
there not gona tell you whereto put it ..
07/12/2009 06:48 brugo#3
Quote:
Originally Posted by taylor2846 View Post
Code:
        public static byte[] TradeItem(int UID, int itemid, int Plus, int Minus, int Enchant, int soc1, int soc2, int currentdura, int maxdura, int Location, int Color/*, int Free, int Progress, int Suspicious, int Locked, int Effect*/)
        {
            PacketBuilder Packet = new PacketBuilder(1008, 48);
            Packet.Long(UID);
            Packet.Long(itemid);
            Packet.Int(1);
            Packet.Int(1);
            Packet.Int(1);
            Packet.Int(1);
            Packet.Short(2);
            Packet.Int(255);
            Packet.Long(0);
            //Packet.Int(Effect);
            Packet.Int(soc1);
            Packet.Int(soc2);
            Packet.Short(2);
            Packet.Int(Plus);
            Packet.Int(Minus);
            //Packet.Int(Free);
            Packet.Long(Enchant);
            Packet.Int(0);
            //Packet.Short(Suspicious);
            //Packet.Short(Locked);
            Packet.Long(Color);
            //Packet.Long(Progress);
            return Packet.getFinal();
        }
        public static byte[] Trade(int UID, int Option)
        {
            PacketBuilder Packet = new PacketBuilder(1056, 12);
            Packet.Long(UID);
            Packet.Long(Option);
            return Packet.getFinal();
        }
		public class ItemInfo
		{
			public int UID;
			public int ItemID;
			public int Plus;
			public int Bless;
			public int Enchant;
			public int Soc1;
			public int Soc2;
			public int Dura;
			public int MaxDura;
			public int Position;
			public int Color = 4;
		}
there not gona tell you whereto put it ..

that is the kinshi88 version of the trade system, im not using that coz cannot fix all the errors, im using that source"" [Relese]Source CoEmu V2 For All now Have Some Npc Work"" , alread came with a trade system... too diferent by the way
07/12/2009 07:07 pro4never#4
Quote:
Originally Posted by brugo View Post
that is the kinshi88 version of the trade system, im not using that coz cannot fix all the errors, im using that source"" [Relese]Source CoEmu V2 For All now Have Some Npc Work"" , alread came with a trade system... too diferent by the way
While it is different, you should be able to convert some of it to work in this trade system, or at least learn how to re-script it using kinshi's as an example.
07/12/2009 07:09 taylor2846#5
the only problem i got from the one kinshi88 trade system is can not trade items.. lol when i trade a item to a player it dont show up in the other players item box and it will kick them did not find out why this is happening yet i probably did something wrong lol

btw. if you are not using his vs that means you are using the one in his souce only has 100% trading send request its a lil short from any tang ealse and if you cant fix that 2 earrors what are you trying to get codes form kinshi88 and put them in with his vs. dont thank that will work lol.