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 out 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.

IP check in on connect?

Discussion in 'Skript' started by Auswahluhr6004, Aug 21, 2017.

Thread Status:
Not open for further replies.
  1. Auswahluhr6004

    Joined:
    Mar 1, 2017
    Messages:
    109
    Likes Received:
    1
    Hello,

    I have programmed a ban script. Since I have however a cracked server, I would gladly know, as I can with on connect the ip query and whether this is banned. But please do not use the standard minecraft ban ip.

    My Code:
    Code (Skript):
    1.                         set {_now} to now
    2.                         set {_timespan} to 3 days
    3.                         add {_timespan} to {_now}
    4.                         set {_remaining} to {_now}
    5.                         set {BanIsNow.%arg 1's uuid%} to now
    6.                         set {BanDauer.%arg 1's uuid%} to 3 days
    7.                         set {BanLäuftAb.%arg 1's uuid%} to {_remaining}
    8.                         set {BanGrund.%arg 1's uuid%} to "Hacking/Clientmods"
    My Connect:

    Code (Skript):
    1. on connect:
    2.     if {BanIsNow.%player's uuid%} is set:
    3.         set {_waited} to difference between {BanIsNow.%player's uuid%} and now
    4.         if {BanDauer.%player's uuid%} is not "Permanent":
    5.             if {_waited} is bigger than {BanDauer.%player's uuid%}:
    6.                 delete {BanDauer.%player's uuid%}
    7.                 delete {BanIsNow.%player's uuid%}
    8.                 delete {BanGrund.%player's uuid%}
    9.                 delete {BanLäuftAb.%player's uuid%}
    10.             else:
    11.                 kick player due to "&8× &dBan &8×%nl% %nl%&cDu bist gebannt.%nl%&3Grund: &7%{BanGrund.%player's uuid%}%%nl%&6Läuft ab: &7%{BanLäuftAb.%player's uuid%}%%nl% %nl%&8× &dBan &8×"
    12.         else:
    13.             kick player due to "&8× &dBan &8×%nl% %nl%&cDu bist gebannt.%nl%&3Grund: &7%{BanGrund.%player's uuid%}%%nl%&6Läuft ab: &7%{BanLäuftAb.%player's uuid%}%%nl% %nl%&8× &dBan &8×"
    Thank you.

    Best regards, Auswahluhr6004
     
  2. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    Could you better explain exactly what the problem is or what is not working?
     
  3. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    he want the IP of player... and he don't wanna use the fucking minecraft "/ipban"
    cuz he got the cracked server. so if the player get banned, he can still use other minecraft, so he wanna get the IP of player.

    im not sure but %ip of player%
    ?
     
    • Informative Informative x 1
  4. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    I think I understand you, ip bans don't actually work on cracked servers? That's really odd
     
  5. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    Nah. :'D Maybe worked but he don't want use this minecraft command "/ipban" he want doing the Ban system with his skript. So he asked, is there a way to get IP of player via Skript?
     
  6. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    oh, derp, lol. Thank you for translating XD
     
    • Friendly Friendly x 1
  7. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    ...What?

    Please, read the docs.

    You can just add the ip to a list of banned ips via set {bannedips::%{_ip}%} to <duration of the ip ban>
    Then check if the ip of the player is banned on connect, if it is, kick the player.
    Have in consideration, however, that bugs ensue if you try to instantly know the ip of a player. You have to wait, at least, a tick before checking an IP address.
     
  8. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    What version of skript and spigot are u using?
     
Thread Status:
Not open for further replies.

Share This Page

Loading...