Closed Eth4ck1e closed 3 years ago
I see the problem, would be great to see this fixed. However you can also use world guard and set a flag for permissions within a region or world to give players a class permission per arena, rather than using console commands. That should work too.
Interesting, I never considered using worldguard for that... I will have to see how that can be done. Thanks for the suggestion! Is this done via worldguard directly or an addon to worldguard? I don't see a flag for granting/removing perms when entering or leaving a region anywhere in their documentation.
To add to this issue, it is not working for multiple players as intended. Even with "Console_Commands_For_Each: true" it is only running commands under the console for the first player that joins. I can see the issue with this as well, it seems it is only designed to trigger once, not each time a player joins. It would be very helpful to have a player join option so that class perms can be given per player instead of just the first player to start the lobby. seems like a simple oversight since there is already a player leave option.
Thank you LeehamElectronics for your recommendation. I was able to achieve the desired effect using the worldguard extra flags plugin and setting the commands for console-command-on-entry/exit. For anyone else looking to replicate this setup follow the FAQ. If the command is not working then you need to set the bypass perm in the FAQ to false as it says, and then everything should work. Now everyone entering the region for my arena has access only to the classes they have perms for and a per arena class system is setup.
Right now I don't have the resources to look into this but I may in the future, please use LeehamElectronics's suggestion until then.
Simple: when adding perms "corearena.class.[classname] true" using the console command options in the arena config it gives the player perms successfully but the class does not show up when the player joins the lobby. It will only show when the player closes the auto launched class menu and opens the menu again manually. This must just be an order of operations issue where the console command at the start of the lobby is running after the command to launch the class menu.
More details: Using the including console command features per arena allows some really awesome customization and as far as I am concerned it fixes any issues regarding arena-specific classes by setting the perms for each class when a player joins the lobby and removing it at the arena start or leave/end/finish. All my perms code works as it should. Meaning players will get a random class from the classes they have been given perms to if none are selected and right-clicking a [class] sign works as expected for all classes that the command gave perms for. It also consistently removes the perms as expected when the arena starts or stops. Meaning the players only get the perms while in the lobby which is great. However, no class shows up in the initial class menu that comes up when "Open_Class_Menu: true" is set (which is the default) in the arena config. Hopefully, this all makes sense. If you need additional details let me know, but this is fairly easy to reproduce.
Attacked are the configs for the test arenas (test and test2) that I am using on my testing server. Along with the settings for corearena.
test.txt settings.txt test2.txt