Jump to content

Error returning a skill I created that grants permission from another plugin

Pending 2.1.4

DaEViL
DaEViL

Posted

I've created a new skill that gives you permission to put a codelock on horses; the code I added is this:

{
          "Enabled": true,
          "Skill ID": 59,
          "Skill Type": "PermissionGrant",
          "Title": "Bloqueo Caballos",
          "Description": "Posibilidad de bloquear tu caballo mediante un codelock, recuerda estar en permisos de armario y los componentes o un codelock para poder crear el bloqueo",
          "Image": "https://gitlab.com/TheMevent/PluginsStorage/raw/main/Images/Skills/Icons/Teleportation.png",
          "Permission": "",
          "Requirements to access skill": [],
          "Permission Grant Settings": {
            "Levels (each level grants its permission)": [
              {
                "Permission To Grant Player": "vehicledeployedlocks.codelock.ridablehorse",
                "Group To Grant Player": "",
                "Value": 0.0,
                "Cost": 300.0,
                "Permission": "",
                "Requirements to access level": []
              }
            ]
          }
        }

The permission is granted correctly, but when you try to remove that skill, it gives this error in the console and the plugin stops working.

Failed executing chat command 'skill' in 'Skills v2.1.4 by Mevent' [callback] (Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index)
   at PermissionGrantLevelEntry System.Collections.Generic.List<Oxide.Plugins.Skills+PermissionGrantLevelEntry>.get_Item(int index)
   at bool Oxide.Plugins.Skills.HasSkillsPlayerPermission(string playerId, string permission) in /home/6e2a8c12-5d52-4798/gameserver/gameserver/carbon/plugins/Skills.cs:line 11357
   at bool Oxide.Plugins.Skills+PermissionUserHasPermissionPatch.Prefix(ref bool __result, string id, string perm) in /home/6e2a8c12-5d52-4798/gameserver/gameserver/carbon/plugins/Skills.cs:line 11329
   at bool Oxide.Plugins.SkillsExtensionMethods.ExtensionMethods.HasPermission(string userID, string b) in /home/6e2a8c12-5d52-4798/gameserver/gameserver/carbon/plugins/Skills.cs:line 21620
   at bool Oxide.Plugins.SkillsExtensionMethods.ExtensionMethods.HasPermission(BasePlayer a, string b) in /home/6e2a8c12-5d52-4798/gameserver/gameserver/carbon/plugins/Skills.cs:line 21625
   at void Oxide.Plugins.Skills.CmdOpenSkills(IPlayer cov, string command, string[] args) in /home/6e2a8c12-5d52-4798/gameserver/gameserver/carbon/plugins/Skills.cs:line 11579
   at object System.Reflection.RuntimeMethodInfo.Invoke(object obj, BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture)

Can you tell me how to fix it?

MeventSupport

Posted

16 hours ago, DaEViL said:

I've created a new skill that gives you permission to put a codelock on horses; the code I added is this:

{
          "Enabled": true,
          "Skill ID": 59,
          "Skill Type": "PermissionGrant",
          "Title": "Bloqueo Caballos",
          "Description": "Posibilidad de bloquear tu caballo mediante un codelock, recuerda estar en permisos de armario y los componentes o un codelock para poder crear el bloqueo",
          "Image": "https://gitlab.com/TheMevent/PluginsStorage/raw/main/Images/Skills/Icons/Teleportation.png",
          "Permission": "",
          "Requirements to access skill": [],
          "Permission Grant Settings": {
            "Levels (each level grants its permission)": [
              {
                "Permission To Grant Player": "vehicledeployedlocks.codelock.ridablehorse",
                "Group To Grant Player": "",
                "Value": 0.0,
                "Cost": 300.0,
                "Permission": "",
                "Requirements to access level": []
              }
            ]
          }
        }

The permission is granted correctly, but when you try to remove that skill, it gives this error in the console and the plugin stops working.

Failed executing chat command 'skill' in 'Skills v2.1.4 by Mevent' [callback] (Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index)
   at PermissionGrantLevelEntry System.Collections.Generic.List<Oxide.Plugins.Skills+PermissionGrantLevelEntry>.get_Item(int index)
   at bool Oxide.Plugins.Skills.HasSkillsPlayerPermission(string playerId, string permission) in /home/6e2a8c12-5d52-4798/gameserver/gameserver/carbon/plugins/Skills.cs:line 11357
   at bool Oxide.Plugins.Skills+PermissionUserHasPermissionPatch.Prefix(ref bool __result, string id, string perm) in /home/6e2a8c12-5d52-4798/gameserver/gameserver/carbon/plugins/Skills.cs:line 11329
   at bool Oxide.Plugins.SkillsExtensionMethods.ExtensionMethods.HasPermission(string userID, string b) in /home/6e2a8c12-5d52-4798/gameserver/gameserver/carbon/plugins/Skills.cs:line 21620
   at bool Oxide.Plugins.SkillsExtensionMethods.ExtensionMethods.HasPermission(BasePlayer a, string b) in /home/6e2a8c12-5d52-4798/gameserver/gameserver/carbon/plugins/Skills.cs:line 21625
   at void Oxide.Plugins.Skills.CmdOpenSkills(IPlayer cov, string command, string[] args) in /home/6e2a8c12-5d52-4798/gameserver/gameserver/carbon/plugins/Skills.cs:line 11579
   at object System.Reflection.RuntimeMethodInfo.Invoke(object obj, BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture)

Can you tell me how to fix it?

We will release an update soon that will include a fix for this as well

  • Love 1
DaEViL

Posted

Granting permission works fine, but it fails when removing any permission by returning the skill.

2.2m

Downloads

Total number of downloads.

10.3k

Customers

Total customers served.

149.4k

Files Sold

Total number of files sold.

3.2m

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.