Advertisement
Guest User

Whitelist.sk by dvwinn

a guest
Jul 29th, 2014
3,700
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.68 KB | None | 0 0
  1. # /$$ /$$ /$$ /$$ /$$ /$$ /$$ /$$ /$$
  2. #| $$ /$ | $$| $$ |__/ | $$ | $$|__/ | $$ | $$
  3. #| $$ /$$$| $$| $$$$$$$ /$$ /$$$$$$ /$$$$$$ | $$ /$$ /$$$$$$$ /$$$$$$ /$$$$$$$| $$ /$$
  4. #| $$/$$ $$ $$| $$__ $$| $$|_ $$_/ /$$__ $$| $$| $$ /$$_____/|_ $$_/ /$$_____/| $$ /$$/
  5. #| $$$$_ $$$$| $$ \ $$| $$ | $$ | $$$$$$$$| $$| $$| $$$$$$ | $$ | $$$$$$ | $$$$$$/
  6. #| $$$/ \ $$$| $$ | $$| $$ | $$ /$$| $$_____/| $$| $$ \____ $$ | $$ /$$ \____ $$| $$_ $$
  7. #| $$/ \ $$| $$ | $$| $$ | $$$$/| $$$$$$$| $$| $$ /$$$$$$$/ | $$$$//$$ /$$$$$$$/| $$ \ $$
  8. #|__/ \__/|__/ |__/|__/ \___/ \_______/|__/|__/|_______/ \___/ |__/|_______/ |__/ \__/
  9. #---------------------------------------------------------------------------------------------------
  10. # Whitelist skript made by dvwinn
  11. # Feel free to edit (if you know what you're doing!)
  12. # Feel free to use parts of my skript, just don't copy the whole thing and pass it off as your own
  13. # This was made with the intention of use in UHC games at http://www.reddit.com/r/ultrahardcore
  14. # To access the default whitelist, use your server settings or /minecraft:whitelist, or /bukkit:whitelist
  15. # If you need help, do /whitelist or /wl, it will tell you all the commands
  16. #---------------------------------------------------------------------------------------------------
  17.  
  18. #---------------------------------------------------------------------------------------------------
  19. # Default options, feel free to edit
  20. #---------------------------------------------------------------------------------------------------
  21.  
  22. options:
  23. prefix : &8[&7Whitelist&8]&7 # The text that appears before each message
  24. kickmsg : You are not whitelisted! # The message people recieve when they are kicked for not being on the whitelist
  25. bypass : skript.whitelist.bypass # The permission for people to bypass the whitelist (defaults to OP)
  26. permission : skript.whitelist # The permission to use the /whitelist and /wl command (defualts to OP)
  27.  
  28. variables:
  29. {whitelist} = false # Just defaulting the whitelist to off when you start the skript
  30. {wlbroadcast} = op # This is who the whitelist messages broadcast to (With vanilla whitelist it defaults to OP)
  31. {deathwl} = off # Option of removing people from the whitelist when they die
  32.  
  33. #---------------------------------------------------------------------------------------------------
  34. # The whitelist command
  35. #---------------------------------------------------------------------------------------------------
  36.  
  37. command /whitelist [<text>] [<text>]:
  38. description: Whitelist command
  39. usage: /whitelist
  40. permission: {@permission}
  41. permission message: ยง4You don't have permission to use this command
  42. aliases: /wl
  43. executable by: players and console
  44. trigger:
  45.  
  46.  
  47. # Turning the whitelist on
  48.  
  49. if arg 1 is "on":
  50. if {whitelist} is false:
  51. set {whitelist} to true
  52. if {wlbroadcast} is "op":
  53. loop all players:
  54. loop-player is op
  55. message "{@prefix} Whitelist on" to loop-player
  56. else if {wlbroadcast} is "all":
  57. broadcast "{@prefix} Whitelist on"
  58. else:
  59. message "{@prefix} Whitelist on" to command sender
  60. else:
  61. message "{@prefix} The whitelist is already on!" to command sender
  62.  
  63.  
  64. # Turning the whitelist off
  65.  
  66. else if arg 1 is "off":
  67. if {whitelist} is true:
  68. set {whitelist} to false
  69. if {wlbroadcast} is "op":
  70. loop all players:
  71. loop-player is op
  72. message "{@prefix} Whitelist off" to loop-player
  73. else if {wlbroadcast} is "all":
  74. broadcast "{@prefix} Whitelist off"
  75. else:
  76. message "{@prefix} Whitelist off" to command sender
  77. else:
  78. message "{@prefix} The whitelist is already off!" to command sender
  79.  
  80.  
  81. # Adding people to the whitelist
  82.  
  83. else if arg 1 is "add":
  84. if arg 2 is not set:
  85. message "{@prefix} Please set a player or all players to add to the whitelist" to command sender
  86. else if arg 2 is "all":
  87. loop all players:
  88. set {whitelisted::%loop-player%} to true
  89. if {wlbroadcast} is "op":
  90. loop all players:
  91. loop-player is op
  92. message "{@prefix} All whitelisted" to loop-player
  93. else if {wlbroadcast} is "all":
  94. broadcast "{@prefix} All whitelisted"
  95. else:
  96. message "{@prefix} All whitelisted" to command sender
  97. else:
  98. set {whitelisted::%arg 2%} to true
  99. if {wlbroadcast} is "op":
  100. loop all players:
  101. loop-player is op
  102. message "{@prefix} %arg 2% added to whitelist" to loop-player
  103. else if {wlbroadcast} is "all":
  104. broadcast "{@prefix} %arg 2% added to whitelist"
  105. else:
  106. message "{@prefix} %arg 2% added to whitelist" to command sender
  107.  
  108.  
  109. # Removing people from the whitelist
  110.  
  111. else if arg 1 is "remove":
  112. if arg 2 is not set:
  113. message "{@prefix} Please set a player or all players to add to the whitelist" to command sender
  114. else if arg 2 is "all":
  115. clear {whitelisted::*}
  116. if {wlbroadcast} is "op":
  117. loop all players:
  118. loop-player is op
  119. message "{@prefix} Whitelist emptied" to loop-player
  120. else if {wlbroadcast} is "all":
  121. broadcast "{@prefix} Whitelist emptied"
  122. else:
  123. message "{@prefix} Whitelist emptied" to command sender
  124. else:
  125. delete {whitelisted::%arg 2%}
  126. if {wlbroadcast} is "op":
  127. loop all players:
  128. loop-player is op
  129. message "{@prefix} %arg 2% removed from whitelist" to loop-player
  130. else if {wlbroadcast} is "all":
  131. broadcast "{@prefix} %arg 2% removed from whitelist"
  132. else:
  133. message "{@prefix} %arg 2% removed from whitelist" to command sender
  134.  
  135.  
  136. # Listing all the people on the whitelist
  137.  
  138. else if arg 1 is "list":
  139. loop {whitelisted::*}:
  140. add "%loop-index%" to {_Temp::*}
  141. message "{@prefix} Whitelisted players:" to command sender
  142. message "%{_Temp::*}%" to command sender
  143.  
  144.  
  145. # Changing who can see the whitelist messages
  146.  
  147. else if arg 1 is "broadcast":
  148. if arg 2 is "op":
  149. set {wlbroadcast} to "op"
  150. message "{@prefix} Broadcast set to op" to command sender
  151. else if arg 2 is "all":
  152. set {wlbroadcast} to "all"
  153. message "{@prefix} Broadcast set to all" to command sender
  154. else if arg 2 is "none":
  155. set {wlbroadcast} to "none"
  156. message "{@prefix} Broadcast set to none" to command sender
  157. else:
  158. message "{@prefix} Please set it to op, all or none" to command sender
  159.  
  160.  
  161. # Toggling death whitelist
  162.  
  163. else if arg 1 is "death":
  164. if arg 2 is "on":
  165. {deathwl} is "off"
  166. set {deathwl} to "on"
  167. if {wlbroadcast} is "op":
  168. loop all players:
  169. loop-player is op
  170. message "{@prefix} Death whitelist enabled" to loop-player
  171. else if {wlbroadcast} is "all":
  172. broadcast "{@prefix} Death whitelist enabled"
  173. else:
  174. message "{@prefix} Death whitelist enabled" to command sender
  175. else if arg 2 is "off":
  176. {deathwl} is "on"
  177. set {deathwl} to "off"
  178. if {wlbroadcast} is "op":
  179. loop all players:
  180. loop-player is op
  181. message "{@prefix} Death whitelist disabled" to loop-player
  182. else if {wlbroadcast} is "all":
  183. broadcast "{@prefix} Death whitelist disabled"
  184. else:
  185. message "{@prefix} Death whitelist disabled" to command sender
  186. else:
  187. message "{@prefix} Please set death whitelist to on/off!"
  188.  
  189.  
  190. # Help command
  191.  
  192. else:
  193. message "{@prefix} List of available commands:" to command sender
  194. message "/whitelist on &7- Turns the whitelist on" to command sender
  195. message "/whitelist off &7- Turns the whitelist off" to command sender
  196. message "/whitelist add <player/all> &7- Adds a player or everyone on the server to the whitelist" to command sender
  197. message "/whitelist remove <player/all> &7- Removes a player from the whitelist or clears the whitelist" to command sender
  198. message "/whitelist list &7- Lists everyone on the whitelist currently" to command sender
  199. message "/whitelist broadcast <op/all/none> &7- Sets who can see broadcasts" to command sender
  200. message "/whitelist death <on/off> &7- Turns the death whitelist on or off" to command sender
  201. message "To access the default whitelist, do /bukkit:whitelist" to command sender
  202.  
  203. #---------------------------------------------------------------------------------------------------
  204. # Whitelist events
  205. #---------------------------------------------------------------------------------------------------
  206.  
  207. on connect:
  208. {whitelist} is true
  209. {whitelisted::%player%} is not set
  210. player does not have permission "{@bypass}"
  211. kick the player due to "{@kickmsg}"
  212.  
  213. on death of player:
  214. {deathwl} is "on"
  215. delete {whitelisted::%victim%}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement