Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.90 KB | None | 0 0
  1. command /ban [<offline player>] [<text>]:
  2.     permission: staff.ban
  3.     permission message: {@perm}
  4.     trigger:
  5.         set {_failure} to false
  6.         if arg-1 is not set:
  7.             set {_failure} to true
  8.         if arg-2 is not set:
  9.             set {_failure} to true
  10.         if {_failure} is true:
  11.             send "&c/ban <player> <timespan> [reason]"
  12.             stop
  13.         set {_lmao::*} to split arg-2 using the delimiter " "
  14.         set {_span} to {_lmao::1}
  15.         set {_len} to length of {_span}
  16.         set {_lenwhole} to length of arg-2
  17.         set {_lendiff} to {_lenwhole} - {_len}
  18.         if size of {_lmao::*} is 1:
  19.             set {_reason} to "&cBanned by an operator."
  20.         else:
  21.             set {_reason} to last ({_lendiff} - 1) characters of arg-2
  22.         if {_span} is "forever":
  23.             set {tempban::%arg-1's uuid%::ban} to false
  24.             set {tempban::%arg-1's uuid%::span} to 0 seconds
  25.             set {tempban::%arg-1's uuid%::stamp} to 0 seconds
  26.             ban arg-1 because "&c&lPerm Ban &8|&r &a{@server} &8- &7%colored {_reason}%"
  27.             kick arg 1 due to "&c&lPerm Ban &8|&r &a{@server} &8- &7%colored {_reason}%"
  28.             broadcast "&b%player% &7banned &b%arg-1% &7for &c%{_reason}% &7[FOREVER]"
  29.         else:
  30.             set {_tryParse::*} to timeParser({_span})
  31.             set {_res} to {_tryParse::1}
  32.             if {_res} is "error":
  33.                 send "&cInvalid timespan!"
  34.                 send "&6Example: &e2y3mo1w4d5h2m29s"
  35.             else:
  36.                 set {_timespan} to "%{_res}% seconds" parsed as timespan
  37.                 unban arg-1
  38.                 set {tempban::%arg-1's uuid%::ban} to true
  39.                 set {tempban::%arg-1's uuid%::span} to {_timespan}
  40.                 set {tempban::%arg-1's uuid%::stamp} to now
  41.                 set {tempban::%arg-1's uuid%::msg} to "&c&lTempban&r &8| &a{@server} &8- &7%colored {_reason}%"
  42.                 kick arg 1 due to "&c&lTempban&r &8| &a{@server}&r &8- &7%colored {_reason}% &8| &7Expires in &e%{_timespan}%"
  43.                 broadcast "&b%player% &7banned &b%arg-1% &7for &c%{_reason}% &7[&e%{_timespan}%&7]"
  44.                 else:
  45.                 if arg 1 is "all":
  46.                 loop all players
  47.                 make console execute command "ban %loop-player% 1s banall"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement