Jump to content

Error Index was out of range

Closed 1.37.2

So, I'm trying to create an item in a case that gives RP from the ServerRewards plugin. I must not be doing something right. here are my item objects within the Items key.

{
          "Display Name (for display in the interface)": "RP x100,000",
          "ID": 0,
          "Chance": 0.1,
          "Item type": "Command",
          "Image (if empty - the icon is taken by shortname) ": "https://i.imgur.com/nJqsuZT.png",
          "Display name (for the item) (if empty - standard)": "RP x100,000",
          "Shortname": "",
          "Skin": 0,
          "Amount (for item)": 1,
          "Command": "sr add {userid} 100000",
          "Plugin": {
            "Hook to call": "AddPoints",
            "Plugin name": "ServerRewards",
            "Amount": 100000
          }
        }

So I've tried to change the "Item Type" to "Command" and "Plugin", however I'm still getting this error message.

(04:51:03) | [Battlepass] Player TESTTEST (15613554565412) opened case Case 'Pirate Treasure' and received:
(04:51:03) | Failed to call hook 'CmdConsole' on plugin 'Battlepass v1.37.2' (ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index)
  at System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) [0x00029] in <fb001e01371b4adca20013e0ac763896>:0 
  at System.ThrowHelper.ThrowArgumentOutOfRangeException () [0x00000] in <fb001e01371b4adca20013e0ac763896>:0 
  at Oxide.Plugins.Battlepass.OpenCasesUI (BasePlayer player, System.Int32 page) [0x00812] in <374dc9ed40894549ab2529cdc65b68da>:0 
  at Oxide.Plugins.Battlepass.CmdConsole (ConsoleSystem+Arg arg) [0x004f6] in <374dc9ed40894549ab2529cdc65b68da>:0 
  at Oxide.Plugins.Battlepass.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x0187f] in <374dc9ed40894549ab2529cdc65b68da>:0 
  at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <09575a60985045248bcb43b20faeeb99>:0 
  at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <bae5f1223fce49c493b01571c99dce02>:0 
  at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <bae5f1223fce49c493b01571c99dce02>:0

Wondering if you could help point me in the right direction of getting this setup so I don't keep running into this issue.

FYI: The Item type of Item works just fine. Its only while I try to implement these Command bases items that i've having the issue.

 

Also, can you please explain to me what the ID key is compared to the Skin key? Can I just leave the first ID key a 0?

Share this comment


Link to comment

I'll have to check it out. Can you send me the complete item from the configuration?

Regarding the ID: it is an identifier that is used to index items to quickly find them. The ID must be unique among other items. Yes, it can be 0.

Share this comment


Link to comment

Close it. Don't know if its still relevant as I no longer own any servers. 😛 So I don't use the plugin.

Edited by BippyMiester

Share this comment


Link to comment
1.1m

Downloads

Total number of downloads.

5.7k

Customers

Total customers served.

82.7k

Files Sold

Total number of files sold.

1.6m

Payments Processed

Total payments processed.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.