Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- script options:
- $ db url jdbc:mysql://193.70.81.37/mc3184
- $ db username mc3184
- $ db password 168a46ac61
- options:
- Logo: &6&lIgnis&7 »
- BanHeader: &4✖ &6&lIgnis &4✖
- KickHeader: &4✖ &6&lIgnis &4✖
- Activated: &fLoaded punishment system.
- Format_Days: days
- Format_Day: day
- Format_Hours: hours
- Format_Hour: hour
- Format_Minutes: minutes
- Format_Minute: minute
- Format_Seconds: seconds
- Format_Second: second
- Ban_Perm_Line1: &7You've been banned from &6Ignis &4PERMANENTLY&c.
- Ban_Perm_Line2: &7Reason: &c%{_getReason}%
- Ban_Perm_Line3: &6» &7Appeal at @IgnisUHC &6«
- Ban_Temp_Line1: &7You've been banned from &6Ignis&c for &c%{_parameter}%&c.
- Ban_Temp_Line2: &7Reason: &c%{_getReason}%
- Ban_Temp_Line3: %nl%&7Remaining time: &a%{_getUNIXTime}%
- Ban_Temp_Line4: %nl%&6» &7Appeal at @IgnisUHC &6«
- Kick_Line1: &cYou've been kicked by &a%player%&c.
- Kick_Line2: &cYou've been kicked by &aCONSOLE&c.
- Kick_Reason: &7Reason: &c%arg-2%
- Mute_Perm: &6» &cYou've been muted &4PERMANENTLY&c.
- Mute_Reason: &6» &7Reason: &c%{_getReason}%
- Mute_Temp: &6» &cYou've been muted for &e%{_parameter}%&c.
- Mute_Reason: &6» &7Reason: &c%{_getReason}%
- Mute_TimeEnd: &6» &7Remaining time: &a%{_getUNIXTime}%
- ConsoleName: CONSOLE
- NoPermission: &fYou do not have permissions to use this command!
- NoName: &cPlease enter a vaild player name
- NotAllowedSize: &cPlease select an integer between 1 and 12
- NoSelfKick: &cYou can't kick yourself
- NoSelfBan: &cYou can't ban yourself
- NoSelfMute: &cYou can't mute yourself
- AlreadyBanned: &cThis player has been already banned
- AlreadyMuted: &cThis player has been already muted
- PlayerNotBanned: &cThis player isn't banned
- PlayerNotMuted: &cThis player isn't muted
- NoInteger: &cPlease enter an integer
- NoTime: &cPlease enter a vaild parameter (seconds, minutes, hours, days)
- NoReason: &cPlease enter a reason
- PlayerNotFound: &cThat player couldn't be found
- IPNotFound: &cThat IP address couldn't be found
- PlayerWasUnbanned: &aThe player has been unbanned
- PlayerWasUnmuted: &aThe player has been unmuted
- NoHistory: &7No logs were found from that player
- # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
- on load:
- $ thread
- update "CREATE TABLE if NOT EXISTS `Ban` (`Player` varchar(255),`Time` varchar(255),`Executed` varchar(255),`Reason` varchar(255),`FromPlayer` varchar(255))"
- $ thread
- update "CREATE TABLE if NOT EXISTS `Mute` (`Player` varchar(255),`Time` varchar(255),`Executed` varchar(255),`Reason` varchar(255),`FromPlayer` varchar(255))"
- $ thread
- update "CREATE TABLE if NOT EXISTS `IP` (`Player` varchar(255),`IP` varchar(255),`UUID` varchar(255))"
- $ thread
- update "CREATE TABLE if NOT EXISTS `History` (`Player` varchar(255),`Log` varchar(255))"
- $ thread
- update "CREATE TABLE if NOT EXISTS `Presets` (`Name` varchar(255),`Command` varchar(255))"
- if {Bans.Tables.Alter} is not set:
- set {Bans.Tables.Alter} to true
- $ thread
- update "ALTER TABLE Ban ADD UNIQUE (Player, Time, Executed, Reason, FromPlayer)"
- $ thread
- update "ALTER TABLE Mute ADD UNIQUE (Player, Time, Executed, Reason, FromPlayer)"
- $ thread
- update "ALTER TABLE IP ADD UNIQUE (Player, UUID)"
- $ thread
- update "ALTER TABLE History ADD UNIQUE (Player, Log)"
- $ thread
- update "ALTER TABLE Presets ADD UNIQUE (Name, Command)"
- broadcast "{@Logo} {@Activated}"
- function getIP(p_name:text) :: text:
- set {_SetResult::*} to objects in column "IP" from result of query "SELECT * FROM IP WHERE Player = '%{_p_name}%'"
- set {_getResult} to false
- loop {_SetResult::*}:
- set {_getResult} to true
- if {_getResult} is true:
- return "%{_SetResult::*}%"
- else:
- return "false"
- function getUUID(p_name:text) :: text:
- set {_SetResult::*} to objects in column "UUID" from result of query "SELECT * FROM IP WHERE Player = '%{_p_name}%'"
- set {_getResult} to false
- loop {_SetResult::*}:
- set {_getResult} to true
- if {_getResult} is true:
- return "%{_SetResult::*}%"
- else:
- return "false"
- function getAccounts(p_name: text) :: text:
- if {_p_name} does not contain ".":
- set {_ip} to getIP({_p_name})
- else:
- set {_ip} to {_p_name}
- set {_SetResult::*} to objects in column "Player" from result of query "SELECT Player FROM IP WHERE IP = '%{_ip}%'"
- return "%{_SetResult::*}%"
- function getPlayers(p_name: text = "") :: texts:
- set {_SetResult::*} to objects in column "Player" from result of query "SELECT Player FROM IP WHERE Player LIKE '%%%{_p_name}%%%'"
- if {_SetResult::*} is set:
- return {_SetResult::*}
- function RemoveBannedPlayer(p_name:text):
- set {_SetResult::*} to objects in column "Player" from result of query "SELECT * FROM Ban WHERE Player = '%{_p_name}%'"
- set {_getResult} to false
- loop {_SetResult::*}:
- if loop-value is {_p_name}:
- set {_getResult} to true
- if {_getResult} is true:
- update "DELETE FROM Ban WHERE Player = '%{_p_name}%'"
- function getBannedPlayer(p_name:text, column:text) :: text:
- set {_SetResult::*} to objects in column "%{_column}%" from result of query "SELECT * FROM Ban WHERE Player = '%{_p_name}%'"
- if {_column} is not "Player":
- return "%{_SetResult::*}%"
- else:
- set {_getResult} to false
- loop {_SetResult::*}:
- if loop-value is {_p_name}:
- set {_getResult} to true
- if {_getResult} is true:
- return "true"
- else:
- return "false"
- function MutePlayer(p_name:text, p_time:text, p_reason:text, from:text):
- set {_SetResult::*} to objects in column "Player" from result of query "SELECT * FROM Mute WHERE Player = '%{_p_name}%'"
- set {_getResult} to false
- loop {_SetResult::*}:
- if loop-value is {_p_name}:
- set {_getResult} to true
- if {_getResult} is false:
- update "INSERT INTO `Mute` (`Player`,`Time`,`Executed`,`Reason`,`FromPlayer`) VALUES ('%{_p_name}%', '%{_p_time}%', '%unix time%', '%{_p_reason}%', '%{_from}%')"
- function getMutedPlayer(p_name:text, column:text) :: text:
- set {_SetResult::*} to objects in column "%{_column}%" from result of query "SELECT * FROM Mute WHERE Player = '%{_p_name}%'"
- if {_column} is not "Player":
- return "%{_SetResult::*}%"
- else:
- set {_getResult} to false
- loop {_SetResult::*}:
- if loop-value is {_p_name}:
- set {_getResult} to true
- if {_getResult} is true:
- return "true"
- else:
- return "false"
- function RemoveMutedPlayer(p_name:text):
- set {_SetResult::*} to objects in column "Player" from result of query "SELECT * FROM Mute WHERE Player = '%{_p_name}%'"
- set {_getResult} to false
- loop {_SetResult::*}:
- if loop-value is {_p_name}:
- set {_getResult} to true
- if {_getResult} is true:
- update "DELETE FROM Mute WHERE Player = '%{_p_name}%'"
- # UNIX algorithm calculation in Skript - isn't it awesome? ã‚·
- # This calculation method may take some performance while calculating big numbers but it's the easiest way.
- # I've already used this method in an Java algorithm.
- function UNIX_Algorithm(executed:text, time:text, parameter:text) :: text:
- set {_executed} to {_executed} parsed as number
- if {_parameter} contains "second":
- set {_time} to {_time} parsed as number
- else:
- if {_parameter} contains "minute":
- set {_time} to {_time} parsed as number
- set {_time} to ({_time}*60)
- else:
- if {_parameter} contains "hour":
- set {_time} to {_time} parsed as number
- set {_time} to ((({_time}*60)*60))
- else:
- if {_parameter} contains "day":
- set {_time} to {_time} parsed as number
- set {_time} to (((({_time}*24)*60)*60))
- set {_Calculate.UNIX} to ({_executed}+{_time})
- set {_Calculate.Now.UNIX} to unix time
- set {_Calculate.Result} to ({_Calculate.UNIX}-{_Calculate.Now.UNIX})
- set {_UNIX.DAYS} to 0
- set {_UNIX.HOURS} to 0
- set {_UNIX.MINUTES} to 0
- set {_UNIX.SECONDS} to 0
- while {_Calculate.Result} is bigger or equal to 86400:
- set {_UNIX.DAYS} to ({_UNIX.DAYS}+1)
- set {_Calculate.Result} to ({_Calculate.Result}-86400)
- if {_Calculate.Result} is smaller than 86400:
- while {_Calculate.Result} is bigger or equal to 3600:
- set {_UNIX.HOURS} to ({_UNIX.HOURS}+1)
- set {_Calculate.Result} to ({_Calculate.Result}-3600)
- if {_Calculate.Result} is smaller than 3600:
- while {_Calculate.Result} is bigger or equal to 60:
- set {_UNIX.MINUTES} to ({_UNIX.MINUTES}+1)
- set {_Calculate.Result} to ({_Calculate.Result}-60)
- if {_Calculate.Result} is smaller than 60:
- set {_UNIX.SECONDS} to {_Calculate.Result}
- if "%{_UNIX.DAYS}%", "%{_UNIX.HOURS}%", "%{_UNIX.MINUTES}%" or "%{_UNIX.SECONDS}%" contains "-":
- return "false"
- else:
- return "%{_UNIX.DAYS}%'d %{_UNIX.HOURS}%'h %{_UNIX.MINUTES}%'m %{_UNIX.SECONDS}%'s"
- function CheckMutedPlayer(p_name:text) :: text:
- set {_uuid} to getUUID("%{_p_name}%")
- set {_getReason} to getMutedPlayer("%{_uuid}%", "Reason")
- set {_getMuteState} to getMutedPlayer("%{_uuid}%", "Time")
- if {_getMuteState} is "permanently":
- set {_p_name} to "%{_p_name}%" parsed as player
- send "" to {_p_name}
- send " {@Mute_Perm}" to {_p_name}
- send " {@Mute_Reason}" to {_p_name}
- send "" to {_p_name}
- return "true"
- else:
- add {_getMuteState} split at " " to {_Cache::*}
- set {_Cache::1} to "%{_Cache::1}%" parsed as number
- set {_Cache::2} to "%{_Cache::2}%" parsed as text
- if {_Cache::2} contains "day":
- if {_Cache::1} is bigger than 1:
- set {_parameter} to "%{_Cache::1}% {@Format_Days}"
- else:
- set {_parameter} to "%{_Cache::1}% {@Format_Day}"
- if {_Cache::2} contains "hour":
- if {_Cache::1} is bigger than 1:
- set {_parameter} to "%{_Cache::1}% {@Format_Hours}"
- else:
- set {_parameter} to "%{_Cache::1}% {@Format_Hour}"
- if {_Cache::2} contains "minute":
- if {_Cache::1} is bigger than 1:
- set {_parameter} to "%{_Cache::1}% {@Format_Minutes}"
- else:
- set {_parameter} to "%{_Cache::1}% {@Format_Minute}"
- if {_Cache::2} contains "second":
- if {_Cache::1} is bigger than 1:
- set {_parameter} to "%{_Cache::1}% {@Format_Seconds}"
- else:
- set {_parameter} to "%{_Cache::1}% {@Format_Second}"
- set {_uuid} to getUUID("%{_p_name}%")
- set {_getExecuted} to getMutedPlayer("%{_uuid}%", "Executed")
- set {_getTime} to getMutedPlayer("%{_uuid}%", "Time")
- add {_getTime} split at " " to {_Parameter::*}
- set {_getUNIXTime} to UNIX_Algorithm({_getExecuted}, {_Parameter::1}, {_Parameter::2})
- if {_getUNIXTime} is "false":
- set {_uuid} to getUUID("%{_p_name}%")
- RemoveMutedPlayer("%{_uuid}%")
- else:
- set {_p_name} to "%{_p_name}%" parsed as player
- send "" to {_p_name}
- send " {@Mute_Temp}" to {_p_name}
- send " {@Mute_Reason}" to {_p_name}
- send " {@Mute_TimeEnd}" to {_p_name}
- send "" to {_p_name}
- return "true"
- function KickPlayer(p_name:text):
- set {_uuid} to getUUID("%{_p_name}%")
- set {_getReason} to getBannedPlayer("%{_uuid}%", "Reason")
- set {_getBanState} to getBannedPlayer("%{_uuid}%", "Time")
- if {_getBanState} is "permanently":
- set {_p_name} to {_p_name} parsed as player
- kick {_p_name} due to "{@BanHeader}%nl%&f%nl%{@Ban_Perm_Line1}%nl%{@Ban_Perm_Line2}%nl%&f%nl%{@Ban_Perm_Line3}"
- else:
- add {_getBanState} split at " " to {_Cache::*}
- set {_Cache::1} to "%{_Cache::1}%" parsed as number
- set {_Cache::2} to "%{_Cache::2}%" parsed as text
- if {_Cache::2} contains "day":
- if {_Cache::1} is bigger than 1:
- set {_parameter} to "%{_Cache::1}% {@Format_Days}"
- else:
- set {_parameter} to "%{_Cache::1}% {@Format_Day}"
- if {_Cache::2} contains "hour":
- if {_Cache::1} is bigger than 1:
- set {_parameter} to "%{_Cache::1}% {@Format_Hours}"
- else:
- set {_parameter} to "%{_Cache::1}% {@Format_Hour}"
- if {_Cache::2} contains "minute":
- if {_Cache::1} is bigger than 1:
- set {_parameter} to "%{_Cache::1}% {@Format_Minutes}"
- else:
- set {_parameter} to "%{_Cache::1}% {@Format_Minute}"
- if {_Cache::2} contains "second":
- if {_Cache::1} is bigger than 1:
- set {_parameter} to "%{_Cache::1}% {@Format_Seconds}"
- else:
- set {_parameter} to "%{_Cache::1}% {@Format_Second}"
- set {_uuid} to getUUID("%{_p_name}%")
- set {_getExecuted} to getBannedPlayer("%{_uuid}%", "Executed")
- set {_getTime} to getBannedPlayer("%{_uuid}%", "Time")
- add {_getTime} split at " " to {_Parameter::*}
- set {_getUNIXTime} to UNIX_Algorithm({_getExecuted}, {_Parameter::1}, {_Parameter::2})
- if {_getUNIXTime} is "false":
- set {_uuid} to getUUID("%{_p_name}%")
- RemoveBannedPlayer("%{_uuid}%")
- else:
- set {_p_name} to {_p_name} parsed as player
- kick {_p_name} due to "{@BanHeader}%nl%&f%nl%{@Ban_Temp_Line1}%nl%{@Ban_Temp_Line2}%nl%{@Ban_Temp_Line3}%nl%&f%nl%{@Ban_Temp_Line4}"
- function BanPlayer(p_name:text, p_time:text, p_reason:text, from:text):
- set {_SetResult::*} to objects in column "Player" from result of query "SELECT * FROM Ban WHERE Player = '%{_p_name}%'"
- set {_getResult} to false
- loop {_SetResult::*}:
- if loop-value is {_p_name}:
- set {_getResult} to true
- if {_getResult} is false:
- update "INSERT INTO `Ban` (`Player`,`Time`,`Executed`,`Reason`,`FromPlayer`) VALUES ('%{_p_name}%', '%{_p_time}%', '%unix time%', '%{_p_reason}%', '%{_from}%')"
- $ thread
- set {_player} to value of sql var "pn::%{_p_name}%"
- set {_player} to {_player} parsed as offlineplayer
- {_player} is online
- KickPlayer("%{_player}%")
- function AddHistoryLog(p_name:text, p_log:text):
- update "INSERT INTO `History` (`Player`,`Log`) VALUES ('%{_p_name}%', '%{_p_log}%')"
- function setIPofPlayer(p_name:text, ip:text, uuid:text):
- if {_uuid} is not "-":
- set {_SetResult::*} to objects in column "UUID" from result of query "SELECT * FROM IP WHERE UUID = '%{_uuid}%'"
- set {_GetResult} to false
- loop {_SetResult::*}:
- set {_GetResult} to true
- if {_GetResult} is true:
- update "UPDATE `IP` SET `IP` = '%{_ip}%' WHERE `IP`.`UUID` = '%{_uuid}%'"
- update "UPDATE `IP` SET `Player` = '%{_p_name}%' WHERE `IP`.`UUID` = '%{_uuid}%'"
- else:
- set {_SetResult::*} to objects in column "Player" from result of query "SELECT * FROM IP WHERE Player = '%{_p_name}%'"
- set {_GetResult} to false
- loop {_SetResult::*}:
- set {_GetResult} to true
- if {_GetResult} is true:
- update "UPDATE `IP` SET `IP` = '%{_ip}%' WHERE `IP`.`Player` = '%{_p_name}%'"
- update "UPDATE `IP` SET `UUID` = '-' WHERE `IP`.`Player` = '%{_p_name}%'"
- set {_SetResult2::*} to objects in column "IP" from result of query "SELECT * FROM IP WHERE IP = '%{_ip}%'"
- set {_GetResult2} to false
- loop {_SetResult2::*}:
- set {_GetResult2} to true
- if {_GetResult2} is false:
- update "INSERT INTO `IP` (`IP`,`Player`,`UUID`) VALUES ('%{_ip}%', '%{_p_name}%', '%{_uuid}%')"
- else:
- if {_uuid} is not "-":
- $ thread
- set {_SetResult2::*} to objects in column "UUID" from result of query "SELECT * FROM IP WHERE UUID = '%{_uuid}%'"
- set {_GetResult2} to false
- loop {_SetResult2::*}:
- if loop-value is {_uuid}:
- set {_GetResult2} to true
- else:
- set {_SetResult2::*} to objects in column "Player" from result of query "SELECT * FROM IP WHERE Player = '%{_p_name}%'"
- set {_GetResult2} to false
- loop {_SetResult2::*}:
- if loop-value is {_p_name}:
- set {_GetResult2} to true
- if {_GetResult2} is false:
- update "INSERT INTO `IP` (`IP`,`Player`,`UUID`) VALUES ('%{_ip}%', '%{_p_name}%', '%{_uuid}%')"
- function ipExists(ip:text) :: boolean:
- set {_SetResult::*} to objects in column "IP" from result of query "SELECT * FROM IP WHERE IP = '%{_ip}%'"
- set {_getResult} to false
- loop {_SetResult::*}:
- if loop-value is "%{_ip}%":
- set {_getResult} to true
- return {_getResult}
- function WasPlayerAlreadyOnline(p_name:text) :: text:
- set {_SetResult::*} to objects in column "Player" from result of query "SELECT * FROM IP WHERE Player = '%{_p_name}%'"
- set {_getResult} to false
- loop {_SetResult::*}:
- if loop-value is "%{_p_name}%":
- set {_getResult} to true
- if {_getResult} is true:
- return "true"
- else:
- return "false"
- function getPreset(name: text) :: text:
- set {_SetResult::*} to objects in column "Name" from result of query "SELECT * FROM Presets WHERE Name = '%{_name}%'"
- set {_getResult} to false
- loop {_SetResult::*}:
- if loop-value is "%{_name}%":
- set {_getResult} to true
- if {_getResult} is true:
- return "true"
- else:
- return "false"
- function addPreset(name: text, cmd: text):
- update "INSERT INTO `Presets` (`Name`,`Command`) VALUES ('%{_name}%', '%{_cmd}%')"
- function deletePreset(name: text):
- update "DELETE FROM Presets WHERE Name = '%{_name}%'"
- command /punish [<text>]:
- executable by: players
- trigger:
- if player does not have permission "punishments.punish":
- send "{@Logo} {@NoPermission}"
- else:
- if arg-1 is not set:
- send "{@Logo} {@NoName}"
- send "{@Logo} &a/punish &c<player>"
- else:
- if arg-1 is player:
- send "{@Logo} &cYou can't punish yourself!"
- else:
- $ thread
- set {_getIP} to WasPlayerAlreadyOnline("%arg-1%")
- if {_getIP} is "false":
- send "{@Logo} {@PlayerNotFound}"
- else:
- $ thread
- set {_punishmentnames::*} to objects in column "Name" from result of query "SELECT * FROM Presets"
- $ thread
- set {_punishmentcommands::*} to objects in column "Command" from result of query "SELECT * FROM Presets"
- if size of {_punishmentnames::*} is 0:
- send "{@Logo} &cThere are currently no presets made!"
- else:
- open chest with ceil(size of {_punishmentnames::*}/9) rows named "&aPreset Punishments" to sender
- loop {_punishmentnames::*}:
- set {_cmd} to {_punishmentcommands::%loop-index%}
- set {_name} to "%loop-value%"
- replace all "_" with " " in {_name}
- replace all "%%player%%" with "%arg-1%" in {_cmd}
- add 1 to {_slot}
- evaluate "format slot {_slot} - 1 of sender with a redstone block named ""&a%{_name}%"" with lore ""&7&o%{_cmd}%"" to close then run [sender command ""%{_cmd}%""]"
- command /presets [<text>] [<text>] [<text>]:
- aliases: /preset
- trigger:
- if player does not have permission "punishments.presets":
- send "{@Logo} {@NoPermission}"
- else if arg-1 is "add":
- if arg-2 is not set:
- send "{@Logo} &cYou are missing a punishment name!"
- else if arg-3 is not set:
- send "{@Logo} &cYou are missing a command!"
- else if getPreset(arg-2) is "true":
- send "{@Logo} &cThe preset punishment &a%arg-2%&7 is already made! Do /preset delete %arg-2% then remake it."
- else:
- $ thread
- addPreset(arg-2, arg-3)
- send "{@Logo} &7Added punishment &a%arg-2%&7 to run &a%arg-3%"
- else if arg-1 is "delete":
- if arg-2 is not set:
- send "{@Logo} &cYou are missing a punishment name!"
- else if arg-3 is set:
- send "{@Logo} &cUnexpected argument: &a%arg-3%"
- else if getPreset(arg-2) is "false":
- send "{@Logo} &cThere is no preset punishment named &a%arg-2%"
- else:
- $ thread
- deletePreset(arg-2)
- send "{@Logo} &7Deleted preset punishment &a%arg-2%"
- else:
- send "{@Logo} &7/presets add &c<punishment name> <command>"
- send "{@Logo} &7/presets delete &c<punishment name>"
- send "{@Logo} &7&oUse %%player%% to represent a player in the command."
- send "{@Logo} &7&oUse a _ to represent a space in a punishment name."
- on connect:
- set {_ban} to getBannedPlayer("%player's uuid%", "Player")
- if {_ban} is not "true":
- $ thread
- set {_ip} to getIP("%player%")
- if {_ip} is not set:
- wait 1 second
- $ thread
- set {_accounts} to getAccounts("%player%")
- replace all " and " with ", " in {_accounts}
- set {_accounts::*} to {_accounts} split at ", "
- size of {_accounts::*} is greater than 1
- loop {_accounts::*}:
- "%loop-value%" is not "%player%"
- if {ubldata::playertouuid::%loop-value%} is set:
- set {_uuid} to {ubldata::playertouuid::%loop-value%}
- {ubl::exempt::%{_uuid}%} is not set
- send "&a%player%&7 is a alt of &a%loop-value%&7 who is UBLed!" to all ops
- $ thread
- set {_ip} to getIP("%loop-value%")
- send "&7IP:&a %{_ip}%%nl%&7&oScreenshot this and send it to the courtroom to get their alt UBLed for alting!" to all ops
- command "/tempban %player% 7 days UBL Evasion of %loop-value%"
- stop loop
- set {_ban::%loop-value%} to getBannedPlayer("%{_uuid}%", "Player")
- {_ban::%loop-value%} is "true"
- $ thread
- set {_type} to getBannedPlayer("%{_uuid}%", "Time")
- $ thread
- set {_reason} to getBannedPlayer("%{_uuid}%", "Reason")
- $ thread
- set {_executor} to getBannedPlayer("%{_uuid}%", "Executed")
- if {_type} is "permanently":
- $ thread
- BanPlayer("%player's uuid%", "%{_type}%", "%{_reason}%" , "%{_executor}%")
- $ thread
- AddHistoryLog("%player's uuid%", "&c[%now%] %player% has been banned by %{_executor}% due to ""%{_reason}%"". He is also a alt of %loop-value% who is banned.")
- else:
- set {_time} to getBannedPlayer("%{_uuid}%", "Time")
- $ thread
- BanPlayer("%player's uuid%", "%{_time}%", "%{_reason}%" , "%{_executor}%")
- $ thread
- AddHistoryLog("%player's uuid%", "&c[%now%] %player% has been tempbanned by %{_executor}% due to ""%{_reason}%"" for %{_time}%. He is also a alt of %loop-value% who is banned.")
- set {_player} to "%loop-value%"
- set {_ban} to true
- stop loop
- else:
- set {_uuid} to player's uuid
- if {_ban} is "true":
- set {_getReason} to getBannedPlayer("%{_uuid}%", "Reason")
- set {_getBanState} to getBannedPlayer("%{_uuid}%", "Time")
- if {_getBanState} is "permanently":
- kick player due to "{@BanHeader}%nl%&f%nl%{@Ban_Perm_Line1}%nl%{@Ban_Perm_Line2}%nl%&f%nl%{@Ban_Perm_Line3}"
- else:
- add {_getBanState} split at " " to {_Cache::*}
- set {_Cache::1} to "%{_Cache::1}%" parsed as number
- set {_Cache::2} to "%{_Cache::2}%" parsed as text
- if {_Cache::2} contains "day":
- if {_Cache::1} is bigger than 1:
- set {_parameter} to "%{_Cache::1}% {@Format_Days}"
- else:
- set {_parameter} to "%{_Cache::1}% {@Format_Day}"
- if {_Cache::2} contains "hour":
- if {_Cache::1} is bigger than 1:
- set {_parameter} to "%{_Cache::1}% {@Format_Hours}"
- else:
- set {_parameter} to "%{_Cache::1}% {@Format_Hour}"
- if {_Cache::2} contains "minute":
- if {_Cache::1} is bigger than 1:
- set {_parameter} to "%{_Cache::1}% {@Format_Minutes}"
- else:
- set {_parameter} to "%{_Cache::1}% {@Format_Minute}"
- if {_Cache::2} contains "second":
- if {_Cache::1} is bigger than 1:
- set {_parameter} to "%{_Cache::1}% {@Format_Seconds}"
- else:
- set {_parameter} to "%{_Cache::1}% {@Format_Second}"
- set {_getExecuted} to getBannedPlayer("%{_uuid}%", "Executed")
- set {_getTime} to getBannedPlayer("%{_uuid}%", "Time")
- add {_getTime} split at " " to {_Parameter::*}
- set {_getUNIXTime} to UNIX_Algorithm({_getExecuted}, {_Parameter::1}, {_Parameter::2})
- if {_getUNIXTime} is "false":
- RemoveBannedPlayer("%{_uuid}%")
- else:
- kick player due to "{@BanHeader}%nl%&f%nl%{@Ban_Temp_Line1}%nl%{@Ban_Temp_Line2}%nl%{@Ban_Temp_Line3}%nl%&f%nl%{@Ban_Temp_Line4}"
- on join:
- $ thread
- setIPofPlayer("%player%", "%player's ip%", "%player's uuid%")
- if "%ip of player%" contains "151.80.11.", "164.132.80.", "176.31.75.", "178.33.27.", "91.121.231.", "69.130." or "82.31.16":
- kick player due to "&cCompromised account detected.%nl%&c&oIf you believe this is in error, contact a staff member."
- $ thread
- set {_text} to text from "https://api.mojang.com/users/profiles/minecraft/%player%"
- if {_text} does not contain "id":
- kick player due to "&cCompromised account detected.%nl%&c&oIf you believe this is in error, contact a staff member."
- command /history [<text>]:
- aliases: lookup
- trigger:
- if player does not have permission "punishments.history":
- send "{@Logo} {@NoPermission}"
- else:
- if arg-1 is not set:
- send "{@Logo} {@NoName}"
- send "{@Logo} &a/history &c<player>"
- else:
- $ thread
- set {_getIP} to WasPlayerAlreadyOnline("%arg-1%")
- if {_getIP} is "false":
- send "{@Logo} {@PlayerNotFound}"
- else:
- set {_BannedMoreInfo} to ""
- set {_MutedMoreInfo} to ""
- $ thread
- set {_uuid} to getUUID("%arg-1%")
- $ thread
- set {_Banned?} to getBannedPlayer("%{_uuid}%", "Player")
- if {_Banned?} is "true":
- set {_Banned?} to "&a&l✔"
- else:
- set {_Banned?} to "&c&l✖"
- $ thread
- set {_uuid} to getUUID(arg-1)
- $ thread
- set {_Muted?} to getMutedPlayer("%{_uuid}%", "Player")
- if {_Muted?} is "true":
- set {_Muted?} to "&a&l✔"
- else:
- set {_Muted?} to "&c&l✖"
- $ thread
- set {_uuid} to getUUID(arg-1)
- $ thread
- set {_SetResult::*} to objects in column "Log" from result of query "SELECT * FROM History WHERE Player = '%{_uuid}%'"
- set {_getResult} to false
- loop {_SetResult::*}:
- set {_getResult} to true
- send ""
- if {_getResult} is true:
- loop 150 times:
- if {_SetResult::%loop-number%} is set:
- send "%{_SetResult::%loop-number%}%"
- else:
- stop loop
- else:
- send "{@NoHistory}"
- $ thread
- set {_ip} to getIP("%arg-1%")
- send "&f&m=====================&6&l HISTORY &f&m====================="
- send " &eCurrently banned: %{_Banned?}% &7|| &eCurrently muted: %{_Muted?}%"
- send " &7IP: &a%{_ip}%"
- send ""
- command /accounts [<text>]:
- aliases: whois
- trigger:
- if player does not have permission "punishments.accounts":
- send "{@Logo} {@NoPermission}"
- else:
- if arg-1 is not set:
- send "{@Logo} {@NoName}"
- send "{@Logo} &a/accounts &c<player/ip>"
- else if arg-1 contains ".":
- $ thread
- set {_getIP} to ipExists(arg-1)
- if {_getIP} is false:
- send "{@Logo} {@IPNotFound}"
- else:
- $ thread
- set {_accounts} to getAccounts("%arg-1%")
- send "{@Logo} &7Accounts under the IP &a%arg-1%&7: &c%{_accounts}%"
- else:
- $ thread
- set {_getIP} to WasPlayerAlreadyOnline("%arg-1%")
- if {_getIP} is "false":
- send "{@Logo} {@PlayerNotFound}"
- else:
- $ thread
- set {_accounts} to getAccounts("%arg-1%")
- send "{@Logo} &a%arg-1%'s&7 accounts: &c%{_accounts}%"
- command /players [<text>]:
- trigger:
- if player does not have permission "punishments.players":
- send "{@Logo} {@NoPermission}"
- else:
- if arg-1 is not set:
- $ thread
- set {_players::*} to getPlayers()
- else if arg-1 is set:
- $ thread
- set {_players::*} to getPlayers("%arg-1%")
- if {_players::*} is not set:
- send "{@Logo} &cNo players were found containing %arg-1%"
- else:
- if arg-1 is set:
- send "{@Logo} &7Accounts containg &a%arg-1%&7: &c%{_players::*}% &7&o(%size of {_players::*}%&7 accounts)"
- else:
- send "{@Logo} &a%size of {_players::*}%&7 total accounts"
- command /mute [<text>] [<text>]:
- aliases: mute
- trigger:
- if player does not have permission "punishments.mute":
- send "{@Logo} {@NoPermission}"
- else:
- if arg-1 is not set:
- send "{@Logo} {@NoName}"
- send "{@Logo} &a/mute &c<player> <reason>"
- else:
- if arg-1 is player:
- send "{@Logo} {@NoSelfMute}"
- else:
- $ thread
- set {_getIP} to WasPlayerAlreadyOnline("%arg-1%")
- if {_getIP} is "false":
- send "{@Logo} {@PlayerNotFound}"
- else:
- $ thread
- set {_uuid} to getUUID("%arg-1%")
- $ thread
- set {_getResult} to getMutedPlayer("%{_uuid}%", "Player")
- if {_getResult} is "true":
- send "{@Logo} {@AlreadyMuted}"
- else:
- if arg 2 is not set:
- send "{@Logo} {@NoReason}"
- send "{@Logo} &a/mute &e%arg-1% &c<reason>"
- else:
- if sender is player:
- set {_String.From} to "%player%"
- else:
- set {_String.From} to "{@ConsoleName}"
- $ thread
- set {_uuid} to getUUID("%arg-1%")
- $ thread
- MutePlayer("%{_uuid}%", "permanently", arg-2, {_String.From})
- $ thread
- AddHistoryLog("%{_uuid}%", "&e[%now%] %arg-1% has been muted by %{_String.From}% due to ""%arg-2%"".")
- broadcast "{@Logo} &a%arg-1%&7 was muted by &a%{_String.From}% &7due to &c%arg-2%"
- command /tempmute [<text>] [<integer>] [<text>] [<text>]:
- aliases: tempmute
- trigger:
- if player does not have permission "punishments.tempmute":
- send "{@Logo} {@NoPermission}"
- else:
- if arg-1 is not set:
- send "{@Logo} {@NoName}"
- send "{@Logo} &a/tempmute &c<player> <integer> <parameter> <reason>"
- else:
- if arg-1 is player:
- send "{@Logo} {@NoSelfMute}"
- else:
- $ thread
- set {_getIP} to WasPlayerAlreadyOnline("%arg-1%")
- if {_getIP} is "false":
- send "{@Logo} {@PlayerNotFound}"
- else:
- $ thread
- set {_uuid} to getUUID("%arg-1%")
- $ thread
- set {_getResult} to getMutedPlayer("%{_uuid}%", "Player")
- if {_getResult} is "true":
- send "{@Logo} {@AlreadyMuted}"
- else:
- if arg-2 is not set:
- send "{@Logo} {@NoInteger}"
- send "{@Logo} &a/tempmute &e%arg-1% &c<integer> <parameter> <reason>"
- else:
- if arg-2 is bigger than 12000:
- send "{@Logo} {@NotAllowedSize}"
- else:
- if arg-2 is smaller than 1:
- send "{@Logo} {@NotAllowedSize}"
- else:
- if arg-3 is not set:
- send "{@Logo} {@NoTime}"
- send "{@Logo} &a/tempmute &e%arg-1% %arg-2% &c<parameter> <reason>"
- else:
- if arg-3 is not "second", "seconds", "minute", "minutes", "hour", "hours", "day" or "days":
- send "{@Logo} {@NoTime}"
- send "{@Logo} &a/tempmute &e%arg-1% %arg-2% &c<parameter> <reason>"
- else:
- if arg-4 is not set:
- send "{@Logo} {@NoReason}"
- send "{@Logo} &a/tempmute &e%arg-1% %arg-2% %arg-3% &c<reason>"
- else:
- if sender is player:
- set {_String.From} to "%player%"
- else:
- set {_String.From} to "{@ConsoleName}"
- $ thread
- set {_uuid} to getUUID("%arg-1%")
- $ thread
- MutePlayer("%{_uuid}%", "%arg-2% %arg-3%", arg-4, {_String.From})
- $ thread
- AddHistoryLog("%{_uuid}%", "&e[%now%] %arg-1% has been tempmuted by %{_String.From}% due to ""%arg-4%"" for %arg-2% %arg-3%.")
- broadcast "{@Logo} &a%arg-1%&7 has been tempmuted by &a%{_String.From}%&7 due to &c%arg-4%&7 for &a%arg-2% %arg-3%"
- command /kick [<player>] [<text>]:
- aliases: kick
- trigger:
- if player does not have permission "punishments.kick":
- send "{@Logo} {@NoPermission}"
- else:
- if arg-1 is not set:
- send "{@Logo} {@NoName}"
- send "{@Logo} &a/kick &c<player> <reason>"
- else:
- if arg-player is player:
- send "{@Logo} {@NoSelfKick}"
- else:
- if arg-2 is not set:
- send "{@Logo} {@NoReason}"
- send "{@Logo} &a/kick &e%arg-1% &c<reason>"
- else:
- if sender is player:
- kick arg-player due to "{@KickHeader}%nl%&f%nl%{@Kick_Line1}%nl%{@Kick_Reason}"
- $ thread
- set {_uuid} to getUUID("%arg-1%")
- $ thread
- AddHistoryLog("%{_uuid}%", "&b[%now%] %arg-player% has been kicked by %player% due to ""%arg-2%"".")
- broadcast "{@Logo} &a%arg-1%&7 was kicked by &a%player%&7 due to &c%arg-2%"
- else:
- kick arg-player due to "{@KickHeader}%nl%&f%nl%{@Kick_Line2}%nl%{@Kick_Reason}"
- $ thread
- set {_uuid} to getUUID("%arg-1%")
- $ thread
- AddHistoryLog("%{_uuid}%", "&b[%now%] %arg-player% has been kicked by {@ConsoleName} due to ""%arg-2%"".")
- broadcast "{@Logo} &a%arg-1%&7 was kicked by &a{@ConsoleName}&7 due to &c%arg-2%"
- command /ban [<text>] [<text>]:
- aliases: ban
- trigger:
- if player does not have permission "punishments.ban":
- send "{@Logo} {@NoPermission}"
- else:
- if arg-1 is not set:
- send "{@Logo} {@NoName}"
- send "{@Logo} &a/ban &c<player> <reason>"
- else:
- if arg-1 is player:
- send "{@Logo} {@NoSelfBan}"
- else:
- $ thread
- set {_getIP} to WasPlayerAlreadyOnline("%arg-1%")
- if {_getIP} is "false":
- send "{@Logo} {@PlayerNotFound}"
- else:
- $ thread
- set {_uuid} to getUUID("%arg-1%")
- $ thread
- set {_getResult} to getBannedPlayer("%{_uuid}%", "Player")
- if {_getResult} is "true":
- send "{@Logo} {@AlreadyBanned}"
- else:
- if arg-2 is not set:
- send "{@Logo} {@NoReason}"
- send "{@Logo} &a/ban &e%arg-1% &c<reason>"
- else:
- if sender is player:
- set {_String.From} to "%player%"
- else:
- set {_String.From} to "{@ConsoleName}"
- BanPlayer("%{_uuid}%", "permanently", arg-2, {_String.From})
- $ thread
- AddHistoryLog("%{_uuid}%", "&c[%now%] %arg-1% has been banned by %{_String.From}% due to ""%arg-2%"".")
- broadcast "{@Logo} &a%arg-1%&7 has been banned permanently by &a%{_String.From}%&7 due to&c %arg-2%"
- command /tempban [<text>] [<integer>] [<text>] [<text>]:
- aliases: tempban
- trigger:
- if player does not have permission "punishments.tempban":
- send "{@Logo} {@NoPermission}"
- else:
- if arg-1 is not set:
- send "{@Logo} {@NoName}"
- send "{@Logo} &a/tempban &c<player> <integer> <parameter> <reason>"
- else:
- if arg-1 is player:
- send "{@Logo} {@NoSelfBan}"
- else:
- $ thread
- set {_getIP} to WasPlayerAlreadyOnline("%arg-1%")
- if {_getIP} is "false":
- send "{@Logo} {@PlayerNotFound}"
- else:
- $ thread
- set {_uuid} to getUUID("%arg-1%")
- $ thread
- set {_getResult} to getBannedPlayer("%{_uuid}%", "Player")
- if {_getResult} is "true":
- send "{@Logo} {@AlreadyBanned}"
- else:
- if arg-2 is not set:
- send "{@Logo} {@NoInteger}"
- send "{@Logo} &a/tempban &e%arg-1% &c<integer> <parameter> <reason>"
- else:
- if arg-2 is bigger than 12000:
- send "{@Logo} {@NotAllowedSize}"
- else:
- if arg-2 is smaller than 1:
- send "{@Logo} {@NotAllowedSize}"
- else:
- if arg-3 is not set:
- send "{@Logo} {@NoTime}"
- send "{@Logo} &a/tempban &e%arg-1% %arg-2% &c<parameter> <reason>"
- else:
- if arg-3 is not "second", "seconds", "minute", "minutes", "hour", "hours", "day" or "days":
- send "{@Logo} {@NoTime}"
- send "{@Logo} &a/tempban &e%arg-1% %arg-2% &c<parameter> <reason>"
- else:
- if arg-4 is not set:
- send "{@Logo} {@NoReason}"
- send "{@Logo} &a/tempban &e%arg-1% %arg-2% %arg-3% &c<reason>"
- else:
- if sender is player:
- set {_String.From} to "%player%"
- else:
- set {_String.From} to "{@ConsoleName}"
- $ thread
- set {_uuid} to getUUID("%arg-1%")
- $ thread
- BanPlayer("%{_uuid}%", "%arg-2% %arg-3%", "%arg-4%", {_String.From})
- $ thread
- AddHistoryLog("%{_uuid}%", "&c[%now%] %arg-1% has been tempbanned by %{_String.From}% due to ""%arg-4%"" for %arg-2% %arg-3%.")
- broadcast "{@Logo} &a%arg-1%&7 has been tempbanned by &a%{_String.From}%&7 due to&c %arg-4%&7 for &a%arg-2% %arg-3%"
- command /pardon [<text>]:
- aliases: unban, pardon
- trigger:
- if player does not have permission "punishments.unban":
- send "{@Logo} {@NoPermission}"
- else:
- if arg-1 is not set:
- send "{@Logo} {@NoName}"
- send "{@Logo} &a/unban &c<player>"
- else:
- set {_getIP} to WasPlayerAlreadyOnline("%arg-1%")
- if {_getIP} is "false":
- send "{@Logo} {@PlayerNotFound}"
- else:
- set {_accounts} to getAccounts("%arg-1%")
- replace all " and " with ", " in {_accounts}
- set {_accounts::*} to {_accounts} split at ", "
- loop {_accounts::*}:
- set {_uuid} to getUUID("%loop-value%")
- set {_ban} to getBannedPlayer("%{_uuid}%", "Player")
- {_ban} is "true"
- set {_ban::%loop-value%} to {_uuid}
- if {_ban::*} is not set:
- send "{@Logo} {@PlayerNotBanned}"
- else:
- if sender is player:
- set {_String.From} to "%player%"
- else:
- set {_String.From} to "{@ConsoleName}"
- loop {_ban::*}:
- $ thread
- RemoveBannedPlayer("%loop-value%")
- $ thread
- AddHistoryLog("%loop-value%", "&c[%now%] %loop-index% has been unbanned by %{_String.From}%.")
- broadcast "{@Logo} &a%arg-1%&7&o (and all accounts under their ip)&7 were unbanned by &7%{_String.From}%"
- command /unmute [<text>]:
- aliases: unmute
- trigger:
- if player does not have permission "punishments.unmute":
- send "{@Logo} {@NoPermission}"
- else:
- if arg-1 is not set:
- send "{@Logo} {@NoName}"
- send "{@Logo} &a/unmute &c<player>"
- else:
- $ thread
- set {_getIP} to WasPlayerAlreadyOnline("%arg-1%")
- if {_getIP} is "false":
- send "{@Logo} {@PlayerNotFound}"
- else:
- $ thread
- set {_uuid} to getUUID("%arg-1%")
- $ thread
- set {_getResult} to getMutedPlayer("%{_uuid}%", "Player")
- if {_getResult} is "false":
- send "{@Logo} {@PlayerNotMuted}"
- else:
- if sender is player:
- set {_String.From} to "%player%"
- else:
- set {_String.From} to "{@ConsoleName}"
- $ thread
- set {_uuid} to getUUID("%arg-1%")
- $ thread
- RemoveMutedPlayer("%{_uuid}%")
- $ thread
- AddHistoryLog("%{_uuid}%", "&e[%now%] %arg-1% has been unmuted by %{_String.From}%.")
- broadcast "{@Logo} &a%arg-1%&7 was unmuted by &a%{_String.From}%"
- on chat:
- set {_getResult} to getMutedPlayer("%player's uuid%", "Player")
- if {_getResult} is "true":
- set {_CheckMuteState} to CheckMutedPlayer("%player%")
- if {_CheckMuteState} is "true":
- set {nochat::%player%} to true
- else:
- #{dead::%player%} is true
- #set {nochat::%player%} to true
- #loop all players:
- # if {spec::%loop-player%} is true:
- # send "&5[Dead] &8%player%&7:&3 %message%" to loop-player
- # else if {dead::%loop-player%} is true:
- # send "&5[Dead] &8%player%&7:&3 %message%" to loop-player
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement