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