Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- command /ban [<offline player>] [<text>]:
- permission: staff.ban
- permission message: {@perm}
- trigger:
- set {_failure} to false
- if arg-1 is not set:
- set {_failure} to true
- if arg-2 is not set:
- set {_failure} to true
- if {_failure} is true:
- send "&c/ban <player> <timespan> [reason]"
- stop
- set {_lmao::*} to split arg-2 using the delimiter " "
- set {_span} to {_lmao::1}
- set {_len} to length of {_span}
- set {_lenwhole} to length of arg-2
- set {_lendiff} to {_lenwhole} - {_len}
- if size of {_lmao::*} is 1:
- set {_reason} to "&cBanned by an operator."
- else:
- set {_reason} to last ({_lendiff} - 1) characters of arg-2
- if {_span} is "forever":
- set {tempban::%arg-1's uuid%::ban} to false
- set {tempban::%arg-1's uuid%::span} to 0 seconds
- set {tempban::%arg-1's uuid%::stamp} to 0 seconds
- ban arg-1 because "&c&lPerm Ban &8|&r &a{@server} &8- &7%colored {_reason}%"
- kick arg 1 due to "&c&lPerm Ban &8|&r &a{@server} &8- &7%colored {_reason}%"
- broadcast "&b%player% &7banned &b%arg-1% &7for &c%{_reason}% &7[FOREVER]"
- else:
- set {_tryParse::*} to timeParser({_span})
- set {_res} to {_tryParse::1}
- if {_res} is "error":
- send "&cInvalid timespan!"
- send "&6Example: &e2y3mo1w4d5h2m29s"
- else:
- set {_timespan} to "%{_res}% seconds" parsed as timespan
- unban arg-1
- set {tempban::%arg-1's uuid%::ban} to true
- set {tempban::%arg-1's uuid%::span} to {_timespan}
- set {tempban::%arg-1's uuid%::stamp} to now
- set {tempban::%arg-1's uuid%::msg} to "&c&lTempban&r &8| &a{@server} &8- &7%colored {_reason}%"
- kick arg 1 due to "&c&lTempban&r &8| &a{@server}&r &8- &7%colored {_reason}% &8| &7Expires in &e%{_timespan}%"
- broadcast "&b%player% &7banned &b%arg-1% &7for &c%{_reason}% &7[&e%{_timespan}%&7]"
- else:
- if arg 1 is "all":
- loop all players
- make console execute command "ban %loop-player% 1s banall"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement