Failed to call hook 'OnServerInitialized' on plugin 'CupboardLimiter v1.6.2' (NullReferenceException: Object reference not set to an instance of an object)
at Oxide.Plugins.CupboardLimiter.OnServerInitialized () [0x00000] in <967c21d43f5e4539812ee0146c1229e7>:0
at Oxide.Plugins.CupboardLimiter.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x001a7] in <967c21d43f5e4539812ee0146c1229e7>:0
at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in :0
at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <50629aa0e75d4126b345d8d9d64da28d>:0
at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <50629aa0e75d4126b345d8d9d64da28d>:0
NullReferenceException at OnServerInitializedSolved
Do you have any other message from the plugin ? Like an error during config loading ?
None.
Do you change anything to the configuration ? Or does it crash for the first ever load ?
Here is my config file. Is it possible that by putting value of -1 for unlimited on VIP and Others, this is causing the error? If it is, is there another method to place no limit on VIP/Others while still having a default limit?
{
"Max amount of TC(s) to place": {
"Limit Default": 3,
"Limit Vip": -1,
"Limit Others": [
-1
],
"Limit Others Can Downgrade Default": false,
"Global Team Limit": true,
"Limits In Team": {4}
},
"Discord Notification": {
"Discord Webhook URL": ""
},
"Chat Settings": {
"Prefix": "[Cupboard Limiter] :",
"Icon's SteamId": 76561############
}
}
Hello,
The error is the limits in team. You need to put {"2":4} in place of the {4} to restrict TCs to 4 when having a team of 2 players or more.
But the -1 limit is not a valid value. You need to set a positive value.
The "Limit Others" is used if you want to add a large set of differents limits (and need to grant the cupboardlimiter.limit_1 for it to be applied, where 1 is the index of the array starting at one)
Also, you can grant the "cupboardlimiter.bypass" permission to disable TC restriction.
Keep in mind that Team limit take over the VIP permission if the member is in a team. But the bypass perm is over anything else (and is probably what you want if you want a "no limit")
(22:35:31) | Permission 'cupboardlimiter.bypass' doesn't exist
(22:37:13) | Permission 'cupboardlimiter.bypass' doesn't exist
If the plugin is not loaded correctly, that's normal. Permissions are registered after the config is loaded.
The config file need to be fixed first.
I did make the corrections you suggested above. Changed the "Limit Others" value to 50 and changed the team to exactly what you wrote "{"2":4}. It is now working correctly. Thank you for taking the time to help me! I appreciate you.
Glad it works.
Have a good day