Hello, I'm setting up my new skript. The title says it all, I'm having errors with the tempban module. All seems correct. I'm using timespans and the timers are perfectly displayed.
Every second the server checks if there are banned players. To do this, it loops the variable {bans::*}. If the banned player's autounban description equals to "Never", means the player is not going to be unbanned, so it stops and jumps to other loop-value. If there are any loop-value (player) who's autounban description doesn't equal to "Never", it checks if "now" is bigger than "loop-value's time of expiration". If it's true, it should execute a command to unban, and if it's not, it should stop.
It should work, but it doesn't. The player's aren't unbanned. The autounban description part runs well. But the part to check if the player should be unbanned is not running well.
All code is correctly writed, without any console error. Can somebody check the code, and help me?
Thanks,
KroterPvP.
Every second the server checks if there are banned players. To do this, it loops the variable {bans::*}. If the banned player's autounban description equals to "Never", means the player is not going to be unbanned, so it stops and jumps to other loop-value. If there are any loop-value (player) who's autounban description doesn't equal to "Never", it checks if "now" is bigger than "loop-value's time of expiration". If it's true, it should execute a command to unban, and if it's not, it should stop.
It should work, but it doesn't. The player's aren't unbanned. The autounban description part runs well. But the part to check if the player should be unbanned is not running well.
All code is correctly writed, without any console error. Can somebody check the code, and help me?
code_language.skript:
command /tempban [<offlineplayer>] [<text>] [<timespan>]:
permission: tempban
permission message: &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 "&7This player is already tempbanned"
else:
if arg 1 has permission "sb.tempban.exempt":
send "&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.bannedby.%arg 1%} to "%sender%"
set {sban.banip.%arg 1%} to false
add arg 1 to {bans::*}
kick arg 1 due to "&7You were &cTempBanned &7from &6ServerName"
else:
send "&7You must use &c/tempban <player> <reason> <timespan>"
else:
send "&7You must use &c/tempban <player> <reason> <timespan>"
else:
send "&7You must use &c/tempban <player> <reason> <timespan>"
every 1 second:
execute console command "/updatetempbantimes"
command /updatetempbantimes:
permission: sban.updatetempbantimes
permission message: &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":
if now is bigger than {sban.banexpire.%loop-value%}:
execute console command "/unban %loop-value%"
KroterPvP.
Last edited: