Hi, I'm having troubles with my punishment skript (SuperBans).
Every time a player is banned/tempbanned, he's added to {bans::*} and removed when unbanned. But on every server stop all the values of the variable {bans::*} are losed and rewrited with "null". I don't know what's wrong.
I'm using Skript 2.2 bensku's edit dev-27
Addons:
Every time a player is banned/tempbanned, he's added to {bans::*} and removed when unbanned. But on every server stop all the values of the variable {bans::*} are losed and rewrited with "null". I don't know what's wrong.
I'm using Skript 2.2 bensku's edit dev-27
Addons:
- SkQuerry3
- Skellett
code_language.skript:
# =========================================================================================================================
#
# .--.--. ,---,.
# / / '. ,-.----. ,' .' \
# | : /`. / ,--, \ / \ __ ,-.,---.' .' | ,---,
# ; | |--` ,'_ /| | : | ,' ,'/ /|| | |: | ,-+-. / | .--.--.
# | : ;_ .--. | | : | | .\ : ,---. ' | |' |: : : / ,--.--. ,--.'|' |/ / '
# \ \ `. ,'_ /| : . | . : |: | / \ | | ,': | ; / \ | | ,"' | : /`./
# `----. \| ' | | . . | | \ : / / |' : / | : \.--. .-. | | | / | | : ;_
# __ \ \ || | ' | | | | : . |. ' / || | ' | | . | \__\/: . . | | | | |\ \ `.
# / /`--' /: | : ; ; | : |`-'' ; /|; : | ' : '; | ," .--.; | | | | |/ `----. \
# '--'. / ' : `--' \: : : ' | / || , ; | | | ; / / ,. | | | |--' / /`--' /
# `--'---' : , .-./| | : | : | ---' | : / ; : .' \| |/ '--'. /
# `--`----' `---'.| \ \ / | | ,' | , .-./'---' `--'---'
# `---` `----' `----' `--`---'
# Spigot: https://goo.gl/iojiPc | SkUnity: https://goo.gl/S6Hu85 Created by KroterPvP
#
# =========================================================================================================================
#=========================================================================#
# MESSAGES, OPTIONS & CONFIGURATION #
#=========================================================================#
options:
file name: SuperBans
check to unban tempbanned players: 1
max warns: 4
keep unban gui open: true
prefix: &c&lSuperBans &8» &7
dissallowed muted cmds: "msg" or "tell" or "helpop"
unknown cmd message: Unknown command. Type ""/help"" for help.
default ban reason: Default ban reason. Change it in the config
default tempban reason: Default tempban reason. Change it in the config
default mute reason: Default mute reason. Change it in the config
default kick reason: Default kick reason. Change it in the config
default kickall reason: Default kickall reason. Change it in the config
# BAN - Variables: %nl%, %{sban.bannedby.%{_p}%}%, %{sban.bannedon.%{_p}%}%, %{sban.banexpire.%{_p}%}%, %{sban.banip.%{_p}%}%, %{sban.banreason.%{_p}%}%
ban screen message: &7Sadly, you were &cBanned &7from &6ServerName&7. Apply on our forums if you want to dispute your ban!%nl%%nl%&7Banned by: &a%{sban.bannedby.%{_p}%}%%nl%%nl%&7Banned on: &c%{sban.bannedon.%{_p}%}%%nl%&7Autounban: &c%{sban.banexpire.%{_p}%}%%nl%&7IP Banned: &c%{sban.banip.%{_p}%}%%nl%&7Reason: &c%{sban.banreason.%{_p}%}%%nl%%nl%&eBuy an unban &8» &cwww.yourserver.buycraft.net%nl%&eForums to apply &8» &cwww.yourserver.net
# TEMPBAN - Variables: %nl%, %{sban.bannedby.%{_p}%}%, %{sban.bannedon.%{_p}%}%, %{sban.banexpire.%{_p}%}%, %{sban.banip.%{_p}%}%, %{sban.banreason.%{_p}%}%, %{sban.tempbanlenght.%{_p}%}%
tempban screen message: &7Sadly, you were &cTempBanned &7from &6ServerName&7. Apply on our forums if you want to dispute your ban!%nl%%nl%&7Banned by: &a%{sban.bannedby.%{_p}%}%%nl%&7Banned on: &c%{sban.bannedon.%{_p}%}%%nl%&7Autounban: &c%{sban.banexpire.%{_p}%}% &7(&c%{sban.tempbanlenght.%{_p}%}%&7)%nl%&7IP Banned: &c%{sban.banip.%{_p}%}%%nl%&7Reason: &c%{sban.banreason.%{_p}%}%%nl%%nl%&eBuy an unban &8» &cwww.yourserver.buycraft.net%nl%&eForums to apply &8» &cwww.yourserver.net
# KICK - Variables: %nl%, %{sban.kickedby.%{_p}%}%, %{sban.kickreason.%{_p}%}%
kick message: &7Sadly, you were &cKicked &7from &6ServerName&7. Apply on our forums if you want to dispute your kick!%nl%%nl%&7Kicked by: &a%{sban.kickedby.%{_p}%}%%nl%&7Reason: &c%{sban.kickreason.%{_p}%}%%nl%%nl%&eVisit our shop &8» &cwww.yourserver.buycraft.net%nl%&eForums to apply &8» &cwww.yourserver.net
# KICKALL - Variables: %nl%, %{sban.kickedby.%loop-player%}%, %{sban.kickreason.%loop-player%}%
kickall message: &7Sadly, you were &cKicked &7from &6ServerName&7. Apply on our forums if you want to dispute your kick!%nl%%nl%&7Kicked by: &a%{sban.kickedby.%loop-player%}%%nl%&7Reason: &c%{sban.kickreason.%loop-player%}%%nl%%nl%&eVisit our shop &8» &cwww.yourserver.buycraft.net%nl%&eForums to apply &8» &cwww.yourserver.net
# WARN - Variables: %nl%, %{sban.warns.%{_p}%} - 1%, %{sban.warnedby.%{_p}%}%
max warns message: &7Sadly, you were &cWarned &a%{sban.warns.%{_p}%} - 1% &7times.%nl%%nl%&7Warned by: &a%{sban.warnedby.%{_p}%}%%nl%%nl%&eVisit our store &8» &cwww.yourserver.buycraft.net%nl%&eForums to apply &8» &cwww.yourserver.net
#=========================================================================#
# SUPERBAN CODE | EDIT IT ONLY IF YOU KNOW WHAT YOU'RE DOING! #
#=========================================================================#
#=====================#
# SUPERBANS - HELP #
#=====================#
command /superbans:
permission: sb.help
permission message: {@prefix}&cYou don't have permission to do this!
executable by: console and player
aliases: /sbans, /superb, /sb
trigger:
send " &8&m-------------------------------"
send " &c&lSuperBans &8» &7Created by &aKroterPvP"
send ""
send " &8- &c/ban <player> <reason>"
send " &8- &c/tempban <player> <reason> <timespan>"
send " &8- &c/unban <player>"
send " &8- &c/bans <page>"
send " &8- &c/mute <player>"
send " &8- &c/unmute <player>"
send " &8- &c/warn <player>"
send " &8- &c/kick <player> <reason>"
send " &8- &c/kickall <reason>"
send " &8- &c/check <player>"
sender is console:
send ""
send " &8- &c/sbreload"
send " &8&m-------------------------------"
else:
send " &8- &c/notify <true/false>"
send ""
send " &8- &c/sbreload"
send " &8&m-------------------------------"
#=====================#
# RELOAD CMD #
#=====================#
command /superbansreload:
permission: sb.reload
permission message: {@prefix}&cYou don't have permission to do this!
executable by: console and player
aliases: /sbreload
trigger:
make console execute command "/sk reload {@file name}.sk"
send "{@prefix}&7Reload completed. &o(Check console for errors)" to player
#=====================#
# NOTIFY #
#=====================#
command /notify [<text>]:
permission: sb.notify
permission message: {@prefix}&cYou don't have permission to do this!
executable by: console and player
trigger:
sender is console:
send "{@prefix}&7This command is only available for players"
else:
if {notify.%player%} is not set:
set {notify.%player%} to true
else:
if arg 1 is "true":
if {notify.%player%} is false:
set {notify.%player%} to true
send "{@prefix}&7You will receive punish notifications"
else:
send "{@prefix}&7Punish notifications are already enabled"
if arg 1 is "false":
if {notify.%player%} is true:
set {notify.%player%} to false
send "{@prefix}&7You won't receive punish notifications"
else:
send "{@prefix}&7Punish notifications are already disabled"
if arg 1 is not "true" or "false":
send "{@prefix}&7You must use &c/notify <true/false>"
if arg 1 is not set:
send "{@prefix}&7You must use &c/notify <true/false>"
#=====================#
# BAN #
#=====================#
command /ban [<offlineplayer>] [<text={@default ban reason}>]:
permission: sb.ban
permission message: {@prefix}&cYou don't have permission to do this!
executable by: console and player
trigger:
if arg 1 is set:
if arg 2 is set:
if {sban.banned.%arg 1%} is true:
send "{@prefix}&7This player is already banned"
else:
if arg 1 has permission "sb.ban.exempt":
send "{@prefix}&7This player can't be banned"
else:
set {sban.banned.%arg 1%} to true
set {sban.bannedon.%arg 1%} to now
set {sban.banreason.%arg 1%} to arg 2
set {sban.banexpire.%arg 1%} to "Never"
set {sban.bannedby.%arg 1%} to "%sender%"
set {sban.banip.%arg 1%} to false
add arg 1 to {bans::*}
set {_p} to arg 1
kick arg 1 due to "{@ban screen message}"
loop all players:
if loop-player has permission "sb.ban.notify":
if {notify.%loop-player%} is true:
send "{@prefix}&7I have handled a &a&lNEW BAN&r&7!" to loop-player
send "" to loop-player
send " &7Player banned &8» &e%arg 1%" to loop-player
send " &7Banned by &8» &a%sender%" to loop-player
send " &7Ban reason &8» &7'&a%arg 2%&7'" to loop-player
send " &7Autounban &8» &aNever" to loop-player
send "{@prefix}&a%sender% &7banned &e%arg 1% &7('&a%arg 2%&7') &7- (&aNever&7)" to console
else:
send "{@prefix}&7You must use &c/ban <player> <reason>"
else:
send "{@prefix}&7You must use &c/ban <player> <reason>"
#=====================#
# TEMPBAN #
#=====================#
# The timespan needs to be writed using this format: X second(s), X minute(s), X hour(s), X day(s)
# If you put: "60 seconds, 1 minute" in the 3th argument, it will automaticly change to 2 minutes.
# Example: /tempban PlayerName Do not break the rules! 30 minutes, 5 hours, 8 days
command /tempban [<offlineplayer>] [<text={@default tempban reason}>] [<timespan>]:
permission: sb.tempban
permission message: {@prefix}&cYou don't have permission to do this!
executable by: console and player
trigger:
if arg 1 is set:
if arg 2 is set:
if arg 3 is set:
if {sban.banned.%arg 1%} is true:
send "{@prefix}&7This player is already tempbanned"
else:
if arg 1 has permission "sb.tempban.exempt":
send "{@prefix}&7This player can't be tempbanned"
else:
set {_now} to now
set {_timespan} to arg 3
add {_timespan} to {_now}
set {_remaining} to {_now}
set {sban.banned.%arg 1%} to true
set {sban.bannedon.%arg 1%} to now
set {sban.banreason.%arg 1%} to arg 2
set {sban.banexpire.%arg 1%} to {_remaining}
set {sban.tempbanlenght.%arg 1%} to arg 3
set {sban.bannedby.%arg 1%} to "%sender%"
set {sban.banip.%arg 1%} to false
add arg 1 to {bans::*}
set {_p} to arg 1
kick arg 1 due to "{@tempban screen message}"
loop all players:
if loop-player has permission "sb.tempban.notify":
if {notify.%loop-player%} is true:
send "{@prefix}&7I have handled a &a&lNEW BAN&r&7!" to loop-player
send "" to loop-player
send " &7Player banned &8» &e%arg 1%" to loop-player
send " &7Banned by &8» &a%sender%" to loop-player
send " &7Ban reason &8» &7'&a%arg 2%&7'" to loop-player
send " &7Autounban &8» &a%{_remaining}% &7(&a%arg 3%&7)" to loop-player
send "{@prefix}&a%sender% &7tempbanned &e%arg 1% &7('&a%arg 2%&7') &7- (&a%arg 3%&7)" to console
else:
send "{@prefix}&7You must use &c/tempban <player> <reason> <timespan>"
else:
send "{@prefix}&7You must use &c/tempban <player> <reason> <timespan>"
else:
send "{@prefix}&7You must use &c/tempban <player> <reason> <timespan>"
every {@check to unban tempbanned players} seconds:
execute console command "/updatetempbantimes"
command /updatetempbantimes:
permission: sban.updatetempbantimes
permission message: {@prefix}&cYou don't have permission to do this!
executable by: console and player
trigger:
loop {bans::*}:
if {sban.banned.%loop-value%} is true:
if {sban.banexpire.%loop-value%} is not "Never":
set {_elapsedtime} to difference between now and {sban.banexpire.%loop-value%}
if {_elapsedtime} is greater than {sban.tempbanlenght.%loop-value%}:
execute console command "/unban %loop-value% -s"
#=====================#
# UNBAN #
#=====================#
command /unban [<offlineplayer>] [<text>]:
permission: sb.unban
permission message: {@prefix}&cYou don't have permission to do this!
executable by: console and player
trigger:
if arg 1 is set:
if arg 2 is set:
if arg 2 is "-s":
if {sban.banned.%arg 1%} is true:
set {sban.banned.%arg 1%} to false
set {sban.bannedon.%arg 1%} to "-"
set {sban.banreason.%arg 1%} to "-"
set {sban.banexpire.%arg 1%} to "-"
set {sban.bannedby.%arg 1%} to "-"
set {sban.banip.%arg 1%} to false
remove arg 1 from {bans::*}
else:
send "{@prefix}&7This player is not banned"
else:
if {sban.banned.%arg 1%} is true:
set {sban.banned.%arg 1%} to false
set {sban.bannedon.%arg 1%} to "-"
set {sban.banreason.%arg 1%} to "-"
set {sban.banexpire.%arg 1%} to "-"
set {sban.bannedby.%arg 1%} to "-"
set {sban.banip.%arg 1%} to false
remove arg 1 from {bans::*}
loop all players:
if loop-player has permission "sb.unban.notify":
if {notify.%loop-player%} is true:
send "{@prefix}&7I have handled an &a&lUNBAN&r&7!" to loop-player
send "" to loop-player
send " &7Player unbanned &8» &e%arg 1%" to loop-player
send " &7Unbanned by &8» &a%sender%" to loop-player
send "{@prefix}&a%sender% &7unbanned &e%arg 1%" to console
else:
send "{@prefix}&7This player is not banned"
else:
send "{@prefix}&7You must use &c/unban <player>"
on tab completer for "/unban":
loop {bans::*}:
add "%loop-value%" to completions
#=====================#
# MUTE #
#=====================#
command /mute [<offlineplayer>] [<text={@default mute reason}>]:
permission: sb.mute
permission message: {@prefix}&cYou don't have permission to do this!
executable by: console and player
trigger:
if arg 1 is set:
if arg 1 is online:
if arg 2 is set:
if {sban.muted.%arg 1%} is true:
send "{@prefix}&7This player is already muted"
else:
if arg 1 has permission "sb.mute.exempt":
send "{@prefix}&7This player can't be muted"
else:
add arg 1 to {mutes::*}
set {sban.muted.%arg 1%} to true
set {sban.mutedon.%arg 1%} to now
set {sban.mutereason.%arg 1%} to arg 2
set {sban.muteexpire.%arg 1%} to "Never"
set {sban.mutedby.%arg 1%} to "%sender%"
loop all players:
if loop-player has permission "sb.mute.notify":
if {notify.%loop-player%} is true:
send "{@prefix}&7I have handled a &a&lNEW MUTE&r&7!" to loop-player
send "" to loop-player
send " &7Player muted &8» &e%arg 1%" to loop-player
send " &7Muted by &8» &a%sender%" to loop-player
send " &7Mute reason &8» &7'&a%arg 2%&7'" to loop-player
send " &7Autounmute &8» &aNever" to loop-player
send "{@prefix}&7You are now &a&lMUTED&r&7!" to arg 1
send "" to arg 1
send " &7Muted by &8» &a%sender%" to arg 1
send " &7Mute reason &8» &7'&a%arg 2%&7'" to arg 1
send " &7Autounmute &8» &aNever" to arg 1
send "{@prefix}&a%sender% &7muted &e%arg 1% &7('&a%arg 2%&7') &7- (&aNever&7)" to console
else:
send "{@prefix}&7You must use &c/mute <player> <reason>"
else:
send "{@prefix}&7This player is not online"
else:
send "{@prefix}&7You must use &c/mute <player> <reason>"
#=====================#
# UNMUTE #
#=====================#
command /unmute [<offlineplayer>]:
permission: sb.unmute
permission message: {@prefix}&cYou don't have permission to do this!
executable by: console and player
trigger:
if arg 1 is set:
if {sban.muted.%arg 1%} is true:
remove arg 1 from {mutes::*}
set {sban.muted.%arg 1%} to false
set {sban.mutedon.%arg 1%} to "-"
set {sban.mutereason.%arg 1%} to "-"
set {sban.muteexpire.%arg 1%} to "-"
set {sban.mutedby.%arg 1%} to "-"
delete {muteexpire.%arg 1%}
loop all players:
if loop-player has permission "sb.unmute.notify":
if {notify.%loop-player%} is true:
send "{@prefix}&7I have handled an &a&lUNMUTE&r&7!" to loop-player
send "" to loop-player
send " &7Player unmuted &8» &e%arg 1%" to loop-player
send " &7Unmuted by &8» &a%sender%" to loop-player
send "{@prefix}&7You are now &a&lUNMUTED&r&7!" to arg 1
send "" to arg 1
send " &7Unmuted by &8» &a%sender%" to arg 1
send "{@prefix}&a%sender% &7unmuted &e%arg 1%" to console
else:
send "{@prefix}&7This player is not muted"
else:
send "{@prefix}&7You must use &c/unmute <player>"
on tab completer for "/unmute":
loop {mutes::*}:
add "%loop-value%" to completions
#=====================#
# KICK #
#=====================#
command /kick [<player>] [<text={@default kick reason}>]:
permission: sb.kick
permission message: {@prefix}&cYou don't have permission to do this!
executable by: console and player
trigger:
if arg 1 is set:
if arg 1 is online:
if arg 2 is set:
if arg 1 has permission "sb.kick.exempt":
send "{@prefix}&7This player can't be kicked"
else:
set {sban.kicked.%arg 1%} to true
set {sban.kickreason.%arg 1%} to arg 2
set {sban.kickedby.%arg 1%} to "%sender%"
set {_p} to arg 1
kick arg 1 due to "{@kick message}"
loop all players:
if loop-player has permission "sb.kick.notify":
if {notify.%loop-player%} is true:
send "{@prefix}&7I have handled a &a&lNEW KICK&r&7!" to loop-player
send "" to loop-player
send " &7Player kicked &8» &e%arg 1%" to loop-player
send " &7Kicked by &8» &a%sender%" to loop-player
send " &7Kick reason &8» &7'&a%arg 2%&7'" to loop-player
send "{@prefix}&a%sender% &7kicked &e%arg 1% &7('&a%arg 2%&7')" to console
else:
send "{@prefix}&7You must use &c/kick <player> <reason>"
else:
send "{@prefix}&7This player is not online"
else:
send "{@prefix}&7You must use &c/kick <player> <reason>"
#=====================#
# KICKALL #
#=====================#
command /kickall [<text={@default kickall reason}>]:
permission: sb.kickall
permission message: {@prefix}&cYou don't have permission to do this!
executable by: console and player
trigger:
if arg 1 is set:
loop all players:
if loop-player has permission "sb.kickall.exempt":
if loop-player has permission "sb.kickall.notify":
if {notify.%loop-player%} is true:
send "{@prefix}&7I have handled a &a&lNEW KICKALL&r&7!" to loop-player
send "" to loop-player
send " &7Players kicked &8» &eAll without permission" to loop-player
send " &7Kicked by &8» &a%sender%" to loop-player
send " &7Kick reason &8» &7'&a%arg 1%&7'" to loop-player
else:
set {sban.kickedby.%loop-player%} to "%sender%"
set {sban.kickreason.%loop-player%} to arg 1
set {sban.kickall} to loop-player
set {sban.kicked.%loop-value%} to true
set {_p} to loop-player
kick {sban.kickall} due to "{@kickall message}"
delete {sban.kickall}
send "{@prefix}&a%sender% &7kicked all players without permission &7('&a%arg 1%&7')" to console
else:
send "{@prefix}&7You must use &c/kickall <reason>"
#=====================#
# WARN #
#=====================#
command /warn [<offlineplayer>]:
permission: sb.warn
permission message: {@prefix}&cYou don't have permission to do this!
executable by: console and player
trigger:
if arg 1 is set:
if arg 1 is online:
if arg 1 has permission "sb.warn.exempt":
send "{@prefix}&7This player can't be warned"
else:
if {sban.warns.%arg 1%} = {@max warns}:
set {sban.warnedby.%arg 1%} to "%sender%"
add 1 to {sban.warns.%arg 1%}
set {sban.kicked.%arg 1%} to true
set {_p} to arg 1
kick arg 1 due to "{@max warns message}"
loop all players:
if loop-player has permission "sb.maxwarn.notify":
if {notify.%loop-player%} is true:
send "{@prefix}&7I have handled a &a&lNEW WARN&r&7!" to loop-player
send "" to loop-player
send " &7Player warned &8» &e%arg 1%" to loop-player
send " &7Warned by &8» &a%sender%" to loop-player
send " &7This player had &8» &a%{sban.warns.%arg 1%} - 1%&7/&a{@max warns} &7warns" to loop-player
send " &7This player has been kicked for reaching &a{@max warns} &7warns" to loop-player
send "{@prefix}&a%sender% &7warned &e%arg 1% &7(&a%{sban.warns.%arg 1%} - 1%&7/&a{@max warns} &7warns) - (&aKicked&7)" to console
set {sban.warns.%arg 1%} to 1
set {sban.warnedby.%arg 1%} to "-"
else:
if {sban.warns.%arg 1%} is not set:
set {sban.warns.%arg 1%} to 1
set {sban.warnedby.%arg 1%} to "%player%"
loop all players:
if loop-player has permission "sb.warn.notify":
if {notify.%loop-player%} is true:
send "{@prefix}&7I have handled a &a&lNEW WARN&r&7!" to loop-player
send "" to loop-player
send " &7Player warned &8» &e%arg 1%" to loop-player
send " &7Warned by &8» &a%sender%" to loop-player
send " &7This player has &8» &a%{sban.warns.%arg 1%} - 1%&7/&a{@max warns} &7warns" to loop-player
send "{@prefix}&7You have been &a&lWARNED&r&7!" to arg 1
send "" to arg 1
send " &7Warned by &8» &a%sender%" to arg 1
send " &7You have &8» &a%{sban.warns.%arg 1%} - 1%&7/&a{@max warns} &7warns" to arg 1
send "{@prefix}&a%sender% &7warned &e%arg 1% &7(&a%{sban.warns.%arg 1%} - 1%&7/&a{@max warns} &7warns)" to console
else:
set {sban.warns.%arg 1%} to {sban.warns.%arg 1%} + 1
set {sban.warnedby.%arg 1%} to "%player%"
loop all players:
if loop-player has permission "sb.warn.notify":
if {notify.%loop-player%} is true:
send "{@prefix}&7I have handled a &a&lNEW WARN&r&7!" to loop-player
send "" to loop-player
send " &7Player warned &8» &e%arg 1%" to loop-player
send " &7Warned by &8» &a%sender%" to loop-player
send " &7This player has &8» &a%{sban.warns.%arg 1%} - 1%&7/&a{@max warns} &7warns" to loop-player
send "{@prefix}&7You have been &a&lWARNED&r&7!" to arg 1
send "" to arg 1
send " &7Warned by &8» &a%sender%" to arg 1
send " &7You have &8» &a%{sban.warns.%arg 1%} - 1%&7/&a{@max warns} &7warns" to arg 1
send "{@prefix}&a%sender% &7warned &e%arg 1% &7(&a%{sban.warns.%arg 1%} - 1%&7/&a{@max warns} &7warns)" to console
else:
send "{@prefix}&7This player is not online"
else:
send "{@prefix}&7You must use &c/warn <player>"
#=====================#
# CHECK #
#=====================#
command /check [<offlineplayer>]:
permission: sb.check
permission message: {@prefix}&cYou don't have permission to do this!
executable by: console and player
trigger:
if arg 1 is set:
if {sban.firstjoin.%arg 1%} is not set:
set {sban.firstjoin.%arg 1%} to "no"
send "{@prefix}&7This player has not joined"
stop
if {sban.firstjoin.%arg 1%} is "no":
send "{@prefix}&7This player has not joined"
stop
else:
send " &8&m-------------------------------"
send " {@prefix}&7Checking &a%arg 1%"
send ""
send " &7Has joined &8» &c%{sban.firstjoin.%arg 1%}%"
send " &7Banned &8» &c%{sban.banned.%arg 1%}%"
send " &7IP Banned &8» &c%{sban.banip.%arg 1%}%"
send " &7Banned by &8» &c%{sban.bannedby.%arg 1%}%"
send " &7Ban reason &8» &c%{sban.banreason.%arg 1%}%"
send " &7Banned on &8» &c%{sban.bannedon.%arg 1%}%"
send " &7Autounban &8» &c%{sban.banexpire.%arg 1%}%"
send " &7Muted &8» &c%{sban.muted.%arg 1%}%"
send " &7Muted by &8» &c%{sban.mutedby.%arg 1%}%"
send " &7Mute reason &8» &c%{sban.mutereason.%arg 1%}%"
send " &7Muted on &8» &c%{sban.mutedon.%arg 1%}%"
send " &7Autounmute &8» &c%{sban.muteexpire.%arg 1%}%"
send " &7Warns &8» &c%{sban.warns.%arg 1%} - 1%&7/&c{@max warns}"
if sender is player:
send " &7UUID &8» &c%UUID of player%"
send " &7IP &8» &c%IP address of player%"
send " &8&m-------------------------------"
else:
send " &8&m-------------------------------"
stop
else:
send "{@prefix}&7You must use &c/check <player>"
#=====================#
# BANS #
#=====================#
command /bans [<integer=1>]:
permission: sb.bans
permission message: {@prefix}&cYou don't have permission to do this!
executable by: console and player
trigger:
sender is console:
send "{@prefix}&7This command is only available for players"
else:
set {sizeofbans::*} to size of {bans::*}
set {_page::max} to arg 1 * 45
set {_page::min} to (arg 1 - 1) * 45
set {_page::posts} to 0
set {_page::count} to 0
set {_page::number} to arg 1
set {_pages} to size of {bans::*} / 45
set {_pages} to "%{_pages}%"
set {_pages::*} to {_pages} split at "."
set {_page::total} to {_pages::1}
if {_pages::2} is set:
set {_page::total} to {_page::total} parsed as an integer
add 1 to {_page::total}
if inventory name of player's current inventory does not contain "&0List of banned players":
open chest with 6 rows named "&0List of banned players %{_page::number}%/%{_page::total}%" to player
else:
loop 54 times:
set slot (loop-number - 1) of player's current inventory to air
set inventory name of player's current inventory to "&0List of banned players %{_page::number}%/%{_page::total}%"
if {_page::number} is less than 2:
set slot 45 of player's current inventory to black stained glass pane named "&7" with all removed NBT
set slot 46 of player's current inventory to black stained glass pane named "&7" with all removed NBT
set slot 47 of player's current inventory to black stained glass pane named "&7" with all removed NBT
set slot 48 of player's current inventory to book and quill named "&eBasic information" with lore "||&7Banned users &8» &c%{sizeofbans::*}%||||&7Page &8» &c%{_page::number}%&7/&c%{_page::total}%" with all removed NBT
set slot 49 of player's current inventory to stone button named "&eRefresh GUI" with lore "||&7Click here to refresh the gui without||&7loosing the page you are viewing" with all removed NBT
set slot 50 of player's current inventory to name tag named "&eSearch players" with lore "||&7Click here to &csearch &7banned players.||&7Type player's name in chat to proceed" with all removed NBT
set slot 51 of player's current inventory to black stained glass pane named "&7" with all removed NBT
set slot 52 of player's current inventory to barrier named "&eClose GUI" with all removed NBT
set slot 53 of player's current inventory to black stained glass pane named "&7" with all removed NBT
else:
set slot 45 of player's current inventory to arrow named "&ePrevious Page" with all removed NBT
set slot 46 of player's current inventory to book named "&eMain Page" with all removed NBT
set slot 47 of player's current inventory to black stained glass pane named "&7" with all removed NBT
set slot 48 of player's current inventory to book and quill named "&eBasic information" with lore "||&7Banned users &8» &c%{sizeofbans::*}%||||&7Page &8» &c%{_page::number}%&7/&c%{_page::total}%" with all removed NBT
set slot 49 of player's current inventory to stone button named "&eRefresh GUI" with lore "||&7Click here to refresh the gui without||&7loosing the page you are viewing" with all removed NBT
set slot 50 of player's current inventory to name tag named "&eSearch players" with lore "||&7Click here to &csearch &7banned players.||&7Type player's name in chat to proceed" with all removed NBT
set slot 51 of player's current inventory to black stained glass pane named "&7" with all removed NBT
set slot 52 of player's current inventory to barrier named "&eClose GUI" with all removed NBT
set slot 53 of player's current inventory to black stained glass pane named "&7" with all removed NBT
loop {bans::*}:
if {_page::posts} is less than {_page::max}:
if {_page::count} is greater than or equal to {_page::min}:
if {sban.warns.%loop-value%} is not set:
set {sban.warns.%arg 1%} to 1
set slot {_page::posts} of player's current inventory to loop-value's skull named "&7Player &8» &e%loop-value%" with lore "||&7&oClick here to unban this player||||&7Ban ID &8» &7(&b##%loop-index%&7)||||&7Banned by &8» &a%{sban.bannedby.%loop-value%}%||&7IP Banned &8» &a%{sban.banip.%loop-value%}%||&7Banned on &8» &a%{sban.bannedon.%loop-value%}%||&7Autounban &8» &a%{sban.banexpire.%loop-value%}%||&7Warns &8» &c%{sban.warns.%arg 1%} - 1%&7/&c{@max warns}||||&7Do &c/check %loop-value% &7to view||&7more info about this player||&7" with all removed NBT
add 1 to {_page::posts}
add 1 to {_page::count}
if {_page::number} is less than {_page::total}:
set slot 45 of player's current inventory to arrow named "&ePrevious Page" with all removed NBT
set slot 46 of player's current inventory to book named "&eMain Page" with all removed NBT
set slot 47 of player's current inventory to black stained glass pane named "&7" with all removed NBT
set slot 48 of player's current inventory to book and quill named "&eBasic information" with lore "||&7Banned users &8» &c%{sizeofbans::*}%||||&7Page &8» &c%{_page::number}%&7/&c%{_page::total}%" with all removed NBT
set slot 49 of player's current inventory to stone button named "&eRefresh GUI" with lore "||&7Click here to refresh the gui without||&7loosing the page you are viewing" with all removed NBT
set slot 50 of player's current inventory to name tag named "&eSearch players" with lore "||&7Click here to &csearch &7banned players.||&7Type player's name in chat to proceed" with all removed NBT
set slot 51 of player's current inventory to black stained glass pane named "&7" with all removed NBT
set slot 52 of player's current inventory to barrier named "&eClose GUI" with all removed NBT
set slot 53 of player's current inventory to arrow named "&eNext Page" with all removed NBT
if {_page::count} is 0:
open chest with 1 row named "&0There are %{_page::count}% banned players" to player
set slot 0 of player's current inventory to black stained glass pane named "&7" with all removed NBT
set slot 1 of player's current inventory to black stained glass pane named "&7" with all removed NBT
set slot 2 of player's current inventory to black stained glass pane named "&7" with all removed NBT
set slot 3 of player's current inventory to black stained glass pane named "&7" with all removed NBT
set slot 4 of player's current inventory to book named "&eThere aren't banned players" with lore "||&7Banned players will apear in this||&7gui. You will be able to manage||&c&lSuperBan&r&7's commands from here!" with all removed NBT
set slot 5 of player's current inventory to black stained glass pane named "&7" with all removed NBT
set slot 6 of player's current inventory to black stained glass pane named "&7" with all removed NBT
set slot 7 of player's current inventory to black stained glass pane named "&7" with all removed NBT
set slot 8 of player's current inventory to black stained glass pane named "&7" with all removed NBT
command /bansconfirm [<offlineplayer>]:
permission: sb.bansconfirm
permission message: {@prefix}&cYou don't have permission to do this!
executable by: console and player
trigger:
sender is console:
send "{@prefix}&7This command is only available for players"
else:
if arg 1 is not set:
stop
else:
if {bans::*} is not set:
send "{@prefix}&7There aren't banned players"
else:
loop {bans::*}:
if loop-value = arg 1:
open chest with 1 row named "&0You must confirm to unban him" to player
set slot 0 of player's current inventory to black stained glass pane named "&7" with all removed NBT
set slot 1 of player's current inventory to book named "&eMain Page" with lore "||&7Click here to go to bans page" with all removed NBT
set slot 2 of player's current inventory to black stained glass pane named "&7" with all removed NBT
set slot 3 of player's current inventory to black stained glass pane named "&7" with all removed NBT
set slot 4 of player's current inventory to loop-value's skull named "&7Player &8» &e%loop-value%" with lore "||&7&oAre you shure to unban this player?||||&7Ban ID &8» &7(&b##%loop-index%&7)||||&7Banned by &8» &a%{sban.bannedby.%loop-value%}%||&7IP Banned &8» &a%{sban.banip.%loop-value%}%||&7Banned on &8» &a%{sban.bannedon.%loop-value%}%||&7Autounban &8» &a%{sban.banexpire.%loop-value%}%||&7Warns &8» &c%{sban.warns.%arg 1%} - 1%&7/&c{@max warns}||||&7Do &c/check %loop-value% &7to view||&7more info about this player||&7" with all removed NBT
set slot 5 of player's current inventory to black stained glass pane named "&7" with all removed NBT
set slot 6 of player's current inventory to light green stained glass pane named "&7Unban &8» &a%loop-value%" with all removed NBT
set slot 7 of player's current inventory to black stained glass pane named "&7" with all removed NBT
set slot 8 of player's current inventory to black stained glass pane named "&7" with all removed NBT
#=====================#
# EVENTS #
#=====================#
on inventory click:
if inventory name of player's current inventory contains "&0There are":
cancel event
if inventory name of player's current inventory contains "&0List of banned players":
cancel event
set {_page} to "%inventory name of player's current inventory%"
replace all "&0List of banned players " in {_page} with ""
set {_pages::*} to {_page} split at "/"
if clicked slot is less than 45:
if clicked item is player head:
if name of item contains "&7Player":
set {_playername} to "%clicked item's name%"
replace all "&7Player &8» &e" in {_playername} with ""
execute player command "/bansconfirm %{_playername}%"
if clicked slot is 45:
if clicked item's name is "&ePrevious Page":
if {_pages::1} parsed as an integer is greater than 1:
execute player command "/bans %{_pages::1} parsed as an integer - 1%"
else:
close player's inventory
if clicked slot is 46:
execute player command "/bans"
if clicked slot is 49:
execute player command "/bans %{_pages::1} parsed as an integer%"
if clicked slot is 50:
if clicked item's name is "&eSearch players":
close player's inventory
set {bans.chat::%player%} to true
send "{@prefix}&7You must write the player's name in chat. Type &ccancel &7to annullate the search."
if clicked slot is 52:
close player's inventory
if clicked slot is 53:
if clicked item's name is "&eNext Page":
execute player command "/bans %{_pages::1} parsed as an integer + 1%"
if inventory name of player's current inventory contains "&0You must confirm to unban him":
cancel event
if clicked slot is 1:
execute player command "/bans"
if clicked slot is 6:
set {_playername} to "%clicked item's name%"
replace all "&7Unban &8» &a" in {_playername} with ""
execute player command "/unban %{_playername}%"
if {@keep unban gui open} is false:
close player's inventory
else if {@keep unban gui open} is true:
execute player command "/bans"
on command:
if {sban.muted.%player%} is true:
if command is {@dissallowed muted cmds}:
cancel event
send "{@prefix}&7This command is not allowed as you are muted!"
on chat:
if {bans.chat::%player%} is true:
cancel event
set {_search} to "%message%" parsed as offline player
if {_search} is "cancel":
delete {bans.chat::%player%}
send "{@prefix}&7You have succesfully annullated the search."
else:
if {sban.banned.%{_search}%} is not set:
send "{@prefix}&7This player is not banned"
delete {bans.chat::%player%}
else:
if {sban.banned.%{_search}%} is true:
delete {bans.chat::%player%}
execute player command "/bansconfirm %{_search}%"
else:
delete {bans.chat::%player%}
send "{@prefix}&7This player is not banned"
if {sban.muted.%player%} is true:
player has permission "sb.unmute-on-chat":
set {sban.muted.%player%} to false
set {sban.mutedon.%player%} to "-"
set {sban.mutereason.%player%} to "-"
set {sban.muteexpire.%player%} to "-"
set {sban.mutedby.%player%} to "-"
stop
else:
cancel event
send "{@prefix}&7You can't talk while muted!"
on quit:
if {sban.banned.%player%} is true:
set leave message to ""
if {sban.kicked.%player%} is true:
set leave message to ""
delete {sban.kicked.%player%}
on skript start:
# if {bans::*} is not set:
# set {startupbans::*} to 0
# else:
# set {2::*} to {startupbans::*}
send "&r[&rSuperBans&r] Enabling SuperBans." to console
wait 1 second
send "&8&m========================================" to console
send " &cSuperBans &8- &7SuperBans has been loaded!" to console
send " &bSkript Created by &aKroterPvP" to console
send "" to console
# send " &7Loaded a total of &a%{startupbans::*}% &7banned users." to console
send "&8&m========================================" to console
on connect:
if {sban.banned.%player%} is true:
player has permission "sb.unban-on-join":
set {sban.banned.%player%} to false
set {sban.bannedon.%player%} to "-"
set {sban.banreason.%player%} to "-"
set {sban.banexpire.%player%} to "-"
set {sban.bannedby.%player%} to "-"
set {sban.banip.%player%} to false
remove player from {bans::*}
else:
if {sban.banexpire.%player%} is "Never":
set {_p} to player
kick player due to "{@ban screen message}"
loop all players:
if loop-player has permission "sb.banned-tried-to-join":
send "{@prefix}&e%player% &7is banned an tried to join." to loop-player
send "{@prefix}&e%player% &7is banned an tried to join." to console
else:
set {_p} to player
kick player due to "{@tempban screen message}"
loop all players:
if loop-player has permission "sb.tempbanned-tried-to-join":
send "{@prefix}&e%player% &7is tempbanned an tried to join." to loop-player
send "{@prefix}&e%player% &7is tempbanned an tried to join." to console
player has permission "sb.notify":
if {notify.%player%} is not set:
set {notify.%player%} to true
if {sban.firstjoin.%player%} is not set:
set {sban.firstjoin.%player%} to "yes"
if {sban.banned.%player%} is not set:
set {sban.banned.%player%} to false
if {sban.banip.%player%} is not set:
set {sban.banip.%player%} to false
if {sban.bannedby.%player%} is not set:
set {sban.bannedby.%player%} to "-"
if {sban.banreason.%player%} is not set:
set {sban.banreason.%player%} to "-"
if {sban.bannedon.%player%} is not set:
set {sban.bannedon.%player%} to "-"
if {sban.banexpire.%player%} is not set:
set {sban.banexpire.%player%} to "-"
if {sban.muted.%player%} is not set:
set {sban.muted.%player%} to false
if {sban.mutedby.%player%} is not set:
set {sban.mutedby.%player%} to "-"
if {sban.mutereason.%player%} is not set:
set {sban.mutereason.%player%} to "-"
if {sban.muteexpire.%player%} is not set:
set {sban.muteexpire.%player%} to "-"
if {sban.mutedon.%player%} is not set:
set {sban.mutedon.%player%} to "-"
if {sban.warns.%player%} is not set:
set {sban.warns.%player%} to 1
if {sban.warnedby.%player%} is not set:
set {sban.warnedby.%player%} to "-"
#=====================#
# REMOVED COMMANDS #
#=====================#
command /banlist:
trigger:
send "{@unknown cmd message}"
command /ban-ip [<text>]:
trigger:
send "{@unknown cmd message}"
command /pardon [<text>]:
trigger:
send "{@unknown cmd message}"
command /pardon-ip [<text>]:
trigger:
send "{@unknown cmd message}"