Still the same, not working.

GUI Shop
GUI Shop based on Economics. Supports NPC
Total Downloads: 11,480 - First Release: Aug 29, 2015 - Last Update: May 3, 2018
- 5/5, 38 likes
-
-
Hello guys, i get errors in the RCON Console, everytime i buy / sell something.
If someone buys anything:
Code:[GUIShop] Player: Maik8 Buyed Item: apple x1 Failed to call hook 'ccmdShopBuy' on plugin 'GUIShop v1.4.2' (NullReferenceException: Object reference not set to an instance of an object) at Oxide.Plugins.GUIShop.TryShopBuy (.BasePlayer player, System.String shop, System.String item, Int32 amount) [0x00000] in <filename unknown>:0 at Oxide.Plugins.GUIShop.ccmdShopBuy (.Arg arg) [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 (Oxide.Core.Plugins.HookMethod 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 hook, System.Object[] args) [0x00000] in <filename unknown>:0
Code:[GUIShop] Player: Maik8 Selled Item: apple x1 Failed to call hook 'ccmdShopSell' on plugin 'GUIShop v1.4.2' (NullReferenceException: Object reference not set to an instance of an object) at Oxide.Plugins.GUIShop.TryShopSell (.BasePlayer player, System.String shop, System.String item, Int32 amount) [0x00000] in <filename unknown>:0 at Oxide.Plugins.GUIShop.ccmdShopSell (.Arg arg) [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 (Oxide.Core.Plugins.HookMethod 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 hook, System.Object[] args) [0x00000] in <filename unknown>:0
But i would like to get rid of the error message each time someone sells / buys something.
Installed Plugins (all up to date):
Code:01 "AntiLootDespawn" (1.1.2) by Bamabo (0.41s) - AntiLootDespawn.cs 02 "AutoDoors" (3.1.2) by Wulf/lukespragg (0.01s) - AutoDoors.cs 03 "Automatic Build Grades" (0.0.22) by AlexALX (0.01s) - AutoGrades.cs 04 "AutomaticAuthorization" (0.1.8) by k1lly0u (0.00s) - AutomaticAuthorization.cs 05 "AutoPurge" (1.6.1) by Fujikura/Norn (1.16s) - AutoPurge.cs 06 "Better Chat" (5.0.14) by LaserHydra (0.04s) - BetterChat.cs 07 "Better Say" (2.0.4) by LaserHydra (0.14s) - BetterSay.cs 08 "BlockStructure" (1.0.3) by Marat (0.00s) - BlockStructure.cs 09 "BuildingBlocker" (2.4.0) by Vlad-00003 (0.01s) - BuildingBlocker.cs 10 "BypassQueue" (1.0.1) by Nogrod (0.00s) - BypassQueue.cs 11 "Cancer" (0.1.0) by Satan9 (0.00s) - Cancer.cs 12 "Clans" (0.1.51) by k1lly0u (0.02s) - Clans.cs 13 "ConnectMessages" (1.1.8) by Spicy (0.01s) - ConnectMessages.cs 14 "Copy Paste" (3.4.5) by Reneb (0.01s) - CopyPaste.cs 15 "Crafting Controller" (2.4.7) by Mughisi (0.01s) - CraftingController.cs 16 "CustomChatCommands" (2.1.0) by PsychoTea (0.01s) - CustomChatCommands.cs 17 "CustomLootSpawns" (0.2.5) by k1lly0u (0.81s) - CustomLootSpawns.cs 18 "Death Notes" (5.2.13) by LaserHydra (0.48s) - DeathNotes.cs 19 "EasyVote" (1.2.9) by Exel80 (0.01s) - EasyVote.cs 20 "Economics" (2.0.5) by Nogrod (0.28s) - Economics.cs 21 "Event Manager Menu Interface" (1.0.5) by k1lly0u (0.03s) - EMInterface.cs 22 "Event Manager" (3.0.73) by Reneb / k1lly0u (0.07s) - EventManager.cs 23 "ArenaDeathmatch" (1.2.22) by Reneb (0.01s) - ArenaDeathmatch.cs 24 "GunGame" (0.4.22) by k1lly0u (0.03s) - GunGame.cs 25 "Enhanced Hammer" (1.3.4) by Fuji/Visa (0.01s) - EnhancedHammer.cs 26 "Entity Limit" (0.6.0) by PaiN (0.52s) - EntityLimit.cs 27 "FancyDrop" (2.6.22) by Fujikura (1.72s) - FancyDrop.cs 28 "FriendlyFire" (2.0.3) by Nogrod (0.55s) - FriendlyFire.cs 29 "Friends" (2.2.4) by Nogrod (0.00s) - Friends.cs 30 "Furnace Splitter" (2.1.2) by Skipcast (2.87s) - FurnaceSplitter.cs 31 "Gathering Manager" (2.2.6) by Mughisi (0.03s) - GatherManager.cs 32 "Gather Rewards" (1.4.4) by CanopySheep (0.09s) - GatherRewards.cs 33 "GUIAnnouncements" (1.23.83) by JoeSheep (0.69s) - GUIAnnouncements.cs 34 "GUIShop" (1.4.2) by Nogrod / Reneb (0.48s) - GUIShop.cs 35 "HandyMan" (1.0.6) by nivex (0.01s) - HandyMan.cs 36 "HeliControl" (1.2.4) by Shady (1.25s) - HeliControl.cs 37 "HitIcon" (1.5.5) by serezhadelaet (0.03s) - HitIcon.cs 38 "ImageLibrary" (2.0.8) by Absolut & K1lly0u (0.01s) - ImageLibrary.cs 39 "InfoPanel" (0.9.5) by Ghosst / Nogrod (4.58s) - InfoPanel.cs 40 "Item Skin Randomizer" (1.3.2) by Mughisi (0.01s) - ItemSkinRandomizer.cs 41 "Kits" (3.2.9) by Reneb (1.30s) - Kits.cs 42 "Logger" (2.1.0) by Wulf/lukespragg (0.19s) - Logger.cs 43 "Magic Description" (1.3.1) by Wulf/lukespragg (0.03s) - MagicDescription.cs 44 "Metabolism" (2.6.0) by Wulf/lukespragg (0.74s) - Metabolism.cs 45 "NightLantern" (2.0.8) by k1lly0u (0.47s) - NightLantern.cs 46 "NoDecay" (1.0.13) by Deicide666ra/Piarb (1.55s) - NoDecay.cs 47 "NoFuelRequirements" (1.3.5) by k1lly0u (0.04s) - NoFuelRequirements.cs 48 "NoGiveNotices" (0.1.0) by Wulf/lukespragg (0.00s) - NoGiveNotices.cs 49 "NoSeedGrief" (1.0.2) by mvrb (0.00s) - NoSeedGrief.cs 50 "NTeleportation" (1.0.21) by Nogrod (0.77s) - NTeleportation.cs 51 "ObjectRemover" (2.1.7) by Wolfs Darker (0.01s) - ObjectRemover.cs 52 "Private Messages" (0.4.0) by PaiN (0.00s) - PrivateMessages.cs 53 "QuickSmelt" (3.0.3) by Wulf/Fujikura (0.10s) - QuickSmelt.cs 54 "QuickSort" (1.1.1) by Wulf/lukespragg (0.64s) - QuickSort.cs 55 "RandomDeployables" (0.1.9) by Norn (0.00s) - RandomDeployables.cs 56 "RemoverTool" (4.1.11) by Reneb (0.02s) - RemoverTool.cs 57 "Rock Block" (1.1.0) by Nogrod (0.00s) - RockBlock.cs 58 "Rules GUI" (1.4.9) by PaiN (0.29s) - RulesGUI.cs 59 "Sign Artist" (0.3.3) by Nogrod / Bombardir (0.00s) - SignArtist.cs 60 "Simple Loot" (1.0.4) by Jacob (2.01s) - SimpleLoot.cs 61 "Skins" (1.2.9) by MalkoR (246.17s) - Skins.cs 62 "SkipNightUI" (0.1.2) by k1lly0u (0.26s) - SkipNightUI.cs 63 "SleeperAnimalProtection" (1.0.0) by Fujikura (0.26s) - SleeperAnimalProtection.cs 64 "Smart Chat Bot" (1.6.0) by i_love_code (0.00s) - SmartChatBot.cs 65 "Spawns" (2.0.35) by Reneb / k1lly0u (0.01s) - Spawns.cs 66 "Spectate" (0.4.2) by Wulf/lukespragg (0.00s) - Spectate.cs 67 "Stack Size Controller" (1.9.8) by Canopy Sheep (0.04s) - StackSizeController.cs 68 "StorageCleaner" (0.1.1) by k1lly0u (0.00s) - StorageCleaner.cs 69 "StrikeSystem" (2.1.3) by LaserHydra (0.00s) - StrikeSystem.cs 70 "Timed Execute" (0.7.3) by PaiN (0.85s) - TimedExecute.cs 71 "TimeOfDay" (2.3.2) by Fujikura (0.00s) - TimeOfDay.cs 72 "TurretConfig" (2.0.4) by Calytic (9.35s) - TurretConfig.cs 73 "Updater" (2.1.1) by LaserHydra (0.01s) - Updater.cs 74 "Vanish" (0.4.1) by Wulf/lukespragg (16.23s) - Vanish.cs 75 "VIP Trial" (1.3.2) by Maik8 (0.00s) - VIPTrial.cs 76 "VisualCupboard" (1.0.10) by Colon Blow (221.12s) - VisualCupboard.cs 77 "Water Limits" (3.0.1) by Wulf/lukespragg (0.00s) - WaterLimits.cs 78 "Weather Controller" (1.4.1) by Waizujin (0.00s) - WeatherController.cs 79 "ZLevelsRemastered" (2.9.0) by Fujikura/Visagalis (3.18s) - ZLevelsRemastered.cs 80 "ZoneDomes" (0.1.4) by k1lly0u (0.56s) - ZoneDomes.cs 81 "ZoneManager" (2.4.3) by Reneb / Nogrod (5.35s) - ZoneManager.cs
Thanks in advance!Attached Files:
-
-
Would anyone please provide me with a config file for this? ill even pay for it if you must.......i just dont have the time or patience to config this ...........pretty please?
-
Hi,
When I reload the plugin:
Code:07:43 [Error] Failed to call hook 'OnServerInitialized' on plugin 'GUIShop v1.4.2' (ArgumentException: An element with the same key already exists in the dictionary.) 07:43 [Stacktrace] at System.Collections.Generic.Dictionary`2[System.String,System.String].Add (System.String key, System.String value) [0x00000] in <filename unknown>:0 at Oxide.Plugins.GUIShop.OnServerInitialized () [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 (Oxide.Core.Plugins.HookMethod 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 hook, System.Object[] args) [0x00000] in <filename unknown>:0 07:43 [Info] Loaded plugin GUIShop v1.4.2 by Nogrod / Reneb
-
Attached Files:
-
-
Yea I use the latest version -
hey man i'm not able to see items when i type /shop command need some help here if u are available. i'm new to this plugin.
-
"LLamar Heli": {
"buy": "1000",
"img": "https://vignette.wikia.nocookie.net...ey_icon.png/revision/latest?cb=20151106061804",
"cmd": ["callheli"],
"cmd": ["say Un jugador ha pagado para que salga el heli"],
"cooldown": "0",
"sell": "0"
},
only work 2º cmd :-(
EUREKA !!
"LLamar Heli": {
"buy": "1000",
"img": "https://vignette.wikia.nocookie.net...ey_icon.png/revision/latest?cb=20151106061804",
"cmd": ["callheli", "say Un jugador ha pagado para que salga el heli"],
"cooldown": "0",
"sell": "0"
},Last edited by a moderator: Oct 31, 2017 -
how i add water bottle with water? the item in the shop is empty
-
ok I am having an issue with GUIshop were the config keeps breaking and I dont know whats wrong with it. I have looked at it over 100 times and cant figuer out what or where it is broken. Can I possible get a second pair of eyes to that can tell me were it is broken? Mind you I am only trying to use the /shop command
Attached Files:
-
-
Code:{ "Message - Bought": "You've successfully bought {0}x {1}", "Message - Error - Building Blocked": "You cannot shop while in building blocked area.", "Message - Error - Command Multiple": "Can't buy multiple", "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 - Not Nothing": "You cannot buy nothing of this item.", "Message - Error - Redeem Kit": "WARNING: There was an error while giving you this kit", "Message - Sold": "You've successfully sold {0}x {1}", "Shop - Balance": false, "Shop - Shop Categories": { "12 Gauge Buckshot": { "buy": "15", "img": "[URL]https://vignette.wikia.nocookie.net/play-rust/images/2/2f/12_Gauge_Buckshot_icon.png/revision/latest/scale-to-width-down/50?cb=20151106061114[/URL]", "item": "ammo.shotgun" }, "12 Gauge Slug": { "buy": "15", "img": "[URL]https://vignette.wikia.nocookie.net/play-rust/images/1/1a/12_Gauge_Slug_icon.png/revision/latest/scale-to-width-down/50?cb=20151106061838[/URL]", "item": "ammo.shotgun.slug" }, "5.56 Rifle Ammo": { "buy": "20", "img": "[URL]https://vignette.wikia.nocookie.net/play-rust/images/4/49/5.56_Rifle_Ammo_icon.png/revision/latest/scale-to-width-down/50?cb=20150405103333[/URL]", "item": "ammo.rifle" }, "Anti-Radiation Pills": { "buy": "150", "img": "[URL]https://vignette.wikia.nocookie.net/play-rust/images/0/0e/Anti-Radiation_Pills_icon.png/revision/latest/scale-to-width-down/100?cb=20151106060926[/URL]", "item": "antiradpills", "sell": "10" }, "Assault Rifle": { "buy": "7000", "img": "[URL]https://vignette.wikia.nocookie.net/play-rust/images/d/d1/Assault_Rifle_icon.png/revision/latest/scale-to-width-down/100?cb=20160211200609[/URL]", "item": "rifle.ak", "sell": "250" }, "Explosive 5.56 Rifle Ammo": { "buy": "25", "img": "[URL]https://vignette.wikia.nocookie.net/play-rust/images/3/31/Explosive_5.56_Rifle_Ammo_icon.png/revision/latest/scale-to-width-down/50?cb=20151106061449[/URL]", "item": "ammo.rifle.explosive" }, "Handmade Shell": { "buy": "15", "img": "[URL]https://vignette.wikia.nocookie.net/play-rust/images/0/0d/Handmade_Shell_icon.png/revision/latest/scale-to-width-down/50?cb=20151106061522[/URL]", "item": "ammo.handmade.shell" }, "High Velocity Rocket": { "buy": "75", "img": "[URL]https://vignette.wikia.nocookie.net/play-rust/images/f/f4/High_Velocity_Rocket_icon.png/revision/latest/scale-to-width-down/50?cb=20151106054436[/URL]", "item": "ammo.rocket.hv" }, "HV 5.56 Rifle Ammo": { "buy": "20", "img": "[URL]https://vignette.wikia.nocookie.net/play-rust/images/d/df/HV_5.56_Rifle_Ammo_icon.png/revision/latest/scale-to-width-down/50?cb=20150612151932[/URL]", "item": "ammo.rifle.hv" }, "HV Pistol Ammo": { "buy": "10", "img": "[URL]https://vignette.wikia.nocookie.net/play-rust/images/e/e5/HV_Pistol_Ammo_icon.png/revision/latest/scale-to-width-down/50?cb=20151106061857[/URL]", "item": "ammo.pistol.hv" }, "Incendiary 5.56 Rifle Ammo": { "buy": "25", "img": "[URL]https://vignette.wikia.nocookie.net/play-rust/images/e/e1/Incendiary_5.56_Rifle_Ammo_icon.png/revision/latest/scale-to-width-down/50?cb=20160211200254[/URL]", "item": "ammo.rifle.incendiary" }, "Incendiary Pistol Bullet": { "buy": "15", "img": "[URL]https://vignette.wikia.nocookie.net/play-rust/images/3/31/Incendiary_Pistol_Bullet_icon.png/revision/latest/scale-to-width-down/50?cb=20151106054326[/URL]", "item": "ammo.pistol.fire" }, "Incendiary Rocket": { "buy": "80", "img": "[URL]https://vignette.wikia.nocookie.net/play-rust/images/f/f9/Incendiary_Rocket_icon.png/revision/latest/scale-to-width-down/50?cb=20151106061939[/URL]", "item": "ammo.rocket.fire" }, "Large Medkit": { "buy": "350", "img": "[URL]https://vignette.wikia.nocookie.net/play-rust/images/9/99/Large_Medkit_icon.png/revision/latest/scale-to-width-down/100?cb=20151106054425[/URL]", "item": "largemedkit", "sell": "25" }, "LR-300 Assault Rifle": { "buy": "9000", "img": "[URL]https://vignette.wikia.nocookie.net/play-rust/images/d/d9/LR-300_Assault_Rifle_icon.png/revision/latest/scale-to-width-down/100?cb=20160901064335[/URL]", "item": "rifle.lr300", "sell": "4000" }, "M249": { "buy": "10000", "img": "[URL]https://vignette.wikia.nocookie.net/play-rust/images/c/c6/M249_icon.png/revision/latest/scale-to-width-down/100?cb=20151112221315[/URL]", "item": "lmg.m249", "sell": "5000" }, "M92 Pistol": { "buy": "6000", "img": "[URL]https://vignette.wikia.nocookie.net/play-rust/images/4/43/M92_Pistol_icon.png/revision/latest/scale-to-width-down/100?cb=20161202144022[/URL]", "item": "pistol.m92", "sell": "1000" }, "Medical Syringe": { "buy": "250", "img": "[URL]https://vignette.wikia.nocookie.net/play-rust/images/9/99/Medical_Syringe_icon.png/revision/latest/scale-to-width-down/100?cb=20151106061059[/URL]", "item": "syringe.medical", "sell": "25" }, "Metal Fragments": { "buy": "100", "img": "[URL]https://vignette4.wikia.nocookie.net/play-rust/images/7/74/Metal_Fragments_icon.png/revision/latest?cb=20151106061759[/URL]", "item": "metal.fragments" }, "MP5A4": { "buy": "7000", "img": "[URL]https://vignette.wikia.nocookie.net/play-rust/images/c/c0/MP5A4_icon.png/revision/latest/scale-to-width-down/100?cb=20161013162633[/URL]", "item": "smg.mp5", "sell": "250" }, "Pistol Bullet": { "buy": "10", "img": "[URL]https://vignette.wikia.nocookie.net/play-rust/images/9/9b/Pistol_Bullet_icon.png/revision/latest/scale-to-width-down/50?cb=20151106061928[/URL]", "item": "ammo.pistol" }, "Pump Shotgun": { "buy": "6000", "img": "[URL]https://vignette.wikia.nocookie.net/play-rust/images/6/60/Pump_Shotgun_icon.png/revision/latest/scale-to-width-down/100?cb=20160310205718[/URL]", "item": "shotgun.pump", "sell": "1000" }, "Rocket": { "buy": "75", "img": "[URL]https://vignette.wikia.nocookie.net/play-rust/images/9/95/Rocket_icon.png/revision/latest/scale-to-width-down/50?cb=20151106061039[/URL]", "item": "ammo.rocket.basic" }, "Rocket Launcher": { "buy": "8000", "img": "[URL]https://vignette.wikia.nocookie.net/play-rust/images/0/06/Rocket_Launcher_icon.png/revision/latest/scale-to-width-down/100?cb=20151106061852[/URL]", "item": "rocket.launcher", "sell": "500" } }, "Shop - Shop Icon Url": "", "Shop - Shop List": { "chat": { "buy": [ "M92 Pistol", "Pump Shotgun", "MP5A4", "Assault Rifle", "Rocket Launcher", "LR-300 Assault Rifle", "M249", "Medical Syringe", "Anti-Radiation Pills", "Large Medkit", "Wood", "Stones", "Metal Fragments", "12 Gauge Buckshot", "12 Gauge Slug", "5.56 Rifle Ammo", "Explosive 5.56 Rifle Ammo", "Handmade Shell", "High Velocity Rocket", "HV 5.56 Rifle Ammo", "HV Pistol Ammo", "Incendiary 5.56 Rifle Ammo", "Incendiary Pistol Bullet", "Incendiary Rocket", "Pistol Bullet", "Rocket", "Smoke Rocket" ], "description": "You currently have {0} coins to spend in this shop", "name": "Scrap Shop", "sell": [ "M92 Pistol", "Pump Shotgun", "MP5A4", "Assault Rifle", "Rocket Launcher", "LR-300 Assault Rifle", "M249", "Medical Syringe", "Anti-Radiation Pills", "Large Medkit" ] } } }
Last edited by a moderator: Nov 8, 2017 -
Thank you very much I was starting to lose it
-
Can someone help me please, i was trying to call the function "showshop" with edited var "from" to switch shoppage view by pressing new buttons tha ti've inserted in GUI, but none of buttons do a thing, i've tried also to modify the initialisation of "current = 0" value to "current = -form" and nothing happens exept when i modify manually "current" value, but frst i need to know if my buttons can respond on click.
Im beginning in plugin developpement and sorry for my bad eng.
Code:private static CuiElementContainer CreateShopChangePage(string currentshop, int shoppageminus, int shoppageplus) { return new CuiElementContainer { { new CuiButton { Button = {Command = $"shop.show {currentshop} {shoppageminus}", Color = "0.5 0.5 0.5 0.2"}, RectTransform = {AnchorMin = "0.2 0.15", AnchorMax = "0.3 0.2"}, Text = {Text = "<<", FontSize = 20, Align = TextAnchor.MiddleCenter} }, ShopOverlayName, "ButtonBack" }, { new CuiButton { Button = {Command = $"shop.show {currentshop} {shoppageplus}", Color = "0.5 0.5 0.5 0.2"}, RectTransform = {AnchorMin = "0.35 0.15", AnchorMax = "0.45 0.2"}, Text = {Text = ">>", FontSize = 20, Align = TextAnchor.MiddleCenter} }, ShopOverlayName, "ButtonForward" }, { new CuiButton { //var min = 7; //var max = 14; Button = {Command = $"ShowShop(,,30,) {currentshop} ", Color = "0.5 0.5 0.5 0.5"}, //Button = {page1 = ShopOverlayName, Color = "0.5 0.5 0.5 0.5"}, RectTransform = {AnchorMin = "0.2 0.67", AnchorMax = "0.24 0.72"}, Text = {Text = "1", FontSize = 20, Align = TextAnchor.MiddleCenter} }, ShopOverlayName, "page1" }, { new CuiButton { Button = {Command = $"ShowShop(player, currentshop, 8, true, false)", Color = "0.5 0.5 0.5 0.5"}, RectTransform = {AnchorMin = "0.25 0.67", AnchorMax = "0.29 0.72"}, Text = {Text = "2", FontSize = 20, Align = TextAnchor.MiddleCenter} }, ShopOverlayName, "page2" }, { new CuiButton { Button = {Command = $"ShowShop(player, currentshop, 15, true, false)", Color = "0.5 0.5 0.5 0.5"}, RectTransform = {AnchorMin = "0.3 0.67", AnchorMax = "0.34 0.72"}, Text = {Text = "3", FontSize = 20, Align = TextAnchor.MiddleCenter} }, ShopOverlayName, "page3" }, { new CuiButton { Button = {Command = $"ShowShop(player, currentshop, 22, true, false))", Color = "0.5 0.5 0.5 0.5"}, RectTransform = {AnchorMin = "0.35 0.67", AnchorMax = "0.39 0.72"}, Text = {Text = "4", FontSize = 20, Align = TextAnchor.MiddleCenter} }, ShopOverlayName, "page4" }, { new CuiButton { Button = {Command = $"ShowShop(player, currentshop, 29, true, false)", Color = "0.5 0.5 0.5 0.5"}, RectTransform = {AnchorMin = "0.4 0.67", AnchorMax = "0.44 0.72"}, Text = {Text = "5", FontSize = 20, Align = TextAnchor.MiddleCenter} }, ShopOverlayName, "page5" }, { new CuiButton { Button = {Command = $"ShowShop(player, currentshop, 36, true, false)", Color = "0.5 0.5 0.5 0.5"}, RectTransform = {AnchorMin = "0.45 0.67", AnchorMax = "0.49 0.72"}, Text = {Text = "6", FontSize = 20, Align = TextAnchor.MiddleCenter} }, ShopOverlayName, "page6" }, { new CuiButton { Button = {Command = $"ShowShop(player, currentshop, 43, true, false)", Color = "0.5 0.5 0.5 0.5"}, RectTransform = {AnchorMin = "0.5 0.67", AnchorMax = "0.54 0.72"}, Text = {Text = "7", FontSize = 20, Align = TextAnchor.MiddleCenter} }, ShopOverlayName, "page7" }, { new CuiButton { Button = {Command = $"ShowShop(player, currentshop, 50, true, false)", Color = "0.5 0.5 0.5 0.5"}, RectTransform = {AnchorMin = "0.55 0.67", AnchorMax = "0.59 0.72"}, Text = {Text = "8", FontSize = 20, Align = TextAnchor.MiddleCenter} }, ShopOverlayName, "page8" }, { new CuiButton { Button = {Command = $"ShowShop(player, currentshop, 57, true, false)", Color = "0.5 0.5 0.5 0.5"}, RectTransform = {AnchorMin = "0.6 0.67", AnchorMax = "0.64 0.72"}, Text = {Text = "9", FontSize = 20, Align = TextAnchor.MiddleCenter} }, ShopOverlayName, "page9" }, { new CuiButton { Button = {Command = $"ShowShop(player, currentshop, 64, true, false)", Color = "0.5 0.5 0.5 0.5"}, RectTransform = {AnchorMin = "0.65 0.67", AnchorMax = "0.69 0.72"}, Text = {Text = "10", FontSize = 20, Align = TextAnchor.MiddleCenter} }, ShopOverlayName, "page10" }, }; } readonly Hash<ulong, int> shopPage = new Hash<ulong, int>(); private Dictionary<ulong, Dictionary<string, double>> cooldowns; private Dictionary<string, ulong> buyed; private Dictionary<string, ulong> selled; private bool configChanged; void ShowShop(BasePlayer player, string shopid, int from, bool fullPaint = true, bool refreshMoney = false) { shopPage[player.userID] = from; object shopObj; if (!Shops.TryGetValue(shopid, out shopObj)) { SendReply(player, MessageErrorNoShop); return; } if (Economics == null) { SendReply(player, MessageShowNoEconomics); return; } var playerCoins = (double) Economics.CallHook("GetPlayerMoney", player.userID); var shop = (Dictionary<string, object>) shopObj; shopDescription.Text.Text = string.Format((string) shop["description"], playerCoins); if (refreshMoney) { CuiHelper.DestroyUi(player, ShopDescOverlay); CuiHelper.AddUi(player, new CuiElementContainer { { shopDescription, ShopOverlayName, ShopDescOverlay } }); return; } DestroyUi(player, fullPaint); CuiElementContainer container; if (fullPaint) { container = CreateShopOverlay((string) shop["name"]); container.Add(shopDescription, ShopOverlayName, ShopDescOverlay); } else container = new CuiElementContainer(); container.Add(new CuiPanel { Image = { Color = "0 0 0 0" }, RectTransform = { AnchorMin = "0 0.2", AnchorMax = "1 0.6" } }, ShopOverlayName, ShopContentName); if (from < 0) { CuiHelper.AddUi(player, container); return; } var itemslist = new Dictionary<string, Dictionary<string, bool>>(); object type; if (shop.TryGetValue("sell", out type)) { foreach (string itemname in (List<object>)type) { Dictionary<string, bool> itemEntry; if (!itemslist.TryGetValue(itemname, out itemEntry)) itemslist[itemname] = itemEntry = new Dictionary<string, bool>(); itemEntry["sell"] = true; } } if (shop.TryGetValue("buy", out type)) { foreach (string itemname in (List<object>)type) { Dictionary<string, bool> itemEntry; if (!itemslist.TryGetValue(itemname, out itemEntry)) itemslist[itemname] = itemEntry = new Dictionary<string, bool>(); itemEntry["buy"] = true; } } // from=35; var current = (-from); foreach (var pair in itemslist) { ItemData data; if (!ShopCategories.TryGetValue(pair.Key, out data)) continue; if (current >= from && current < from + 7) { var pos = 0.85f - 0.125f * (current - from); var cooldown = data.Cooldown > 0; var name = pair.Key; if (cooldown) name += $" ({FormatTime((long)data.Cooldown)})"; container.AddRange(CreateShopItemIcon(name, pos + 0.125f, pos, data)); var buyed = false; if (cooldown) { Dictionary<string, double> itemCooldowns; double itemCooldown; if (cooldowns.TryGetValue(player.userID, out itemCooldowns) && itemCooldowns.TryGetValue(pair.Key, out itemCooldown) && itemCooldown > CurrentTime()) { buyed = true; container.Add(new CuiLabel { Text = {Text = GetBuyPrice(data).ToString(), FontSize = 15, Align = TextAnchor.MiddleLeft}, RectTransform = {AnchorMin = $"0.45 {pos}", AnchorMax = $"0.5 {pos + 0.125f}"} }, ShopContentName); container.Add(new CuiLabel { Text = {Text = FormatTime((long)(itemCooldown - CurrentTime())), FontSize = 15, Align = TextAnchor.MiddleLeft}, RectTransform = {AnchorMin = $"0.5 {pos}", AnchorMax = $"0.6 {pos + 0.125f}"} }, ShopContentName); //current++; //continue; } } if (!buyed && pair.Value.ContainsKey("buy")) container.AddRange(CreateShopItemEntry(GetBuyPrice(data).ToString(), pos + 0.125f, pos, $"'{shopid}'", $"'{pair.Key}'", "0 0.6 0 0.1", false, cooldown)); if (pair.Value.ContainsKey("sell")) container.AddRange(CreateShopItemEntry(GetSellPrice(data).ToString(), pos + 0.125f, pos, $"'{shopid}'", $"'{pair.Key}'", "1 0 0 0.1", true, cooldown)); } current++; } var minfrom = from <= 7 ? 0 : from - 7; var maxfrom = from + 7 >= current ? from : from + 7; container.AddRange(CreateShopChangePage(shopid, minfrom, maxfrom)); CuiHelper.AddUi(player, container); }
Last edited by a moderator: Nov 4, 2017 -
Is there a way to use this plugin so that certain groups have access to more items?
Like VIP's can buy different items than general players. -
-
It is possible that saved in a log who and product buys in the store ??
-
-
-
This is a shop showing 10 items on 1 single page
Last edited by a moderator: Nov 8, 2017