1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT??:

    You can always check our our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Bans.

Discussion in 'Skript' started by ezmann!44, Jul 2, 2017.

Thread Status:
Not open for further replies.
  1. ezmann!44

    ezmann!44 Active Member

    Joined:
    Jul 2, 2017
    Messages:
    35
    Likes Received:
    1
    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 (Skript):
    1. on connect:
    2.     set {_r::*} to objects in column "ban" from result of query "SELECT `ban` FROM ban WHERE uuid = '%player's uuid%'" and close
    3.     if {_r::*} contains "Yes":
    4.         set {_r2::*} to objects in column "reason" from result of query "SELECT `reason` FROM ban WHERE uuid = '%player's uuid%'" and close
    5.         set {_r3::*} to objects in column "ban by" from result of query "SELECT `ban by` FROM ban WHERE uuid = '%player's uuid%'" and close
    6.         set {_r4::*} to objects in column "time left" from result of query "SELECT `time left` FROM ban WHERE uuid = '%player's uuid%'" and close
    7.         set {_r5::*} to objects in column "ban length" from result of query "SELECT `ban length` FROM ban WHERE uuid = '%player's uuid%'" and close
    8.         set {_time} to {_r4::1} parsed as date formatted as "yyyy.MM.dd kk:mm"
    9.         set {_length} to "%{_r5::1}% hours" parsed as timespan
    10.         send "%{_time}% - %now% - %{_length}% hours" to console
    11.         broadcast "%difference between {_time} and now%"
    12.         if difference between now and {_time} is more than "%{_length}% hours" parsed as timespan:
    13.             broadcast "k"
    14.         else:
    15.             kick the player due to "Oops! You're banned. %newline% %{_r2::*}% %newline% %{_r3::*}% %newline% %{_r5::*}%"
    Code (Skript):
    1. command /ban [<offline player>] [<text>]:
    2.     trigger:
    3.         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.
    --- Double Post Merged, Jul 2, 2017, Original Post Date: Jul 2, 2017 ---
    Bump.
    --- Double Post Merged, Jul 2, 2017 ---
    I will pay anyone $5 if they can help with this
     
    #1 ezmann!44, Jul 2, 2017
    Last edited: Jul 2, 2017
  2. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    Adrihun, like I told you on discord at least one of the problems is with your {_length} variable
     
  3. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    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?
     
Thread Status:
Not open for further replies.
Loading...