IP check in on connect?

  • 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.
Mar 1, 2017
109
1
18
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_language.skript:
                        set {_now} to now
                        set {_timespan} to 3 days
                        add {_timespan} to {_now}
                        set {_remaining} to {_now}
                        set {BanIsNow.%arg 1's uuid%} to now
                        set {BanDauer.%arg 1's uuid%} to 3 days
                        set {BanLäuftAb.%arg 1's uuid%} to {_remaining}
                        set {BanGrund.%arg 1's uuid%} to "Hacking/Clientmods"

My Connect:

code_language.skript:
on connect:
    if {BanIsNow.%player's uuid%} is set:
        set {_waited} to difference between {BanIsNow.%player's uuid%} and now
        if {BanDauer.%player's uuid%} is not "Permanent":
            if {_waited} is bigger than {BanDauer.%player's uuid%}:
                delete {BanDauer.%player's uuid%}
                delete {BanIsNow.%player's uuid%}
                delete {BanGrund.%player's uuid%}
                delete {BanLäuftAb.%player's uuid%}
            else:
                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×"
        else:
            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
 
Could you better explain exactly what the problem is or what is not working?
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%
?
 
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%
?
I think I understand you, ip bans don't actually work on cracked servers? That's really odd
 
I think I understand you, ip bans don't actually work on cracked servers? That's really odd
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?
 
...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.
 
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_language.skript:
                        set {_now} to now
                        set {_timespan} to 3 days
                        add {_timespan} to {_now}
                        set {_remaining} to {_now}
                        set {BanIsNow.%arg 1's uuid%} to now
                        set {BanDauer.%arg 1's uuid%} to 3 days
                        set {BanLäuftAb.%arg 1's uuid%} to {_remaining}
                        set {BanGrund.%arg 1's uuid%} to "Hacking/Clientmods"

My Connect:

code_language.skript:
on connect:
    if {BanIsNow.%player's uuid%} is set:
        set {_waited} to difference between {BanIsNow.%player's uuid%} and now
        if {BanDauer.%player's uuid%} is not "Permanent":
            if {_waited} is bigger than {BanDauer.%player's uuid%}:
                delete {BanDauer.%player's uuid%}
                delete {BanIsNow.%player's uuid%}
                delete {BanGrund.%player's uuid%}
                delete {BanLäuftAb.%player's uuid%}
            else:
                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×"
        else:
            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
What version of skript and spigot are u using?
 
Status
Not open for further replies.