1. Hello I am trying to get the category names to display horizontally instead of vertically so instead of this:
    Cat 1
    Cat 2
    Cat 3
    Cat 4
    Cat 5
    etc.

    To get them to display like this cat1, cat2, cat3, cat4, cat,5 etc,

    I was told to change this code
    Code:
    [ChatCommand("shop")]
            private void ChatCmd_Shop(PlayerSession player, string command, string[] args)
            {
                double tmpPer;
                double.TryParse(Config["sellpercentage"].ToString(), out tmpPer);
                saleModifier = (1d - ((double)tmpPer / 100d));            switch (args.Length == 0)
                {
                    case true:
                        var DistinctCats = StoreStock.Select(x => x.category).Distinct();
                        //TEST
                        var catsCount = (DistinctCats.ToArray().Length > 0 && DistinctCats.ToArray().Length <= 7) ? 9 - DistinctCats.ToArray().Length : 0;
                        int i = 0;
                        while (i < catsCount)
                        {
                            hurt.SendChatMessage(player, "");
                            i++;
                        }
                        //TEST
                        hurt.SendChatMessage(player, GetMsg("header_catlisiting", player.SteamId)
                                                                .Replace("{Color:Header}", "<color=#00ffffff>")
                                                                .Replace("{/Color:Header}", "</color>")
                                                                .Replace("{Color:Good}", "<color=#00ff00ff>")
                                                                .Replace("{/Color:Good}", "</color>"));
            foreach (var cats in DistinctCats)
                        {
                            if (cats != null)
                                hurt.SendChatMessage(player, cats);
                        }
                        //inline cats = hurt.SendChatMessage(player, string.Join(", ", DistinctCats));                    break;
    
    So I would be replacing this line of code
    Code:
            foreach (var cats in DistinctCats)
                        {
                            if (cats != null)
                                hurt.SendChatMessage(player, cats);
                        }
    With this
    Code:
    hurt.SendChatMessage(player, string.Join(", ", DistinctCats));
    But each time I try it breaks the plugin and /shop command cannot be used. Could anyone help me out?
     
  2. Well, I don't know C# at all, but if Join doesn't work
    Code:
    string  CatsStr = '';
    string p = '';
    foreach(var cats in DistinctCats) {
        if(cats != null) {
            CatsStr += p+cats;
            p = ', ';
        }
    }
    hurt.SendChatMessage(player, CatsStr);break;
    Edit:
    And if your plugin is throwing error then you should check logs.
     
  3. I'll try it out thanks!
    [DOUBLEPOST=1455342938][/DOUBLEPOST]Just tried it but still not displaying the categories horizontally after using /reload HurtStore
    [DOUBLEPOST=1455353033,1455342610][/DOUBLEPOST]This ended up breaking the entire plugin :(
     
  4. You were close :p
    All you need to do is add each one to a string, then send a message with that string.
    Change this:
    Code:
            foreach (var cats in DistinctCats)
                        {
                            if (cats != null)
                                hurt.SendChatMessage(player, cats);
                        }
                        //inline cats = hurt.SendChatMessage(player, string.Join(", ", DistinctCats));
    To this:
    Code:
    string catstring = "";
    foreach (var cats in DistinctCats)
    {
        if (cats != null)
            catstring += cats+", ";
    }
    hurt.SendChatMessage(player, catstring);
     
  5. Thank you man! :)
     
  6. mark as solved please