this is all I get, i have no idea where I can edit the values. =/
using System.Collections.Generic;
using System.Linq;
using System;
using UnityEngine;
namespace Oxide.Plugins
{
[Info("Stack Size Controller", "AnExiledGod", 1.4)]
[Description("Allows you to set the max stack size of every item.")]
public class StackSizeController : RustPlugin
{
public int PaperRequired { get { return Config.Get<int>("PaperRequired"); } }
protected override void LoadDefaultConfig()
{
PrintWarning("Creating a new configuration file.");
var gameObjectArray = FileSystem.LoadAll<GameObject>("Assets/", ".item");
var itemList = gameObjectArray.Select(x => x.GetComponent<ItemDefinition>()).Where(x => x != null).ToList();
foreach (var item in itemList)
{
if (item.condition.enabled && item.condition.max > 0) { continue; }
Config[item.displayName.english] = item.stackable;
}
}
void OnServerInitialized()
{
var dirty = false;
var itemList = SingletonComponent<ItemManager>.Instance.itemList;
foreach (var item in itemList)
{
if (item.condition.enabled && item.condition.max > 0) { continue; }
if (Config[item.displayName.english] == null)
{
Config[item.displayName.english] = item.stackable;
dirty = true;
}
item.stackable = (int)Config[item.displayName.english];
}
if (!dirty) { return; }
PrintWarning("Updating configuration file with new values.");
SaveConfig();
}
}
}
Stack Size Controller [Moved]
Discussion in 'Plugin Support' started by AnExiledGod, Jun 29, 2015.
-
-
[DOUBLEPOST=1436585653][/DOUBLEPOST] -
Hi is there a way to stack BP's?
Regard -
-
Call me stupid, but i go into the config file for the plugin and their is nothing to edit.
-
-
AnExiledGod updated Stack Size Controller with a new update entry:
Added the ability to update stack sizes in-game
[DOUBLEPOST=1437058437][/DOUBLEPOST]I forgot to say, you will need to give the "canChangeStackSize" permission to all non-admins that you want the commands given to. -
Getting a new error when I boot up the server,
Code:[Oxide] 9:46 PM [Error] Failed to call hook 'OnServerInitialized' on plugin 'Crafting Controller' (NullReferenceException: Object reference not set to an instance of an object) [Oxide] 9:46 PM [Debug] at Oxide.Plugins.CraftingController.OnServerInitialized () [0x00000] in <filename unknown>:0 at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Glo
-
That's also the Crafting Controller plugin, not Stack Size Controller.
-
I edited the stack sizes in the config file, saved and restarted and none of it takes effect. I didn't set anything higher than 1000000.
-
I cant get the /Stackall command get to work ?
I need to be ingame but keep saying command isnt vailid. -
Everything works fine... Except for the stacks for wood when I typed the command /stack wood 250000 It says Did you mean one of these? Then it lists a bunch of items with the word wood in it. I really need help my players are getting upset because they can only have 1000 wood!!!!!
-
Hey im new, where do i put the file?
[DOUBLEPOST=1437432297][/DOUBLEPOST]Hi, im new... where do i put the file? -
I get a glitch where I cant set the stack size of wood it just comes up with a message that says Did you mean this? And lists a bunch of items with the name wood in it
-
Doesn't work your plugin at all. Doesnt register commands either.
-
Wulf Community Admin
-
[7/23/2015 5:41:24 PM] [Oxide] 5:41 PM [Error] Error while compiling StackSizeController.cs(136,69): error CS0176: Static member `ItemManager.itemList' cannot be accessed with an instance reference, qualify it with a type name instead
-
same here
[Error] StackSizeController.cs(136,69): error CS0176: Static member `ItemManager.itemList' cannot be accessed with an instance reference, qualify it with a type name instead -
yup, same here, please fix! Thx