GUI Shop

GUI Shop based on Economics. Supports NPC

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

5/5, 38 likes
  1. U forgott a : or a , check your config
     
  2. Nice job ! Can i add in shop random skin weapon or item ? Usage: "randomskin": true or "skinID": XXXXXX
     
  3. Wouldn't the JSON Validator catch these mistakes though? And I looked through it manually, there's no errors. I guess images have to be stored on the internet?
     
  4. Is there a way to possibly make it so the /shop command could only be opened in a certain area? I am trying to create a village, with ai and all that, but once you are inside the zone, you are able to do /shop and have it work? Elsewhere it would just say "you must be in the village to use that command" or something along those lines? Thanks.
     
  5. Does anyone else have problems with the config file reseting itself 99,9% of the time and refusing to save? Might be me doing something wrong. Any help or suggestions is appreciated, thanks.

    Edit: Working now using the lucaro2708's version found here.
    [DOUBLEPOST=1453872020,1453795669][/DOUBLEPOST]
    You could just link the shop to NPC's and place them around the Village you are creating, making it so the players have to visit the npcs in the village if they want to shop.
     
  6. ok so i have 1 npc working for my server but how do i add another 6 npcs everytime a add a new shop list i cant end the script can someone please help me
     

    Attached Files:

    Last edited by a moderator: Jan 27, 2016
  7. Something wrong with the code/config.. Try adding two } at the end of the file, below the 3 others. Not sure if it works, but that should atleast make the code/config valid.
     
  8. Ok Thanks i will try that now give me 10 mins to replay :)
    [DOUBLEPOST=1453930473][/DOUBLEPOST]
    ok i have just done that and yes it works thanks so much you was such a great help i cant thank you enought your welcome to join my server if u would like some day :)

    Thanks :)
     
  9. Just found the problem, you copyed and pasted to much, and did not close it.

    You got it like this:
    Code:
    "Shop - Shop List": {
        "2092641000": {
          "buy": [
            "Salvaged Sword",
            "Machete",
            "Longsword",
            "Mace",
            "Salvaged Cleaver"
          ],
          "description": "You currently have {0} coins to spend in this farmers market",
          "name": "BlackSmith",
          "sell": [
            "Slavaged Sword",
            "Machete",
            "Longsword",
            "Mace",
            "Salvaged Cleaver"
          ],
      "Shop - Shop List": {
        "620923379": {
          "buy": [
            "Small Bottle Water",
            "Bota Bag"
          ],
          "description": "You currently have {0} coins to spend in this farmers market",
          "name": "Bar",
          "sell": [
            "Small Water Bottle",
            "Bota Bag"
          ]
        },
        "chat": {
          "buy": [
            "Build Kit"
          ],
          "description": "You currently have {0} coins to spend in this builders shop",
          "name": "Build"
        }
      }
    }
    
    It should be like this:
    Code:
    "Shop - Shop List": {
        "2092641000": {
          "buy": [
            "Salvaged Sword",
            "Machete",
            "Longsword",
            "Mace",
            "Salvaged Cleaver"
          ],
          "description": "You currently have {0} coins to spend in this farmers market",
          "name": "BlackSmith",
          "sell": [
            "Slavaged Sword",
            "Machete",
            "Longsword",
            "Mace",
            "Salvaged Cleaver"
          ]
      },
        "620923379": {
          "buy": [
            "Small Bottle Water",
            "Bota Bag"
          ],
          "description": "You currently have {0} coins to spend in this farmers market",
          "name": "Bar",
          "sell": [
            "Small Water Bottle",
            "Bota Bag"
          ]
        },
        "chat": {
          "buy": [
            "Build Kit"
          ],
          "description": "You currently have {0} coins to spend in this builders shop",
          "name": "Build"
        }
      }
    }
    
    Either way works, but thats the proper way, so you dont have to close everything twice.
     
  10. Hey i want to change the buy and sell keys values from 1,10,100,1000 to 1,100,10000,100000.
    How can i do that? and is it possible?
     
  11. Oh yeah thanks dude i was having a problem with my npc not working but they now do thanks so much dude :)


    Thanks :)
     
  12. You need to change the .cs file of GUIShop to do that.. Playing around to much there might break it..
     
  13. Hello,
    Is it possible to change the transparency of the npc shop?

    thank you,
    Shu
     
  14. im getting this problem when ading npc's

    [Oxide] 11:03 PM [Error] Failed to call hook 'OnUseNPC' on plugin 'GUIShop v1.1.2' (KeyNotFoundException: The given key was not present in the dictionary.)
    [Oxide] 11:03 PM [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.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
     

    Attached Files:

  15. Yes, that is possible and is done in the GUIShop.cs file, located in your plugin folder.

    Example:

    Original Shop
    Code:
    //////////////////////////////////////////////////////////////////////////////////////
            // GUI ///////////////////////////////////////////////////////////////////////////////
            //////////////////////////////////////////////////////////////////////////////////////        private static CuiElementContainer CreateShopOverlay(string shopname)
            {
                return new CuiElementContainer
                {
                    {
                        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
                    },
    Dark Grey Background (Not Transparent)
    Code:
    //////////////////////////////////////////////////////////////////////////////////////
            // GUI ///////////////////////////////////////////////////////////////////////////////
            //////////////////////////////////////////////////////////////////////////////////////        private static CuiElementContainer CreateShopOverlay(string shopname)
            {
                return new CuiElementContainer
                {
                    {
                        new CuiPanel
                        {
                            Image = {Color = "0.1 0.1 0.1 1.0"},
                            RectTransform = {AnchorMin = "0 0", AnchorMax = "1 1"},
                            CursorEnabled = true
                        },
                        new CuiElement().Parent,
                        ShopOverlayName
                    },
    I changed the 0.8 in this line:
    Image = {Color = "0.1 0.1 0.1 0.8"}, (Original) to Image = {Color = "0.1 0.1 0.1 1.0"}, (Dark Grey background)

    Hope that helps. Keep in mind that playing around to much in there, might break it.
    PS: You wont be able to see the "You bought bla bla bla" message in chat, when buying / selling, this way. Don't know how to change that tbh.
     
    Last edited by a moderator: Jan 27, 2016
  16. Too strong Pawlemann !
    Thank you very much it is impeccable !

    I posted a question on the DEATH NOTE.
    Death Notes | Page 108 | Oxide

    Perhaps you will help me.

    Thank you in any case it's nice;)

    Shu
     
  17. Theres alot of spaces in: "M249 ",
    Remove them and try again. I cant see any other problems in the attached file. It should be valid after you remove the spaces. Did you change anything else?
    Code:
    "940777319": {
          "buy": [
            "Assault Rifle",
            "Custom SMG",
            "Pump Shotgun",
            "M249    ",
            "Beancan Grenade",
            "Bolt Action Rifle",
            "Eoka Pistol",
            "Semi-Automatic Pistol",
            "Rocket Launcher",
            "Waterpipe Shotgun",
            "Weapon Lasersight",
            "Silencer",
            "Holosight",
            "Semi-Automatic Rifle",
            "Thompson",
            "Revolver",
            "High External Stone Wall",
            "High External Stone Gate",
            "Code Lock",
            "Armored Door",
            "Pookie Bear",
            "Two Sided Ornate Hanging Sign",
            "Timed Explosive Charge",
            "Supply Signal",
            "Large Medkit",
            "Medical Syringe",
            "Bandage",
            "HV 5.56 Rifle Ammo",
            "Explosive 5.56 Rifle Ammo",
            "5.56 Rifle Ammo",
            "Pistol Bullet",
            " Incendiary 5.56 Rifle Ammo",
            "Auto Turret",
            "Rocket",
            "Blueprint Library",
            "Anti-Radiation Pills"
         ]
      },
     
    Last edited by a moderator: Jan 28, 2016
  18. That was it ill try to change it now bud :)
    [DOUBLEPOST=1453941946][/DOUBLEPOST]
    ok well it dont seem to make any difrence idk what els to do i have a twitch stream coming on in 2 days (m1ndr) so kinda need to plugint to work lol i hope there will be some way to sort this problem :)
     
  19. Hmm.. Wierd, there's nothing wrong with the GUIShop file, and you didnt change anything else or any other plugins ?
     
  20. how do i do the gui warp thing with zones? i tried it and nothin happened. The menu pops up with the icon, price and that stuff but i cant use it. tried the tp cmd and the stuff on the overview.