1. Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Vote Ban

Discussion in 'Requests' started by Vaw, Mar 23, 2017.

  1. Vaw

    Vaw Member

    Joined:
    Mar 22, 2017
    Messages:
    4
    Likes Received:
    0
    Category: Admin

    Suggested name: Vote Ban

    What I want:
    I would like users with a certain permission be able to vote to ban another player that lacks that permission. Ideally everyone with the appropriate permissions would be notified that a vote to ban a player has begun, but not who voted to begin it. Players without the ban permission, including the person that the others want to ban, would not be notified until the player is actually banned. All vote should be anonymous to players on the server, but in an ideal world they would always be logged to a separate text file with a timestamp.

    Ideas for commands:
    /voteban <player>: cast your vote
    /votebancheck: see how many times that player has been voted for.

    Ideas for permissions:
    voteban.vote: ability to vote to ban someone
    voteban.notify: notified when a vote has begun (not necessary, but would be very nice!)
    voteban.exempt: cannot be banned by vote
    voteban.check: see how many times a player has been voted for

    When I'd like it by: The more quickly I get it the less time I spend wrestling with Skript. This is only be my second time using Skript!
     
    #1 Vaw, Mar 23, 2017
    Last edited: Mar 23, 2017
  2. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    Please use the request format!
     
    Vaw likes this.
  3. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    I had thought that I did. All sections not included did not seem applicable as I did not yet have code to post. What am I missing?
     
  4. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    Vaw likes this.
  5. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    #5 ShaneBee, Mar 23, 2017
    Last edited by a moderator: Mar 23, 2017
  6. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    I started it but I'm kinda busy with other stuff.
    Maybe you can learn something looking in the code. Here it is, and it's not finished. Sorry.

    Code (Skript):
    1. command /voteban <player>:
    2.   permission: sk.startvotetoban #Perm to start a ban vote AND ALSO a protection for the player, as immunity
    3.   trigger:
    4.         if {voteban.running} is true:
    5.       message "[VOTEBAN] Another ban vote is already being placed! Wait for it to end an start this vote again"
    6.       stop
    7.     loop player arg 1:
    8.       loop-player has permission "sk.startvotetoban"
    9.         message "[VOTEBAN] You can't voteban this player!"
    10.         stop
    11.       else:
    12.         set {voteban.running} to true
    13.         loop all players:
    14.           loop-player has permission "sk.startvotetoban"
    15.           send "[VOTEBAN] The voteban for %arg 1% is now running! To cast your vote use /banvote yes|no" to loop-player
    16.           stop
    17.     else:
    18.       message "[VOTEBAN] This is not a player name! Try again!"
    19.       stop
    20. command /banvote <text>:
    21.   permission: sk.votetoban # Perm JUST to vote. This doesn't give immunity nor can
    22.   trigger:
    23.     if arg 1 is "yes" or "y" or "no" or "n":
    24.        if arg 1 is "yes" or "y":
    25.        if arg 1 is "no" or "n":
    26.     else
    27.       message
    28.  
    29. command /internalbanvotedrop
    30.   trigger:
    31.     wait 4 minute
    32.     loop all players:
    33.       loop-player has permission "sk.startvotetoban"
    34.       send "[VOTEBAN] The voteban for %arg 1% will end in one minute! Cast your vote with /banvote yes|no" to loop-player
    35.     wait 1 minute
    36.     set {voteban.running} to false
    37.  
     
    BrettPlayMC likes this.

Share This Page

Loading...