Advertisement
Guest User

Whitelist skript

a guest
Apr 25th, 2014
1,122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.51 KB | None | 0 0
  1. # Whitelist skript by dvwinn
  2. # Feel free to edit for personal use
  3.  
  4. options:
  5. prefix : &8[&7Whitelist&8]&7
  6. kickmsg : You are not whitelisted!
  7. bypass : skript.whitelist.bypass
  8. permission : skript.whitelist
  9.  
  10. variables:
  11. {whitelist} = false
  12. {wlbroadcast} = op
  13. {deathwl} = off
  14.  
  15. command /wl [<text>] [<text>]:
  16. description: Whitelist command
  17. usage: /wl <text> <text>
  18. permission: {@permission}
  19. permission message: §4You don't have permission to use this command
  20. executable by: players and console
  21. trigger:
  22. if arg 1 is "on":
  23. if {whitelist} is false:
  24. set {whitelist} to true
  25. if {wlbroadcast} is "op":
  26. loop all players:
  27. loop-player is op
  28. message "{@prefix} Whitelist on" to loop-player
  29. else if {wlbroadcast} is "all":
  30. broadcast "{@prefix} Whitelist on"
  31. else:
  32. message "{@prefix} Whitelist on" to command sender
  33. else:
  34. message "{@prefix} The whitelist is already on!" to command sender
  35.  
  36. else if arg 1 is "off":
  37. if {whitelist} is true:
  38. set {whitelist} to false
  39. if {wlbroadcast} is "op":
  40. loop all players:
  41. loop-player is op
  42. message "{@prefix} Whitelist off" to loop-player
  43. else if {wlbroadcast} is "all":
  44. broadcast "{@prefix} Whitelist off"
  45. else:
  46. message "{@prefix} Whitelist off" to command sender
  47. else:
  48. message "{@prefix} The whitelist is already off!" to command sender
  49.  
  50. else if arg 1 is "add":
  51. if arg 2 is not set:
  52. message "{@prefix} Please set a player or all players to add to the whitelist" to command sender
  53. else if arg 2 is "all":
  54. loop all players:
  55. set {whitelisted::%loop-player%} to true
  56. if {wlbroadcast} is "op":
  57. loop all players:
  58. loop-player is op
  59. message "{@prefix} All whitelisted" to loop-player
  60. else if {wlbroadcast} is "all":
  61. broadcast "{@prefix} All whitelisted"
  62. else:
  63. message "{@prefix} All whitelisted" to command sender
  64. else:
  65. set {whitelisted::%arg 2%} to true
  66. if {wlbroadcast} is "op":
  67. loop all players:
  68. loop-player is op
  69. message "{@prefix} %arg 2% added to whitelist" to loop-player
  70. else if {wlbroadcast} is "all":
  71. broadcast "{@prefix} %arg 2% added to whitelist"
  72. else:
  73. message "{@prefix} %arg 2% added to whitelist" to command sender
  74.  
  75. else if arg 1 is "remove":
  76. if arg 2 is not set:
  77. message "{@prefix} Please set a player or all players to add to the whitelist" to command sender
  78. else if arg 2 is "all":
  79. clear {whitelisted::*}
  80. if {wlbroadcast} is "op":
  81. loop all players:
  82. loop-player is op
  83. message "{@prefix} Whitelist emptied" to loop-player
  84. else if {wlbroadcast} is "all":
  85. broadcast "{@prefix} Whitelist emptied"
  86. else:
  87. message "{@prefix} Whitelist emptied" to command sender
  88. else:
  89. delete {whitelisted::%arg 2%}
  90. if {wlbroadcast} is "op":
  91. loop all players:
  92. loop-player is op
  93. message "{@prefix} %arg 2% removed from whitelist" to loop-player
  94. else if {wlbroadcast} is "all":
  95. broadcast "{@prefix} %arg 2% removed from whitelist"
  96. else:
  97. message "{@prefix} %arg 2% removed from whitelist" to command sender
  98.  
  99. else if arg 1 is "list":
  100. loop {whitelisted::*}:
  101. add "%loop-index%" to {_Temp::*}
  102. message "{@prefix} Whitelisted players:" to command sender
  103. message "%{_Temp::*}%" to command sender
  104.  
  105. else if arg 1 is "broadcast":
  106. if arg 2 is "op":
  107. set {wlbroadcast} to "op"
  108. message "{@prefix} Broadcast set to op" to command sender
  109. else if arg 2 is "all":
  110. set {wlbroadcast} to "all"
  111. message "{@prefix} Broadcast set to all" to command sender
  112. else if arg 2 is "none":
  113. set {wlbroadcast} to "none"
  114. message "{@prefix} Broadcast set to none" to command sender
  115. else:
  116. message "{@prefix} Please set it to op, all or none" to command sender
  117.  
  118. else if arg 1 is "death":
  119. if arg 2 is "on":
  120. {deathwl} is off
  121. set {deathwl} to "on"
  122. if {wlbroadcast} is "op":
  123. loop all players:
  124. loop-player is op
  125. message "{@prefix} Death whitelist enabled" to loop-player
  126. else if {wlbroadcast} is "all":
  127. broadcast "{@prefix} Death whitelist enabled"
  128. else:
  129. message "{@prefix} Death whitelist enabled" to command sender
  130. else if arg 2 is "off":
  131. {deathwl} is "on"
  132. set {deathwl} to "off"
  133. if {wlbroadcast} is "op":
  134. loop all players:
  135. loop-player is op
  136. message "{@prefix} Death whitelist disabled" to loop-player
  137. else if {wlbroadcast} is "all":
  138. broadcast "{@prefix} Death whitelist disabled"
  139. else:
  140. message "{@prefix} Death whitelist disabled" to command sender
  141. else:
  142. message "{@prefix} Please set death whitelist to on/off!"
  143.  
  144. else:
  145. message "{@prefix} List of available commands:" to command sender
  146. message "/wl on - Turns the whitelist on" to command sender
  147. message "/wl off - Turns the whitelist off" to command sender
  148. message "/wl add <player/all> - Adds a player or everyone on the server to the whitelist" to command sender
  149. message "/wl remove <player/all> - Removes a player from the whitelist or clears the whitelist" to command sender
  150. message "/wl list - Lists everyone on the whitelist currently" to command sender
  151. message "/wl broadcast <op/all/none> - Sets who can see broadcasts" to command sender
  152. message "/wl death <on/off> - Turns the death whitelist on or off" to command sender
  153.  
  154. on connect:
  155. {whitelist} is true
  156. if {whitelisted::%player%} is true:
  157. stop
  158. else if player has permission "{@bypass}":
  159. stop
  160. else:
  161. kick the player due to "{@kickmsg}"
  162.  
  163. on death:
  164. victim is player
  165. {deathwl} is "on"
  166. delete {whitelisted::%arg 2%}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement