Ability to set storage size based on permissionsSolved

Thanks for making this plugin!

It would be great if you would set size limits by group using permissions.

Thanks for the suggestion. How would permisisons be determined? By the owner of the car?

Which plugins are you using to spawn cars or set car ownership? I could possibly bake something into Spawn Modular Car for this, but a generic solution would probably work here too.

-----

I just implemented this locally (based on owner of the car) but I want to get some quick feedback on how this will be configured.

Here was my initial idea (maximum flexibility but possibly hard for dummies to configure). One of the advantages of this is if Facepunch changes the panel names, people can change it without touching the code (but the plugin would deserve to be patched anyway so not a great reason).

{
  "GlobalSettings": {
    "LootPanelName": "modularcar.storage",
    "StorageCapacity": 18
  },
  "PermissionBasedSettings": {
    "vip1": {
      "LootPanelName": "largewoodbox",
      "StorageCapacity": 30
    },
    "vip2": {
      "LootPanelName": "generic",
      "StorageCapacity": 36
    },
    "vip3": {
      "LootPanelName": "genericlarge",
      "StorageCapacity": 42
    }
  }
}​

Then you would grant a perm like largercarstorage.vip1. The "vip1" part can be whatever you want, the permission name will just follow the config. Could name it "42" or "7rows" or just "7" if you want.

-----

In the interest of making it easier to configure, I could automatically determine the loot panel name that has the closest capacity.

{
  "DefaultCapacity": 18,
  "CapacityByPermission": {
    "vip1": 30,
    "vip2": 36,
    "vip3": 42
  }
}​
In the interest of making it even simpler, I could remove the ability to configure the exact capacity and provide stock permissions based on row counts, like largercarstorage.5 for 5 rows. The Backpacks plugin does this. Then the config would only have DefaultCapacity.
Thanks for the quick and thorough response!

I like the backpack row approach. It works well and is understandable for storage.
Just released an update for this. Bumped the version to 2.0.0 since the LootPanelName option is no longer available, but previous configs should be compatible (covered this in thorough testing).
5f1792699e67b.jpg WhiteThunder
Just released an update for this. Bumped the version to 2.0.0 since the LootPanelName option is no longer available, but previous configs should be compatible (covered this in thorough testing).

Awesome thanks!!

Locked automatically