Using FluxRP Emu

Jan 7, 2016
194
15
We are trying to make a roleplay hotel at our website but for some reason this happens and before you ask, yes I've searched on google.
 
Jan 7, 2016
194
15
Code:
 internal CatalogItem(DataRow row, string name)
        {
            Id = Convert.ToUInt32(row["id"]);
            Name = name;
            ItemIdString = row["item_ids"].ToString();
            Items = new Dictionary<Item, uint>();
            var itemIds = ItemIdString.Split(';');
            var amounts = row["amounts"].ToString().Split(';');
            for (var i = 0; i < itemIds.Length; i++)
            {
                uint id;
                uint amount;

                if (!uint.TryParse(itemIds[i], out id) || GetBaseItem(id) == null) continue;
                uint.TryParse(amounts[i], out amount);

                Items.Add(GetBaseItem(id), amount);
            }

            BaseId = Items.Keys.First().ItemId;
            FirstAmount = Items.Values.First();
            PageId = (int) row["page_id"];
            uint.TryParse(row["cost_credits"].ToString(), out CreditsCost);
            uint.TryParse(row["cost_belcredits"].ToString(), out BelCreditsCost);
            uint.TryParse(row["cost_loyalty"].ToString(), out LoyaltyCost);
            uint.TryParse(row["cost_duckets"].ToString(), out DucketsCost);

            LimitedSelled = (int) row["limited_sells"];
            LimitedStack = (int) row["limited_stack"];
            IsLimited = (LimitedStack > 0);
            Badge = (string) row["badge"];
            HaveOffer = ((string) row["offer_active"] == "1");
            ClubOnly = ((string) row["club_only"] == "1");
            ExtraData = (string) row["extradata"];
            SongId = (uint) row["song_id"];
        }

        /// <summary>
        /// Gets the base item.
        /// </summary>
        /// <param name="itemIds">The item ids.</param>
        /// <returns>Item.</returns>
        internal Item GetBaseItem(uint itemIds)
        {
            var item = Plus.GetGame().GetItemManager().GetItem(itemIds);
            if (item == null)
                Out.WriteLine(string.Format("UNKNOWN ItemIds: {0}", itemIds), "", ConsoleColor.DarkRed);
            return item;
        }

        /// <summary>
        /// Gets the first base item.
        /// </summary>
        /// <returns>Item.</returns>
        internal Item GetFirstBaseItem()
        {
            return GetBaseItem(BaseId);
        }
    }
}
 

Velaski

winner
Aug 4, 2015
562
165
Code:
 internal CatalogItem(DataRow row, string name)
        {
            Id = Convert.ToUInt32(row["id"]);
            Name = name;
            ItemIdString = row["item_ids"].ToString();
            Items = new Dictionary<Item, uint>();
            var itemIds = ItemIdString.Split(';');
            var amounts = row["amounts"].ToString().Split(';');
            for (var i = 0; i < itemIds.Length; i++)
            {
                uint id;
                uint amount;

                if (!uint.TryParse(itemIds[i], out id) || GetBaseItem(id) == null) continue;
                uint.TryParse(amounts[i], out amount);

                Items.Add(GetBaseItem(id), amount);
            }

            BaseId = Items.Keys.First().ItemId;
            FirstAmount = Items.Values.First();
            PageId = (int) row["page_id"];
            uint.TryParse(row["cost_credits"].ToString(), out CreditsCost);
            uint.TryParse(row["cost_belcredits"].ToString(), out BelCreditsCost);
            uint.TryParse(row["cost_loyalty"].ToString(), out LoyaltyCost);
            uint.TryParse(row["cost_duckets"].ToString(), out DucketsCost);

            LimitedSelled = (int) row["limited_sells"];
            LimitedStack = (int) row["limited_stack"];
            IsLimited = (LimitedStack > 0);
            Badge = (string) row["badge"];
            HaveOffer = ((string) row["offer_active"] == "1");
            ClubOnly = ((string) row["club_only"] == "1");
            ExtraData = (string) row["extradata"];
            SongId = (uint) row["song_id"];
        }

        /// <summary>
        /// Gets the base item.
        /// </summary>
        /// <param name="itemIds">The item ids.</param>
        /// <returns>Item.</returns>
        internal Item GetBaseItem(uint itemIds)
        {
            var item = Plus.GetGame().GetItemManager().GetItem(itemIds);
            if (item == null)
                Out.WriteLine(string.Format("UNKNOWN ItemIds: {0}", itemIds), "", ConsoleColor.DarkRed);
            return item;
        }

        /// <summary>
        /// Gets the first base item.
        /// </summary>
        /// <returns>Item.</returns>
        internal Item GetFirstBaseItem()
        {
            return GetBaseItem(BaseId);
        }
    }
}
Which one is Line 133?
 

Users who are viewing this thread

Top