Vote Ban

  • 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!

Vaw

Member
Mar 22, 2017
4
0
0
26
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!
 
Last edited:
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_language.skript:
command /voteban <player>:
  permission: sk.startvotetoban #Perm to start a ban vote AND ALSO a protection for the player, as immunity
  trigger:
        if {voteban.running} is true:
      message "[VOTEBAN] Another ban vote is already being placed! Wait for it to end an start this vote again"
      stop
    loop player arg 1:
      loop-player has permission "sk.startvotetoban"
        message "[VOTEBAN] You can't voteban this player!"
        stop
      else:
        set {voteban.running} to true
        loop all players:
          loop-player has permission "sk.startvotetoban"
          send "[VOTEBAN] The voteban for %arg 1% is now running! To cast your vote use /banvote yes|no" to loop-player
          stop
    else:
      message "[VOTEBAN] This is not a player name! Try again!"
      stop
command /banvote <text>:
  permission: sk.votetoban # Perm JUST to vote. This doesn't give immunity nor can
  trigger:
    if arg 1 is "yes" or "y" or "no" or "n":
       if arg 1 is "yes" or "y":
       if arg 1 is "no" or "n":
    else
      message

command /internalbanvotedrop
  trigger:
    wait 4 minute
    loop all players:
      loop-player has permission "sk.startvotetoban"
      send "[VOTEBAN] The voteban for %arg 1% will end in one minute! Cast your vote with /banvote yes|no" to loop-player
    wait 1 minute
    set {voteban.running} to false
 
  • Like
Reactions: BrettPlayMC