GUI Shop

GUI Shop based on Economics. Supports NPC

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

5/5, 38 likes
  1. Your config is wrong, here the right way :


    Code:
    {
      "Message - Bought": "You 've successfully bought {0}x {1}",
      "Message - Error - Cooldown": "This item has a cooldown of {0} seconds.",
      "Message - Error - Cooldown Amount": "This item has a cooldown and amount is limited to 1.",
      "Message - Error - Invetory Full": "Your inventory is full.",
      "Message - Error - Invetory Slots": "Your inventory needs {0} free slots.",
      "Message - Error - Item Doesnt Exist": "WARNING: The item you are trying to buy doesn't seem to exist",
      "Message - Error - Item Not Set Properly": "WARNING: The admin didn't set this item properly! (item)",
      "Message - Error - Item Not Valid": "WARNING: It seems like it's not a valid item",
      "Message - Error - No Action In Shop": "You are not allowed to {0} in this shop",
      "Message - Error - No Action Item": "You are not allowed to {0} this item here",
      "Message - Error - No Buy Price": "WARNING: No buy price was given by the admin, you can't buy this item",
      "Message - Error - No Chat Shop": "You may not use the chat shop. You might need to find the NPC Shops.",
      "Message - Error - No Econonomics": "Couldn't get informations out of Economics. Is it installed?",
      "Message - Error - No NPC": "The NPC owning this shop was not found around you",
      "Message - Error - No Sell Price": "WARNING: No sell price was given by the admin, you can't sell this item",
      "Message - Error - No Shop": "This shop doesn't seem to exist.",
      "Message - Error - Not Enough Items": "You don't have enough of this item.",
      "Message - Error - Not Enough Money": "You need {0} coins to buy {1} of {2}",
      "Message - Error - Redeem Kit": "WARNING: There was an error while giving you this kit",
      "Message - Sold": "You've successfully sold {0}x {1}",
      "Shop - Shop Categories": {
        "12 Gauge Buckshot": {
          "buy": "50",
          "img": "http://vignette1.wikia.nocookie.net/play-rust/images/2/2f/12_Gauge_Buckshot_icon.png/revision/latest/scale-to-width-down/50?cb=20151106061114",
          "item": "ammo.shotgun",
          "sell": "0"
        }
      },
      "Shop - Shop List": {
        "chat": {
          "buy": [
            "12 Gauge Buckshot"
          ],
          "description": "You currently have {0} coins to spend.",
          "name": "Weapon Blue Prints"
        }
      }
    }
    Item: should be the short itemname with dot.
    [DOUBLEPOST=1463076815,1463068349][/DOUBLEPOST]

    ofc addedd in config file with 5 ranks, here the updated version :)

    Modify you config file below
    Must be an integer value 1 ~ 100 (1,50 won't work same for 1.50)
    Code:
      "Message - Sold": "You've successfully sold {0}x {1}",
      "Shop - Reduce": {
        "Bronze": 5,
        "Silver": 10,
        "Gold": 15,
        "Elite": 20,
        "VIP": 25
      },
      "Shop - Shop Categories": {
    
    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

    Code:
    Example :grant player sam GUIShop.isvip12 Gauge Buckshot default price => 50/unit
    vip reduce => 25%
    amount => 1
    reduced price => 50 - (50 * (25/100)) * amount = 38 (rounded value because of economics)if amount = 1000
    reduced price => 50 - (50 * (25/100)) * amount = 37 500 (no rounded value)

    Hope you like it :)
    Fell free to contact me if necessary.
     

    Attached Files:

  2. Code:
    "NPC USERID": {
          "buy": [
            "Hammer",
            "Stone Hatchet",
            "Stone Pick Axe",
            "Building Plan",
            "Torch",
            "Bandage"
          ],
          "description": "There is currently {0} silver in ur wallet",
          "name": "Tools Store",
          "sell": [
            "Hammer",
            "Stone Hatchet",
            "Stone Pick Axe",
            "Building Plan",
            "Torch",
            "Bandage"
          ]
        }
    Is is posible to have more NPC id's in 1 config like above here? Yes so can u give me a example? Thanks!
     
  3. So you want to add more npc?
    Sure, pretty easy:
    Code:
    "123456789": {
          "buy": [
            "Building Plan",
            "Torch",
            "Bandage"
          ],
          "description": "There is currently {0} silver in ur wallet",
          "name": "Tools Store",
          "sell": [
            "Building Plan",
            "Torch",
            "Bandage"
          ]
        },
    "987654321": {
          "buy": [
            "Hammer",
            "Stone Hatchet",
            "Stone Pick Axe"
          ],
          "description": "There is currently {0} silver in ur wallet",
          "name": "Tools Store2",
          "sell": [
            "Hammer",
            "Stone Hatchet",
            "Stone Pick Axe"
          ]
        }
    just add one more and change ths npc ID (the 123456789 and 987654321 i wrote in as an example)
    If you want npc's with the same stuff for sale you have to copy their store and change die npcID
     
  4. Hi,

    Thank you so much for the reply and for the file, I seem to be having troubles with it though :( I tried to add the perms and it says they don't exisit.

    Also I cant seem to get the shop to work with the NPC's I have gone through the config file and checked it over so many times and I just cant work out why it wont work. Could I possibly get someone to look it over for me and see if they can find the issue please?

    Thank you in advance
    Soul
     

    Attached Files:

  5. Just to be clear, you do not have to do the entire item list for each "store" you tag to a NPC? Just the buy/sell sections? this will only make those items available and not the entire list?

    Love this mod by the way. Thanks. Can we also add the new items like hemp seeds? Not sure of the item info on that one yet.
     
  6. For permission you must download my plugin version (unofficial) at this post
     
  7. Yes, in the upper part you have the items that are available, below you just put the "stores".
    And yes - you can add new things
    In the config you will finde this:
    Code:
    "Apple": {
          "buy": "1",
          "img": "http://vignette2.wikia.nocookie.net/play-rust/images/d/dc/Apple_icon.png/revision/latest/scale-to-width-down/100?cb=20150405103640",
          "item": "apple",
          "sell": "1"
    If you want to add something just keep it that way and do it like this:
    Code:
    "Hemp seed": {
          "buy": "100",
          "img": "http://vignette1.wikia.nocookie.net/play-rust/images/1/1c/Hemp_Seed_icon.png/revision/latest?cb=20160511082423",
          "item": "hemp seed",
          "sell": "90"
    "Hemp" ( you can name this however you want it to be named, if you want to make shops that sell them at different prices, just copy the whole thing and create a new unique name for it and lower then the price ;) )
    "buy": "100" (the price you have to pay to buy it from the npc, here it would be 100)
    "img": "http (just get the item from Items , then click on the picture, then rightclick "open in new tab" and you have your url)
    "item": "hemp seed" (just take the wiki name in lower case)
    "sell": "90" (the price the npc will pay you for the item - here 90)

    I hope I was able to help, just tell me if you need any further help :)
     
  8. Ia there an easier way to disabling selling the 1, 10 quantities while making 100 sell for 1 credit?
    (Per Item configurable if possible)
    In order to force players to sell Wood in stacks of 100 for 1 credit?

    My main goal is trying to keep the player-money as low as possible.

    It is possible via kits but would take a lot more coding per item and I intend to have 12 shops selling all items.

    Awesome plugin btw!
     

  9. guess you can edit this part in the .cs
    Code:
    private readonly int[] steps = { 1, 10, 100, 1000 };
    and just erase the 1, an 10,

    and then set the "sell" to 0.01 maybe?

    or just use MoneyTime for Rust | Oxide and put in a negative value so they have to pay taxes ;)
     
  10. I still get this error:

    [Oxide] 01:20 [Error] Failed to call hook 'cmdShop' on plugin 'GUIShop v1.1.2' (KeyNotFoundException: The given key was not present in the dictionary.)
    [Oxide] 01:20 [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 fullRefresh) [0x00000] in <filename unknown>:0
    at Oxide.Plugins.GUIShop.cmdShop (.BasePlayer player, System.String command, System.String[] args) [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

    Already tried every version and solution that was posted here but nothing. Got the same problem with NPCs. My other plugins are: BlueprintBlocker, CustomLootSpawns, Economics, HumanNPC, Kits, NightLantern, Notifier, Pathfinding, PopupNotifications, Rust:IO, SignArtist and Zone Manager.
     

    Attached Files:

  11. why the hell the config file is reset when i restart server i must re-make all the configuration every time ......
    and it also doesnt work because i need to restart to make it run in game i'm blocked
     
    Last edited by a moderator: May 14, 2016
  12. Did you validate?
    try line 155+156 Ektra },
    348 "Small Water Bottle" ,
    374 "Pookie Bear" ,
    etc
     
  13. Hi Sami37,

    Thank you again for your reply and help :)
    The issue is that I have installed your version, and yet the server didnt pick it up, it didnt eve create a config file,I even left it till after a full server cycle and restart, but still no config and it still wouldnt accept the perms, I ended up creating my own config file hoping to trigger it, but still nothing. :(
    I'm not sure why?

    Soul
     
  14. Ok thx for the quick response. Now i validated but there is still one error i dont understand (sry im pretty new to this)

    Error: Parse error on line 415:
    ..." ] } } }
    ------------------^
    Expecting '}', ',', got 'EOF'


    Edit: Solved the problem with the .json but NPCs still dont work as shop... i dont get any error msg or something like that. And if i try to open the shop via chat its empty...
     

    Attached Files:

    Last edited by a moderator: May 14, 2016
  15. Compare the last 14 lines of your code and the original, you deleted/replaced the chat function

    Change:
    Code:
        "schwereWaffen": {
          "buy": [
            "Assault Rifle",
            "Bolt Action Rifle"
          ],
          "description": "Ich kaufe was du hast!",
          "name": "schwereWaffen",
          "sell": [
            "Assault Rifle",
            "Bolt Action Rifle"
          ]
    to
    Code:
        "chat": {
          "buy": [
            "Assault Rifle",
            "Bolt Action Rifle"
          ],
          "description": "Ich kaufe , was Sie haben ! - Du hast 
    {0} Fußnägel",
          "name": "schwereWaffen",
          "sell": [
            "Assault Rifle",
            "Bolt Action Rifle"
          ]
     
  16. does somebody have a solution to my probleme ???
     
  17. The only thing I know is that if you have a typo in the config it reset it to standard, maybe that is the problem?
     
  18. what do you call a typo ?
     

    Attached Files:

  19. I think it is this:
    Line 46,
    Code:
        },
    should be just
    }
     
  20. i remove de "," and restart the server it reset the default file that's not my probleme here