Bans.

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

ezmann!44

Member
Jul 2, 2017
35
1
0
26
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.

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')"
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
 
Last edited:
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.

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')"
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
Adrihun, like I told you on discord at least one of the problems is with your {_length} variable
 
Thanks for your comment

I am not adrihun.

I have looked at the code many times and I haven't seen anything wrong with the {_length} variable.
Could you tell me which line is messing the script up?
 
Status
Not open for further replies.