i have no idea why validate has this error.

        public bool Validate ()
        {
            ItemPutUp = 0;

            List<string> errors = new List<string> ();

            foreach (ulong id in Trade.OtherOfferedItems)
            {
                var item = Trade.OtherInventory.GetItem(id);
                if (item.Defindex == 647)
                    ItemPutUp += 72;
                else if (item.Defindex == 347)
                    ItemPutUp += 180;
                else if (item.Defindex == 30085)
                    ItemPutUp += 36;
                else if (item.Defindex == 30177)
                    ItemPutUp += 63;
                else if (item.Defindex == 30131)
                    ItemPutUp += 33;
                else if (item.Defindex == 5001)
                    ItemPutUp += 81;
                else if (item.Defindex == 30089)
                    ItemPutUp += 30;
                else if (item.Defindex == 30076)
                    ItemPutUp += 36;
                else
                {
                    var schemaItem = Trade.CurrentSchema.GetItem(item.Defindex);
                    errors.Add("Item " + schemaItem.Name + " is currently not being purchased.");
                }

            }

            if (ItemPutUp < 1)
            {
                errors.Add("You must put up at least 1 item.");
            }

            // send the errors
            if (errors.Count != 0)
                Trade.SendMessage("There were errors in your trade: ");
            foreach (string error in errors)
            {
                Trade.SendMessage(error);
            }

        }

Just to add with @deceptikon,

when an if statement is written in a function, then all the paths(i.e., if statements) must return a value, other than the common return value of the function.

Hope this helps you..

Have a happy coding...:-D

This article has been dead for over six months. Start a new discussion instead.