Need Help With Permission Groups!

Discussion in 'Bukkit Help' started by Vanir112, Mar 30, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    Vanir112

    So basically on my server I am setting up several villages where players can live. I want to let these players spawn at the centre of their own village, and I've done that using HomeSpawnPlus and Groups plugin.

    What I need is a way that players can easily change the group they are in, but not using chat commands. Ideally, I want player to be able to right click a sign at the appropriate spawn to put them in the group for that village, or to walk onto the spawn pad and get changed to that group.

    I've tried using Commandsigns with the command of /cmdsigns line1 /perms pgroup <name> Kingston

    Kingston is the name of the village for clarification. My problem is that normal users are getting errors saying that they do not have permission, any idea how to fix this?

    If I am using the wrong plugins to manage the groups then please tell me aswell. Thank you!
     
  2. Offline

    mrcheeseface2

    At there house put a sign saying say /sethome or u can use a plot world to make a village then tell them to say /p auto. U can make plots cost aswell!
     
  3. Offline

    andune

    Changing groups is certainly one way to do this and if you can find an easy answer to doing that, great. Obviously HSP won't help you with this any, so you're on your own there. I'd have to imagine there is some plugin out there that can do this, but of course you have to be careful you don't accidentally open yourself up to players being able to change their own groups willy nilly and make themselves admins.

    Another possible option is that you could used named spawns and you could create an HSP custom command that set the players personal spawn to that spawn (there is one per player, per world). You could also just use homes and let the player use the /setdefaulthome (/sdh for short) command to change their default home, but I assume since you're using group spawn right now your intent is to set to pre-defined spawns and not just any old location they choose.

    So here's what the named spawn option might look like:

    Code:
    commands:
      setpersonalspawn:
        class: CustomEventCommand
        event: setpersonalspawn
        alias: [sps]
     
    events:
      setpersonalspawn:
        - modeRememberSpawn
        - spawnNearest
      onSpawnCommand:
        - spawnLocalPlayerSpawn
        - [.. some other strategies you might like to try if they don't have a personal spawn set; or not ..]
    
    Then as a setup task, go around to each village and set a spawn point at that village. Something like "/setspawn village1", "/setspawn village2", etc. You can give them more meaningful names if you want, the players will never see it in this example unless you let them use named spawns.

    With this setup, you can use a command block or a sign plugin that can run player commands to have them click in order to run the /sps command. (permission will be hsp.command.setpersonalspawn, btw) When the custom command runs, it will fire the setpersonalspawn event. This event turns on the "rememberSpawn" mode and then spawns them at the nearest spawn, which of course should be whatever spawn you setup for that village. The act of spawning them there is really just so modeRememberSpawn kicks in, recording that as their personal spawn.

    The last piece of this is the spawnLocalPlayerSpawn strategy so that when they type /spawn, they will go to whatever village they last clicked at. If you have a world spawn that you'd rather they go to when they type /spawn, you could just created another custom command like /villagespawn which ran the spawnLocalPlayerSpawn strategy only for sending them to their village. Of course you can use the strategy in other chains like onDeath as well if you wanted them to respawn there, etc.

    The only real downside to this that I see is that if the command block or sign shows the command being run, there is no way of stopping players from running /sps on their own, thus it's possible they could run that command out in the wild to essentially spawn at the nearest village and set their spawn, even though that village might be hundreds or thousands of blocks away. One potential way to fix this is using a plugin like WorldGuard that can restrict commands and making it so /sps is blocked globally and then define a region right around each command block/sign that allows /sps to only be used there.

    It's also possible with a few enhancements to HSP that some more advanced scenarios would become possible, but you'd have to become an HSP 2.0 beta tester since that's where I'm putting new feature requests.
     
Thread Status:
Not open for further replies.

Share This Page