GUI Shop

GUI Shop based on Economics. Supports NPC

Total Downloads: 11,485 - First Release: Aug 29, 2015 - Last Update: May 3, 2018

5/5, 38 likes
  1. If you follow the procedures with zone mananger, gui shop and human npcs, everything is working properly. Just to let people know ;-)

    The only thing I cannot do and tried by following the right editing procedure is to get specific skin items through the kit plugin and the give plugin when speaking to a npc inside the shop.

    If someone can tell me ( in english or french ) the different steps to follow again ( clearly please ) in order to make it work with one example I would be thanksfull !

    Regards !
     
  2. How can I add and image to the shop background? I am trying but no success.
     
  3. ok humm,

    line 288 of GUIShop.cs you must add this
    Code:
    ,
                    new CuiElement
                    {
                        Parent = ShopOverlayName,
                        Components =
                        {
                            new CuiRawImageComponent{Url = "http://i.imgur.com/LjSk3vc.png"},
                            new CuiRectTransformComponent {AnchorMin = "0 0", AnchorMax = "1 1"}
                        }
                    }
    between } and ,

    it should look like
    Code:
                    {
                        new CuiPanel
                        {
                            Image = {Color = "0.1 0.1 0.1 0.8"},
                            RectTransform = {AnchorMin = "0 0", AnchorMax = "1 1"},
                            CursorEnabled = true
                        },
                        new CuiElement().Parent,
                        ShopOverlayName
                    },
                    new CuiElement
                    {
                        Parent = ShopOverlayName,
                        Components =
                        {
                            new CuiRawImageComponent{Url = "http://i.imgur.com/LjSk3vc.png"},
                            new CuiRectTransformComponent {AnchorMin = "0 0", AnchorMax = "1 1"}
                        }
                    },
                    {
                        new CuiLabel
                        {
                            Text = {Text = shopname, FontSize = 30, Align = TextAnchor.MiddleCenter},
                            RectTransform = {AnchorMin = "0.3 0.8", AnchorMax = "0.7 0.9"}
                        },
                        ShopOverlayName
                    },
    
    remember to change url :)
    Maybe if you know c# you can change this code to add config support, or maybe waiting new reply from me ^^


    Edit :

    You must add that to your config file between "Message - Sold" and "Shop - Shop Categories"
    Code:
      "Shop - Background": "",
      "Shop - Reduce": {
        "Bronze": 5,
        "Silver": 10,
        "Gold": 15,
        "Elite": 20,
        "VIP": 25
      },
    
    Shop - Background must be like "http://www.blabla-url.com/picture.png"

    This version has been modified to allow yourself to custom price following playergroups/permissions

    To allow players to get reduced price, just add then respective permission
    Bronze => GUIShop.isbronze
    Silver => GUIShop.issilver
    Gold => GUIShop.isgold
    Elite => GUIShop.iselite
    VIP => GUIShop.isvip
     

    Attached Files:

    Last edited by a moderator: May 28, 2016
  4. I have an issue with NPC and GUIShop
    [Oxide] 17:13 [Error] Failed to call hook 'OnUseNPC' on plugin 'GUIShop v1.3.1' (KeyNotFoundException: The given key was not present in the dictionary.)
    [Oxide] 17:13 [Debug] at System.Collections.Generic.Dictionary`2[System.String,System.Object].get_Item (System.String key) [0x00000] in <filename unknown>:0
    at Oxide.Plugins.GUIShop.ShowShop (.BasePlayer player, System.String shopid, Int32 from, Boolean fullPaint, Boolean refreshMoney) [0x00000] in <filename unknown>:0
    at Oxide.Plugins.GUIShop.OnUseNPC (.BasePlayer npc, .BasePlayer player) [0x00000] in <filename unknown>:0
    at Oxide.Plugins.GUIShop.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in <filename unknown>:0
    at Oxide.Plugins.CSharpPlugin.InvokeMethod (System.Reflection.MethodInfo method, System.Object[] args) [0x00000] in <filename unknown>:0
    at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x00000] in <filename unknown>:0
    at Oxide.Core.Plugins.Plugin.CallHook (System.String hookname, System.Object[] args) [0x00000] in <filename unknown>:0
    [Oxide] 17:13 [Error] Failed to call hook 'OnUseNPC' on plugin 'GUIShop v1.3.1' (KeyNotFoundException: The given key was not present in the dictionary.)
    [Oxide] 17:13 [Debug] at System.Collections.Generic.Dictionary`2[System.String,System.Object].get_Item (System.String key) [0x00000] in <filename unknown>:0
    at Oxide.Plugins.GUIShop.ShowShop (.BasePlayer player, System.String shopid, Int32 from, Boolean fullPaint, Boolean refreshMoney) [0x00000] in <filename unknown>:0
    at Oxide.Plugins.GUIShop.OnUseNPC (.BasePlayer npc, .BasePlayer player) [0x00000] in <filename unknown>:0
    at Oxide.Plugins.GUIShop.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in <filename unknown>:0
    at Oxide.Plugins.CSharpPlugin.InvokeMethod (System.Reflection.MethodInfo method, System.Object[] args) [0x00000] in <filename unknown>:0
    at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x00000] in <filename unknown>:0
    at Oxide.Core.Plugins.Plugin.CallHook (System.String hookname, System.Object[] args) [0x00000] in <filename unknown>:0


    GUIShop.json is my config file and HumanNPC.json is my data file
     

    Attached Files:

  5. I have an issue with NPC and GUIShop
    Code:
    [Oxide] 17:13 [Error] Failed to call hook 'OnUseNPC' on plugin 'GUIShop v1.3.1' (KeyNotFoundException: The given key was not present in the dictionary.)
    [Oxide] 17:13 [Debug] at System.Collections.Generic.Dictionary`2[System.String,System.Object].get_Item (System.String key) [0x00000] in <filename unknown>:0
    at Oxide.Plugins.GUIShop.ShowShop (.BasePlayer player, System.String shopid, Int32 from, Boolean fullPaint, Boolean refreshMoney) [0x00000] in <filename unknown>:0
    at Oxide.Plugins.GUIShop.OnUseNPC (.BasePlayer npc, .BasePlayer player) [0x00000] in <filename unknown>:0
    at Oxide.Plugins.GUIShop.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in <filename unknown>:0
    at Oxide.Plugins.CSharpPlugin.InvokeMethod (System.Reflection.MethodInfo method, System.Object[] args) [0x00000] in <filename unknown>:0
    at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x00000] in <filename unknown>:0
    at Oxide.Core.Plugins.Plugin.CallHook (System.String hookname, System.Object[] args) [0x00000] in <filename unknown>:0
    [Oxide] 17:13 [Error] Failed to call hook 'OnUseNPC' on plugin 'GUIShop v1.3.1' (KeyNotFoundException: The given key was not present in the dictionary.)
    [Oxide] 17:13 [Debug] at System.Collections.Generic.Dictionary`2[System.String,System.Object].get_Item (System.String key) [0x00000] in <filename unknown>:0
    at Oxide.Plugins.GUIShop.ShowShop (.BasePlayer player, System.String shopid, Int32 from, Boolean fullPaint, Boolean refreshMoney) [0x00000] in <filename unknown>:0
    at Oxide.Plugins.GUIShop.OnUseNPC (.BasePlayer npc, .BasePlayer player) [0x00000] in <filename unknown>:0
    at Oxide.Plugins.GUIShop.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in <filename unknown>:0
    at Oxide.Plugins.CSharpPlugin.InvokeMethod (System.Reflection.MethodInfo method, System.Object[] args) [0x00000] in <filename unknown>:0
    at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x00000] in <filename unknown>:0
    at Oxide.Core.Plugins.Plugin.CallHook (System.String hookname, System.Object[] args) [0x00000] in <filename unknown>:0
    GUIShop.json is my config file and HumanNPC.json is my data file
     

    Attached Files:

    Last edited by a moderator: May 30, 2016
  6. Which version of plugin you are using? (official or modified by me?)
     
  7. The official
     
  8. Hey guys I am trying to add a shop to my server I configured the JSON file just like the example and tried adding a few thing and it work just great. I went ahead and add the full shop menu that I want, validated the JSON file and loaded it to my server just fine. I didn't get any errors but when I open the shop using /Shop in game it doesn't show anything. only Build and the title how many coins i have and the three categories Items, Buy, Sell but nothing else. What am I doing wrong? Please Help
    [DOUBLEPOST=1464491697][/DOUBLEPOST]
    Ok i noticed after I save and reload the plugin it changes the config file to what I uploaded. it saves fine before I restart the plugin. How can I stop the file from changing.
     

    Attached Files:

  9. Seems that hight external wood and metal cannot be sold ? Do you have the same problem ?

    http://vignette1.wikia.nocookie.net...est/scale-to-width-down/100?cb=20151106060841

    http://vignette3.wikia.nocookie.net...est/scale-to-width-down/100?cb=20151106061300

    The sell option is not working :

    In my config :

    "High External Stone Wall": {
    "buy": "15000",
    "img": "http://vignette1.wikia.nocookie.net...est/scale-to-width-down/100?cb=20151106060841",
    "item": "walls.external.high.stone",
    "sell": "1000"

    "High External Wooden Wall": {
    "buy": "7500",
    "img": "http://vignette3.wikia.nocookie.net...est/scale-to-width-down/100?cb=20151106061300",
    "item": "walls.external.high.wood",
    "sell": "500"

    "High External Stone Wall",
    "High External Wooden Wall",

    Is it working for you ?
     
    Last edited by a moderator: May 29, 2016
  10. Oxide.unload GUIShop
    Then change config
    Then
    Oxide.reload GUIShop
     
  11. can you give me the link to the 2 version of this plugin? please
     
  12. Official is on the overview and mine here
    GUI Shop | Page 38 | Oxide

    Remember to do the config modification before putting plugin online
     
  13. with the update of rust the npc ID have 10 caracter before he has 6 caracter. sorry for my bad english I hope you understand.
    [DOUBLEPOST=1464546719][/DOUBLEPOST]I dont know if is the cause of my bug
     
  14. From this plugin id lengh is not important because he is working as string.
    Your config seem to be correct, did all your shop is bugged or?
     
  15. yes is all bugged I have 11 shop (11 NPC). I don't want to redo all my config files
     
  16. Maybe save your config file, and just do only fresh 1 shop that sell 1 items to see if npc is bugged or not
     
  17. ok I will try this thank you
     
  18. G'day

    I used a couple of files from in this thread and have got the /shop running, rather than /shop though I would like it to work with various NPCs to sell different thing in like a shopping mall.

    I grabbed an NPC .json from this thread but to be honest I'm not sure what to do with it, should I position my NPCs and put their lat/long into the .json then replace the current NPC.json?

    Once I have done that I assume there is a command to type into the /npc_use to open the shop but I'm not sure what that is?

    If I wanted a config for lets say four different NPCs one for clothes, mats, weapons, general how would I set the config up? I have no issues with sitting down typing in all the different items and the like but I'm just not sure how to set it out, would anyone happen to have a template for 4 NPCs that I could fill in?

    Thanks for taking the time to read this and cheers for any help

    Dean.
     
  19. Nothing hard to get it working.
    First you must create your different NPC using npc human, once is done you get list using /npc_list.
    For next step you have to configure GUIShop, start to configure the "Shop - Shop Categories" part, by adding all items with setting buy/img/item/sell option.
    Once done you had to configure the "Shop - Shop List" part,
    Here you may add something like that.

    Code:
     "1234567": { <== NPCID from /npc_list
          "buy": [ <== buy item from "Shop - Shop Categories" part
            "Apple",
            "BlueBerries",
            "Assault Rifle",
            "Bolt Action Rifle"
          ],
          "description": "You currently have {0} coins to spend in this farmers market",
          "name": "Fruit Market", <== market name
          "sell": [ <== sell item from "Shop - Shop Categories" part
            "Apple",
            "BlueBerries",
            "Assault Rifle",
            "Bolt Action Rifle"
          ]
        },
    after done, save config and reload
     
  20. Appreciate the prompt reply :) tomorrow I ill give that a try, thank you.