Hello. This is my first post, and will probably be the last. I only need help with this script.
I'm having some difficulties making my Ban script work. It would be amazing if someone could help me. I have been literally trying to fix the problem for 8 hours now.
You can even see in the script that i have been trying to debug and fix it. But it did not work. I have broadcasted the variables when the player joins.
The Problem:
I have banned myself with the ban command, and i rejoined. I was kicked, and in console it broadcasted the variables, it said 59 minutes 59 seconds left. Which means after 59 i will be unbanned. But i wasnt. What happened was, when the time reached 0, it started going up. So i was still banned. Please if you know how to fix this, help.
[doublepost=1499006537,1498953323][/doublepost]Bump.
[doublepost=1499014999][/doublepost]I will pay anyone $5 if they can help with this
I'm having some difficulties making my Ban script work. It would be amazing if someone could help me. I have been literally trying to fix the problem for 8 hours now.
You can even see in the script that i have been trying to debug and fix it. But it did not work. I have broadcasted the variables when the player joins.
code_language.skript:
on connect:
set {_r::*} to objects in column "ban" from result of query "SELECT `ban` FROM ban WHERE uuid = '%player's uuid%'" and close
if {_r::*} contains "Yes":
set {_r2::*} to objects in column "reason" from result of query "SELECT `reason` FROM ban WHERE uuid = '%player's uuid%'" and close
set {_r3::*} to objects in column "ban by" from result of query "SELECT `ban by` FROM ban WHERE uuid = '%player's uuid%'" and close
set {_r4::*} to objects in column "time left" from result of query "SELECT `time left` FROM ban WHERE uuid = '%player's uuid%'" and close
set {_r5::*} to objects in column "ban length" from result of query "SELECT `ban length` FROM ban WHERE uuid = '%player's uuid%'" and close
set {_time} to {_r4::1} parsed as date formatted as "yyyy.MM.dd kk:mm"
set {_length} to "%{_r5::1}% hours" parsed as timespan
send "%{_time}% - %now% - %{_length}% hours" to console
broadcast "%difference between {_time} and now%"
if difference between now and {_time} is more than "%{_length}% hours" parsed as timespan:
broadcast "k"
else:
kick the player due to "Oops! You're banned. %newline% %{_r2::*}% %newline% %{_r3::*}% %newline% %{_r5::*}%"
code_language.skript:
command /ban [<offline player>] [<text>]:
trigger:
update "INSERT INTO ban (`username`, `ip`, `uuid`, `ban`, `ban by`, `reason`, `time left`, `ban length`) VALUES ('%arg-1%', '%ip of arg-1%', '%arg-1's UUID%', 'Yes', '%player%', '%arg-2%', '%now%', '1')"
I have banned myself with the ban command, and i rejoined. I was kicked, and in console it broadcasted the variables, it said 59 minutes 59 seconds left. Which means after 59 i will be unbanned. But i wasnt. What happened was, when the time reached 0, it started going up. So i was still banned. Please if you know how to fix this, help.
[doublepost=1499006537,1498953323][/doublepost]Bump.
[doublepost=1499014999][/doublepost]I will pay anyone $5 if they can help with this
Last edited: