PreciousStones

PreciousStones

269k Downloads

[Feature request] allow to fly flag

krustymk opened this issue ยท 5 comments

commented

Allow player to fly flag (not creative, just fly)

If possible a timer and cooldown (so he/she can only fly for a set time before having to wait another set time before they can fly again)

Thanks

commented

Thanks, helped loads. I have put the following into a field

command-on-enter:
fly {owner}
command-on-exit:
fly {owner}
hidable: true
commands-on-overlap: true

Ive taken the indentation out because this box screwed with it

Which works great.. Unless an admin in creative goes into the area, then the player's flying is disabled. Any ideas?

Thanks again

commented

Can't think of anything

commented

The problem in your example is caused by the fact that by default the command-on flags apply to allowed players. I'm guessing your admins have the "preciousstones.admin.allowed" permission, and that's why they are being effected by a field they are not white-listed in. I've tried several setups with removing the above permission or adding a negated version of it when a player enters or exits with no luck (That could just be related to how my permissions system is setup though).
In the end I found a way to prevent your staff from triggering the fly commands by taking advantage of the "preciousstones.admin.allowed" permission node. The down side to this is that now all players entering the field (Besides staff with that node) will be able to use it, not just the owner. The other thing I could not come up with a solution for is the "cool down" you mentioned in the OP. Here's what I came up with.

 - title: Wings of Icarus
  block: 20
  radius: 25
  custom-height: 128
  sneaking-to-place: true
  no-owner: true
  breakable: true
  price: 100
  auto-disable: 300
  pay-to-enable: 100
  ~command-on-enter:
  - fly {player} on
  ~command-on-exit:
  - effect {player} 11 3 4
  - fly {player} off
  ^welcome-message: true
  ^farewell-message: true
  mixing-group: 1

My example will enable players to place the block for $100 and get 5 minutes of flight time before the field disables its self. Once disabled, it can be enabled again or just re-placed for the same fee. In order to make it work I had to make it with the "no-owner" flag so beware that anyone can break it. When the timer runs out (Or the person leaves the field) their flying is disabled and they re given 3 seconds of invincibility using potion effects. Let me know if you have any issues or come up with any better ideas. Good luck!

commented

Thanks for putting trying to come up with a solution.
You are correct in assuming the admins have that perm, and i guess when i (admin) go into the field its triggering the command for everyone allowed (and inside the field) not just the player entering or leaving the field (bug?)

Loving the stone title :) !!
I dont know if im going to use your example as is but it has certainly given me some ideas on how to improve the stone i have made.

Thanks very much for your help and feedback

commented

You can use the command-on-enter and command-on-exit in conjunction with a plugin that allows flights to do what you want. If the flight plugin works with permissions not commands, you can use the command flags to give/remove permissions from a player when the enter/leave the field.