Jump to content

Problems with OnUseNPC

Closed 1.2.14

Hi, we have a problem, if I only put one NPC with a shop, then everything works, but with a second NPC that has a different shop, there are problems, but shops with items are available for every NPC

Failed to call hook 'OnUseNPC' on plugin 'Shop v1.2.14' (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.Shop.MainUi (BasePlayer player, System.Int32 catPage, System.Int32 shopPage, System.String search, System.Int32 searchPage, System.Boolean first, System.Boolean categories, System.Int32 iCategory) [0x00fae] in <203d0426e5884053b13a0644af3fb22f>:0 
  at Oxide.Plugins.Shop.OnUseNPC (BasePlayer npc, BasePlayer player) [0x00049] in <203d0426e5884053b13a0644af3fb22f>:0 
  at Oxide.Plugins.Shop.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00c83] in <203d0426e5884053b13a0644af3fb22f>:0 
  at (wrapper dynamic-method) Oxide.Plugins.CSharpPlugin.InvokeMethod_Patch1(object,Oxide.Core.Plugins.HookMethod,object[])
  at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <d5f57e12edfe4fa0b5c5dbdd9b51eff8>:0 
  at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <d5f57e12edfe4fa0b5c5dbdd9b51eff8>:0 </size>

And here is the config for it

Shop.json

Share this comment


Link to comment

Oh yes, I'm an idiot ^^

Can already say the error message is no longer displayed and with -1 (1.2.15+) in the price to hide is also possible.

I noticed, especially when it comes to the same basic items (other skins etc.) there are sometimes problems when opening the editing (the first item of the basic item is called up), here there might be a statement from ItemID when opening, SkinID, DisplayName/Title and Category a sensible way to use it.

Here are a few more suggestions:
- Permission to execute the chat command would be good (if you want to do this purely via NPC's)

Edited by Be_Mann

Share this comment


Link to comment
1.1m

Downloads

Total number of downloads.

5.6k

Customers

Total customers served.

80.8k

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.