Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- whitelisted-UUID: "2bbd185f-8124-4339-b5ae-db9a4c614fd5" or "e1e67f93-3047-42b8-ad96-d94c04777e30"
- message-permission: &cYou are not allowed to use this command!
- enable-log: true
- log-view-permission: "server.helper" or "server.mod" or "server.admin" or "server.owner"
- permission-tempban: server.helper
- permission-mute: server.helper
- permission-kick: server.helper
- permission-unban: server.admin
- permission-unmute: server.admin
- permission-history: server.helper
- on connect:
- set {_Id} to {punishedId::%player%}
- if {punishedId::%player%} is set:
- if {punishedType::%{_Id}%} is "ban" or "kick":
- if {punishedType::%{_Id}%} is "kick":
- delete {punishedId::%player%}
- stop
- set {_bannedTime} to difference between now and {punishedTime::%{_Id}%}
- set {_ban-cooldown} to {punishedExpire::%{_Id}%}
- if {_bannedTime} is greater than {punishedExpire::%{_Id}%}:
- delete {punishedId::%player%}
- stop
- else:
- set {_timeleft} to {punishedExpire::%{_Id}%}
- reduce {_timeleft} by {_bannedTime}
- kick player due to "%nl%&f▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃%nl%&cYou have been banned:%nl%&f%{punishedReason::%{_Id}%}% &7[ID: %{punishedId::%player%}%] %nl%%nl%&cExpire Time: &f%{_timeleft}%%nl%&f▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃%nl%"
- if "{@enable-log}" is "true":
- sendStaff("&7[&c&lPUNISH LOG&7] &e%player% &chas been blocked from joining the server: &eBANNED%nl%&7[&c&lPUNISH LOG&7] &cExpire in: &e%{_timeleft}%")
- on chat:
- set {_Id} to {punishedId::%player%}
- if {punishedId::%player%} is set:
- if {punishedType::%{_Id}%} is "mute":
- set {_bannedTime} to difference between now and {punishedTime::%{_Id}%}
- set {_ban-cooldown} to {punishedExpire::%{_Id}%}
- if {_bannedTime} is greater than {punishedExpire::%{_Id}%}:
- delete {punishedId::%player%}
- stop
- else:
- set {_timeleft} to {punishedExpire::%{_Id}%}
- reduce {_timeleft} by {_bannedTime}
- send "&7[&c&lMUTE&7] &cYou are muted! Expire in &e%{_timeleft}%&c!" to player
- cancel event
- if "{@enable-log}" is "true":
- sendStaff("&7[&c&lPUNISH LOG&7] &e%player% &chas been blocked from send message: &eMUTED%nl%&7[&c&lPUNISH LOG&7] &cExpire in: &e%{_timeleft}%")
- command //tempban [<player>] [<number>] [<text>] [<text>]:
- trigger:
- if executor don't have permission "{@permission-tempban}":
- send "{@message-permission}" to executor
- stop
- if arg 1 or arg 2 or arg 3 or arg 4 is not set:
- send "&cUsage: //tempban <player> <time span[ s / m / h / d ]> <reason>" to executor
- send "&cExample: //tempban %executor% 1 d Example" to executor
- stop
- if arg 2 <= 0:
- send "&cError: Time span can't be set to %arg 2% %arg 3%" to executor
- stop
- if arg 3 is not "s" or "m" or "h" or "d":
- send "&cError: Time span can't be set to %arg 2% %arg 3%" to executor
- stop
- if arg 4 is not set:
- send "&cUsage: //tempban <player> <time span[ s / m / h / d ]> <reason>" to executor
- send "&cExample: //tempban %executor% 1 d Example" to executor
- stop
- requestNewPunish(executor, arg 1, "ban", arg 2, arg 3, arg 4)
- command //mute [<player>] [<number>] [<text>] [<text>]:
- trigger:
- if executor don't have permission "{@permission-mute}":
- send "{@message-permission}" to executor
- stop
- if arg 1 or arg 2 or arg 3 or arg 4 is not set:
- send "&cUsage: //mute <player> <time span[ s / m / h / d ]> <reason>" to executor
- send "&cExample: //mute %executor% 1 d Example" to executor
- stop
- if arg 2 <= 0:
- send "&cError: Time span can't be set to %arg 2% %arg 3%" to executor
- stop
- if arg 3 is not "s" or "m" or "h" or "d":
- send "&cError: Time span can't be set to %arg 2% %arg 3%" to executor
- stop
- if arg 4 is not set:
- send "&cUsage: //mute <player> <time span[ s / m / h / d ]> <reason>" to executor
- send "&cExample: //mute %executor% 1 d Example" to executor
- stop
- requestNewPunish(executor, arg 1, "mute", arg 2, arg 3, arg 4)
- command //kick [<player>] [<text>]:
- trigger:
- if executor don't have permission "{@permission-kick}":
- send "{@message-permission}" to executor
- stop
- if arg 1 or arg 2 is not set:
- send "&cUsage: //kick <player> <reason>" to executor
- stop
- if arg 1 is not online:
- send "&cError: &e%arg 1% &cis not online!" to executor
- stop
- requestNewPunish(executor, arg 1, "kick", 0, "s", arg 2)
- command //unban [<offline player>]:
- trigger:
- if executor don't have permission "{@permission-unban}":
- send "{@message-permission}" to executor
- stop
- if arg 1 is not set:
- send "&cUsage: //unban <player>" to executor
- stop
- if {punishedId::%arg 1%} is not set:
- send "&cError: &e%arg 1% &cis not banned!" to executor
- stop
- if {punishedType::%{punishedId::%arg 1%}%} is not "ban":
- send "&cError: &e%arg 1% &cis not banned!" to executor
- stop
- delete {punishedId::%arg 1%}
- send "&7[&c&lUNBAN&7] &e%arg 1% &chas been unbanned!" to all players
- command //unmute [<offline player>]:
- trigger:
- if executor don't have permission "{@permission-unmute}":
- send "{@message-permission}" to executor
- stop
- if arg 1 is not set:
- send "&cUsage: //unmute <player>" to executor
- stop
- if {punishedId::%arg 1%} is not set:
- send "&cError: &e%arg 1% &cis not muted!" to executor
- stop
- if {punishedType::%{punishedId::%arg 1%}%} is not "mute":
- send "&cError: &e%arg 1% &cis not muted!" to executor
- stop
- delete {punishedId::%arg 1%}
- send "&7[&c&lUNMUTE&7] &e%arg 1% &chas been unmuted!" to all players
- command //history [<offline player>]:
- trigger:
- if executor don't have permission "{@permission-history}":
- send "{@message-permission}" to executor
- stop
- send "&7[&c&lHISTORY&7] &e%arg 1%&c's history:" to executor
- loop {punishedPlayer::*}:
- if "%{punishedPlayer::%loop-index%}%" is equal to "%arg 1%":
- set {_punishType} to toUpperCase("%{punishedType::%loop-index%}%")
- if {punishedType::%loop-index%} is "ban" or "mute":
- set {_bannedTime} to difference between now and {punishedTime::%loop-index%}
- set {_ban-cooldown} to {punishedExpire::%loop-index%}
- if {_bannedTime} is greater than {punishedExpire::%loop-index%}:
- set {_punishStat} to "&c[Expired]"
- else if "%{punishedId::%arg 1%}%" is equal to "%loop-index%":
- set {_punishStat} to "&a[Active]"
- else:
- set {_punishStat} to "&c[Expired]"
- else:
- set {_punishStat} to ""
- send "&7[&c&lHISTORY&7] &c[%{_punishType}%] &7[##%loop-index%] &e[%{punishedTime::%loop-index%}%] &c» &e%{punishedReason::%loop-index%}% %{_punishStat}%" to executor
- function requestNewPunish(executor: player, player: player, type: text, expireTimeArg1: number, expireTimeArg2: text, reason: text):
- if {_player}'s UUID is {@whitelisted-UUID}:
- send "&cYou are not allowed to %{_type}% this player!" to {_executor}
- if "{@enable-log}" is "true":
- sendStaff("&7[&c&lPUNISH LOG&7] &e%{_executor}% &chas been blocked from punish &e%{_player}%&c: &ePlayer Whitelisted%nl%&7[&c&lPUNISH LOG&7] &cCurrenct Time: &e%now%")
- stop
- if {_expireTimeArg2} is not "s" or "m" or "h" or "d":
- stop
- if {_expireTimeArg2} is "s":
- set {_arg2} to "second"
- else if {_expireTimeArg2} is "m":
- set {_arg2} to "minute"
- else if {_expireTimeArg2} is "h":
- set {_arg2} to "hour"
- else if {_expireTimeArg2} is "d":
- set {_arg2} to "day"
- if {_expireTimeArg1} > 1:
- set {_arg3} to "s"
- else:
- set {_arg3} to ""
- set {_timespan} to ("%{_expireTimeArg1}% %{_arg2}%%{_arg3}%" parsed as time span)
- getNewPunish({_executor}, {_player}, {_type}, {_timespan}, {_reason})
- function getNewPunish(executor: player, player: player, type: text, expireTime: time span, reason: text):
- set {_toggleWhile} to true
- while {_toggleWhile}:
- set {_Id} to random integer between 100000 and 999999
- if {punishedPlayer::%{_Id}%} is not set:
- set {_toggleWhile} to false
- set {punishedId::%{_player}%} to {_Id}
- set {punishedPlayer::%{_Id}%} to {_player}
- set {punishedType::%{_Id}%} to {_type}
- set {punishedTime::%{_Id}%} to now
- set {punishedExpire::%{_Id}%} to {_expireTime}
- set {punishedReason::%{_Id}%} to {_reason}
- if {_type} is "kick" or "ban" or "mute":
- if {_type} is "kick":
- set {_action} to "kicked"
- else if {_type} is "ban":
- set {_action} to "banned"
- else if {_type} is "mute":
- set {_action} to "muted"
- set {_punishTitle} to toUpperCase({_type})
- if {_type} is "kick":
- kick {_player} due to "%nl%&f▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃%nl%&cYou have been %{_action}%:%nl%&f%{punishedReason::%{_Id}%}% &7[ID: %{punishedId::%{_player}%}%] %nl%%nl%&f▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃%nl%"
- send "&7[&c&l%{_punishTitle}%&7] &e%{punishedPlayer::%{_Id}%}% &chas been %{_action}% &cfor: &e%{punishedReason::%{_Id}%}%&c!" to all players
- else if {_type} is "ban":
- kick {_player} due to "%nl%&f▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃%nl%&cYou have been %{_action}%:%nl%&f%{punishedReason::%{_Id}%}% &7[ID: %{punishedId::%{_player}%}%] %nl%%nl%&cExpire Time: &f%{punishedExpire::%{_Id}%}%%nl%&f▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃%nl%"
- send "&7[&c&l%{_punishTitle}%&7] &e%{punishedPlayer::%{_Id}%}% &chas been %{_action}% &e%{punishedExpire::%{_Id}%}% &cfor: &e%{punishedReason::%{_Id}%}%&c!" to all players
- else if {_type} is "mute":
- send "&7[&c&l%{_punishTitle}%&7] &e%{punishedPlayer::%{_Id}%}% &chas been %{_action}% &e%{punishedExpire::%{_Id}%}% &cfor: &e%{punishedReason::%{_Id}%}%&c!" to all players
- function sendStaff(message: text):
- loop all players:
- if loop-player has permission {@log-view-permission}:
- send "%{_message}%" to loop-player
- function toUpperCase(text: text) :: text:
- replace "a" with "A" in {_text}
- replace "b" with "B" in {_text}
- replace "c" with "C" in {_text}
- replace "d" with "D" in {_text}
- replace "e" with "E" in {_text}
- replace "f" with "F" in {_text}
- replace "g" with "G" in {_text}
- replace "h" with "H" in {_text}
- replace "i" with "I" in {_text}
- replace "j" with "J" in {_text}
- replace "k" with "K" in {_text}
- replace "l" with "L" in {_text}
- replace "m" with "M" in {_text}
- replace "n" with "N" in {_text}
- replace "o" with "O" in {_text}
- replace "p" with "P" in {_text}
- replace "q" with "Q" in {_text}
- replace "r" with "R" in {_text}
- replace "s" with "S" in {_text}
- replace "t" with "T" in {_text}
- replace "u" with "U" in {_text}
- replace "v" with "V" in {_text}
- replace "w" with "W" in {_text}
- replace "x" with "X" in {_text}
- replace "y" with "Y" in {_text}
- replace "z" with "Z" in {_text}
- return {_text}
- function toLowerCase(text: text) :: text:
- replace "A" with "a" in {_text}
- replace "B" with "b" in {_text}
- replace "C" with "c" in {_text}
- replace "D" with "d" in {_text}
- replace "E" with "e" in {_text}
- replace "F" with "f" in {_text}
- replace "G" with "g" in {_text}
- replace "H" with "h" in {_text}
- replace "I" with "i" in {_text}
- replace "J" with "j" in {_text}
- replace "K" with "k" in {_text}
- replace "L" with "l" in {_text}
- replace "M" with "m" in {_text}
- replace "N" with "n" in {_text}
- replace "O" with "o" in {_text}
- replace "P" with "p" in {_text}
- replace "Q" with "q" in {_text}
- replace "R" with "r" in {_text}
- replace "S" with "s" in {_text}
- replace "T" with "t" in {_text}
- replace "U" with "u" in {_text}
- replace "V" with "v" in {_text}
- replace "W" with "w" in {_text}
- replace "X" with "x" in {_text}
- replace "Y" with "y" in {_text}
- replace "Z" with "z" in {_text}
- return {_text}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement