Advertisement
-Pxnda-

Untitled

Mar 24th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 10.89 KB | None | 0 0
  1. options:
  2.     perm: &cInsufficient permissions
  3.     server: &aExEo Offical Anticheat
  4. on connect:
  5.     if {tempban::%player's uuid%::ban} is true:
  6.         set {_diff} to difference between now and {tempban::%player's uuid%::stamp}
  7.         set {_remain} to difference between {tempban::%player's uuid%::span} and {_diff}
  8.         if {_diff} < {tempban::%player's uuid%::span}:
  9.             kick the player due to "%{tempban::%player's uuid%::msg}% &8| &7Punishment expires in %{_remain}%"
  10.         else:
  11.             set {tempban::%player's uuid%::ban} to false
  12.             set {tempban::%player's uuid%::msg} to ""
  13.             set {tempban::%player's uuid%::span} to 0 seconds
  14.             set {tempban::%player's uuid%::stamp} to 0 seconds
  15.  
  16. on chat:
  17.     if {mute::%player's uuid%::mute} is true:
  18.         if {mute::%player's uuid%::span} is greater than 0 seconds:
  19.             set {_diff} to difference between now and {mute::%player's uuid%::stamp}
  20.             if {_diff} >= {mute::%player's uuid%::span}:
  21.                 set {mute::%player's uuid%::span} to 0 seconds
  22.                 set {mute::%player's uuid%::mute} to false
  23.                 set {mute::%player's uuid%::stamp} to 0 seconds
  24.             else:
  25.                 set {_attach} to ""
  26.                 if {mute::%player's uuid%::msg} is not false:
  27.                     set {_attach} to " &7for &e%{mute::%player's uuid%::msg}%"
  28.                 set {_wait} to difference between {mute::%player's uuid%::span} and {_diff}
  29.                 send ""
  30.                 send "&7You are &cmuted%{_attach}%"
  31.                 send "&7You may speak in &e%{_wait}%"
  32.                 send ""
  33.                 cancel event
  34.                 stop
  35.         else:
  36.             if {mute::%player's uuid%::msg} is false:
  37.                 send "&7You are &cmuted! &7You cannot speak."
  38.                 cancel event
  39.             else:
  40.                 send "&7You are &cmuted &7for &e%{mute::%player's uuid%::msg}%"
  41.                 cancel event
  42.             stop
  43.  
  44.  
  45. command /warn [<offline player>] [<text>]:
  46.     permission: staff.warn
  47.     trigger:
  48.         if arg-1 is not set:
  49.             set {_dab} to true
  50.         if arg-2 is not set:
  51.             set {_dab} to true
  52.         if {_dab} is true:
  53.             send "&c/warn (player) (reason)"
  54.             stop
  55.         if arg-1 is online:
  56.             broadcast "&b%player% &7warned &b%arg-1% &7for %colored arg-2%"
  57.         else:
  58.             send "&cPlayer is offline."
  59.  
  60. command /cc:
  61.     permission: staff.cc
  62.     trigger:
  63.         loop 250 times:
  64.             broadcast " "
  65.         broadcast "&8[&aServer&8] &eChat cleared by &6%player%"
  66.  
  67. command /kick [<offline player>] [<text>]:
  68.     permission message: {@perm}
  69.     permission: staff.kick
  70.     trigger:
  71.         if arg-1 is not set:
  72.             send "&c/kick <player> [reason]"
  73.             stop
  74.         if arg-1 is online:
  75.             if arg-2 is set:
  76.                 kick arg-1 because colored arg-2
  77.                 broadcast "&b%player% &7kicked &b%arg-1% &7for %colored arg-2%"
  78.             else:
  79.                 kick arg-1
  80.                 broadcast "&b%player% &7kicked &b%arg-1%"
  81.         else:
  82.             send "&cPlayer is offline."
  83.  
  84. command /ban [<offline player>] [<text>]:
  85.     permission: staff.ban
  86.     permission message: {@perm}
  87.     trigger:
  88.         set {_failure} to false
  89.         if arg-1 is not set:
  90.             set {_failure} to true
  91.         if arg-2 is not set:
  92.             set {_failure} to true
  93.         if {_failure} is true:
  94.             send "&c/ban <player> <timespan> [reason]"
  95.             stop
  96.         set {_lmao::*} to split arg-2 using the delimiter " "
  97.         set {_span} to {_lmao::1}
  98.         set {_len} to length of {_span}
  99.         set {_lenwhole} to length of arg-2
  100.         set {_lendiff} to {_lenwhole} - {_len}
  101.         if size of {_lmao::*} is 1:
  102.             set {_reason} to "&cBanned by an operator."
  103.         else:
  104.             set {_reason} to last ({_lendiff} - 1) characters of arg-2
  105.         if {_span} is "forever":
  106.             set {tempban::%arg-1's uuid%::ban} to false
  107.             set {tempban::%arg-1's uuid%::span} to 0 seconds
  108.             set {tempban::%arg-1's uuid%::stamp} to 0 seconds
  109.             ban arg-1 because "&c&lPerm Ban &8|&r &a{@server} &8- &7%colored {_reason}%"
  110.             kick arg 1 due to "&c&lPerm Ban &8|&r &a{@server} &8- &7%colored {_reason}%"
  111.             broadcast "&b%player% &7banned &b%arg-1% &7for &c%{_reason}% &7[FOREVER]"
  112.         else:
  113.             set {_tryParse::*} to timeParser({_span})
  114.             set {_res} to {_tryParse::1}
  115.             if {_res} is "error":
  116.                 send "&cInvalid timespan!"
  117.                 send "&6Example: &e2y3mo1w4d5h2m29s"
  118.             else:
  119.                 set {_timespan} to "%{_res}% seconds" parsed as timespan
  120.                 unban arg-1
  121.                 set {tempban::%arg-1's uuid%::ban} to true
  122.                 set {tempban::%arg-1's uuid%::span} to {_timespan}
  123.                 set {tempban::%arg-1's uuid%::stamp} to now
  124.                 set {tempban::%arg-1's uuid%::msg} to "&c&lTempban&r &8| &a{@server} &8- &7%colored {_reason}%"
  125.                 kick arg 1 due to "&c&lTempban&r &8| &a{@server}&r &8- &7%colored {_reason}% &8| &7Expires in &e%{_timespan}%"
  126.                 broadcast "&b%player% &7banned &b%arg-1% &7for &c%{_reason}% &7[&e%{_timespan}%&7]"
  127.  
  128.  
  129. command /mute [<offline player>] [<text>]:
  130.     permission: staff.mute
  131.     permission message: {@perm}
  132.     trigger:
  133.         if arg-1 is set:
  134.             if arg-1 is online:
  135.                 set {_minspan} to 1 second
  136.                 set {_zerospan} to 0 seconds
  137.                 set {_uuid} to uuid of arg-1
  138.                 if arg-2 is set:
  139.                     set {_lmao::*} to split arg-2 using the delimiter " "
  140.                     set {_span} to {_lmao::1}
  141.                     set {_len} to length of {_span}
  142.                     set {_lenwhole} to length of arg-2
  143.                     set {_lendiff} to {_lenwhole} - {_len}
  144.                     if size of {_lmao::*} > 1:
  145.                         set {_reason} to last ({_lendiff} - 1) characters of arg-2
  146.                         set {_decolor} to {_reason}
  147.                         set {_reason} to colored {_reason}
  148.                 else:
  149.                     set {_span} to "forever"
  150.                 if {_span} is not "forever":
  151.                     set {_tryParse::*} to timeParser({_span})
  152.                     set {_res} to {_tryParse::1}
  153.                     if {_res} is "error":
  154.                         send "&cInvalid timespan!"
  155.                         send "&6Example: &e2y3mo1w4d5h2m29s"
  156.                         stop
  157.                     set {_span} to {_res}
  158.                     set {_span} to "%{_span}% seconds" parsed as timespan
  159.                     if {_span} >= {_minspan}:
  160.                         set {mute::%{_uuid}%::span} to {_span}
  161.                         set {mute::%{_uuid}%::mute} to true
  162.                         set {mute::%{_uuid}%::stamp} to now
  163.                         if {_reason} is set:
  164.                             set {mute::%{_uuid}%::msg} to {_reason}
  165.                             send "&7You have been &cmuted &7for &e%{_reason}% &7[&e%{_span}%&7]" to arg-1
  166.                             broadcast "&b%player% &7muted &b%arg-1% &7for &c%{_reason}% &7[&e%{_span}%&7]"
  167.                         else:
  168.                             set {mute::%{_uuid}%::msg} to false
  169.                             send "&7You have been &cmuted. &7[&e%{_span}%&7]" to arg-1
  170.                             broadcast "&b%player% &7muted &b%arg-1% &7[&e%{_span}%&7]"
  171.                     else:
  172.                         if {_span} = {_zerospan}:
  173.                             make player execute "/unmute %arg-1%"
  174.                         else:
  175.                             send "&cYour mute span should be at least 1 second."
  176.                 else:
  177.                     if {_reason} is set:
  178.                         if {mute::%{_uuid}%::mute} is not set:
  179.                             set {mute::%{_uuid}%::mute} to false
  180.                         send "&7Muted &e%arg-1% &7for &e%{_decolor}% &7[FOREVER]"
  181.                         set {mute::%{_uuid}%::span} to {_zerospan}
  182.                         set {mute::%{_uuid}%::mute} to true
  183.                         set {mute::%{_uuid}%::stamp} to now
  184.                         set {mute::%{_uuid}%::msg} to {_reason}
  185.                         broadcast "&b%player% &7muted &b%arg-1% &7for &e%{_reason}% &7[&7FOREVER&7]"
  186.                         send "&7You have been &cmuted &7for &e%{_reason}%" to arg-1
  187.                     else:
  188.                         if {mute::%{_uuid}%::mute} is not set:
  189.                             set {mute::%{_uuid}%::mute} to false
  190.                         if {mute::%{_uuid}%::mute} is false:
  191.                             send "&7Muted &e%arg-1% &7forever."
  192.                             set {mute::%{_uuid}%::span} to {_zerospan}
  193.                             set {mute::%{_uuid}%::mute} to true
  194.                             set {mute::%{_uuid}%::stamp} to now
  195.                             set {mute::%{_uuid}%::msg} to false
  196.                             broadcast "&b%player% &7muted &b%arg-1% &7[&7FOREVER&7]"
  197.                             send "&7You have been &cmuted." to arg-1
  198.                         else:
  199.                             make player execute "/unmute %arg-1%"
  200.             else:
  201.                 send "&cPlayer is not online."
  202.         else:
  203.             send "&c/mute (player) [timespan] [reason]"
  204.  
  205. command /unmute [<offline player>]:
  206.     permission: staff.unmute
  207.     permission message: {@perm}
  208.     trigger:
  209.         if arg-1 is set:
  210.             if arg-1 is online:
  211.                 set {_uuid} to uuid of arg-1
  212.                 if {mute::%{_uuid}%::mute} is not set:
  213.                     set {mute::%{_uuid}%::mute} to false
  214.                 if {mute::%{_uuid}%::mute} is false:
  215.                     send "&e%arg-1% &7is not &6muted."
  216.                     stop
  217.                 set {mute::%{_uuid}%::mute} to false
  218.                 set {mute::%{_uuid}%::span} to 0 seconds
  219.                 send "&7Unmuted &e%arg-1%."
  220.                 broadcast "&b%player% &7unmuted &b%arg-1%"
  221.             else:
  222.                 send "&cPlayer is not online."
  223.         else:
  224.             send "&c/unmute (player)"
  225.  
  226. command /unban [<offline player>]:
  227.     permission: staff.unban
  228.     permission message: {@perm}
  229.     trigger:
  230.         set {_failure} to false
  231.         if arg-1 is not set:
  232.             message "&c/unban <player>"
  233.             stop
  234.         unban arg-1
  235.         set {tempban::%arg-1's uuid%::ban} to false
  236.         set {tempban::%arg-1's uuid%::span} to 0 seconds
  237.         set {tempban::%arg-1's uuid%::stamp} to 0 seconds
  238.         broadcast "&b%player% &cunbanned &b%arg-1%"
  239.  
  240.  
  241.  
  242. # Punish
  243.  
  244. function timeParser(p: text) :: objects:
  245.     set {_invalid} to false
  246.     add "y" to {_validdate::*}
  247.     add "mo" to {_validdate::*}
  248.     add "w" to {_validdate::*}
  249.     add "d" to {_validdate::*}
  250.     add "h" to {_validdate::*}
  251.     add "s" to {_validdate::*}
  252.     add "m" to {_validdate::*}
  253.    
  254.     set {_secres} to 0
  255.     set {_help} to 0
  256.     set {_terminate} to length of {_p}
  257.     set {_totalnum} to 0
  258.     set {_numlock} to 0
  259.     while {_help} < {_terminate}:
  260.         set {_char} to the first character of {_p}
  261.         set {_yeet} to false
  262.         if {_char} is "0":
  263.             set {_yeet} to true
  264.         if {_char} is "1":
  265.             set {_yeet} to true
  266.         if {_char} is "2":
  267.             set {_yeet} to true
  268.         if {_char} is "3":
  269.             set {_yeet} to true
  270.         if {_char} is "4":
  271.             set {_yeet} to true
  272.         if {_char} is "5":
  273.             set {_yeet} to true
  274.         if {_char} is "6":
  275.             set {_yeet} to true
  276.         if {_char} is "7":
  277.             set {_yeet} to true
  278.         if {_char} is "8":
  279.             set {_yeet} to true
  280.         if {_char} is "9":
  281.             set {_yeet} to true
  282.         if {_yeet} is true:
  283.             if {_numlock} is 2:
  284.                 if {_validdate::*} does not contain {_ahh}:
  285.                     set {_invalid} to true
  286.                 else:
  287.                     set {_tempres} to parseShortTime({_totalnum}, {_ahh})
  288.                     add {_tempres} to {_secres}
  289.                 set {_ahh} to ""
  290.                 set {_totalnum} to 0
  291.             set {_numlock} to 1
  292.             set {_what} to {_char} parsed as number
  293.             set {_totalnum} to {_totalnum} * 10
  294.             add {_what} to {_totalnum}
  295.         else:
  296.             set {_ahh} to join {_ahh} and {_char}
  297.             if {_numlock} is 1:
  298.                 set {_numlock} to 2
  299.         set {_p} to last (length of {_p} - 1) characters of {_p}
  300.         add 1 to {_help}
  301.     if {_validdate::*} does not contain {_ahh}:
  302.         set {_invalid} to true
  303.     else:
  304.         set {_tempres} to parseShortTime({_totalnum}, {_ahh})
  305.         add {_tempres} to {_secres}
  306.     if {_invalid} is true:
  307.         add "error" to {_package::*}
  308.         return {_package::*}
  309.     else:
  310.         # broadcast "%{_secres}% seconds."
  311.         # set {_timespan} to "%{_secres}% seconds" parsed as timespan
  312.         # broadcast "%{_timespan}%"
  313.         add {_secres} to {_package::*}
  314.         return {_package::*}
  315.  
  316. function parseShortTime(n: number, s: text) :: number:
  317.     add "y" to {_validdate::*}
  318.     add "mo" to {_validdate::*}
  319.     add "w" to {_validdate::*}
  320.     add "d" to {_validdate::*}
  321.     add "h" to {_validdate::*}
  322.     add "s" to {_validdate::*}
  323.     add "m" to {_validdate::*}
  324.    
  325.     set {_zero} to 0
  326.     if {_validdate::*} does not contain {_s}:
  327.         return {_zero}
  328.     if {_s} is "m":
  329.         set {_n} to {_n} * 60
  330.     if {_s} is "h":
  331.         set {_n} to {_n} * 3600
  332.     if {_s} is "d":
  333.         set {_n} to {_n} * 86400
  334.     if {_s} is "w":
  335.         set {_n} to {_n} * 604800
  336.     if {_s} is "mo":
  337.         set {_n} to {_n} * 2592000
  338.     if {_s} is "y":
  339.         set {_n} to {_n} * 31557600
  340.     return {_n}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement