Sueta
AU

AuthoCode [Skript]

Beta 0.2

Server Password

·Plugin

[Description]
Need to set a password for your server?
Use this plugin just for that!
You can just whitelist people, but this does it for you.
You can put a password on your discord or twitch so people can join without asking you to do it!
If your laze or just busy doing other stuff than whitelisting everyone on your discord then this plugin is just for you!
And YES I know I'm typing too much.
Fixed your day? Welcome :)


[ How does it work? ]

Well, if a new person joins that has not played on the server before it the plugin asks the player to type in a password set by the owner or any other staff. While he is not logged on yet he is in spectator mode stuck in one place most likely the spawn which prevents the player from hitting anything walking flying or interacting with the world. Another reason for going spectator is to prevent getting banned for flying in mid-air of someone breaks the block under you

[ Requirements ]

Recommended the latest version of Skript

[ Commands ]
/ a c
open a list of other commands
/ac-pass <text> sets a password for the server
/ac-eng set the language to English
/ac-pl set the language to Polish
/ac-always <boolean> everyone needs to log in
/ac-bypass <boolean> turns off the need of login in
/ac-logged <player> <boolean> if false the plugin thinks you never been on the server

[ Admin Perms ]

ac.password
ac.logged
ac.language
ac.always
ac.bypass

# AuthoCode Version 1.0 
# Author: tomekk2006 

#default settings 
variables: 
    {password} = "password" 
    {language} = "eng" 
    {bypass} = "false" 
    {%player%.logged} = true 
    {eng.join} = "&cTo play on the server please enter the set by owner &bpassword&c using the command &2/password <text>" 
    {eng.logged} = "&2You are logged in!" 
    {eng.wrong} = "&4Wrong password!" 
    {pl.join} = "&cŻeby zagrać na serwrze prosze wpisać &bhasło &custawione przez właśćiciela używając komendy &2/haslo <text>" 
    {pl.logged} = "&2Zalogowany!" 
    {pl.wrong} = "&4Złe hasło!" 
    {password.all} = false 

# -----[code]----- 


on first join: 
    set {%player%.logged} to {bypass_pass} 
  
on join: 
    {password.all} = true: 
        set {%player%.logged} to false 
    wait 1 second 
    set {%players%.gamemode} to the player's gamemode 
    {%player%.logged} = true: 
        set the player's gamemode to {%players%.gamemode} 
    else: 
        set the player's gamemode to spectator 
        {language} = "eng": 
            message "%{eng.join}%" 
        else: 
            message "%{pl.join}%" 
      
on any movement: 
    {%player%.logged} = false: 
        cancel event 
        set the player's gamemode to spectator 
        {language} = "eng": 
            message "%{eng.join}%" 
        else: 
            message "%{pl.join}%" 

command /password <text>: 
    aliases: /haslo 
    trigger: 
        {language} is "eng":   
            {password} is arg-1: 
                message "%{eng.logged}%" 
                set the player's gamemode to {%players%.gamemode} 
                set {%player%.logged} to true 
            else: 
                message "%{eng.wrong}%" 
        else: 
            {password} is arg-1: 
                message "%{pl.logged}%" 
                set the player's gamemode to {%players%.gamemode} 
                set {%player%.logged} to true 
            else: 
                message "%{pl.wrong}%" 
command /ac-pass <text>: 
    permission: ac.password 
    trigger: 
        set {password} to arg-1 
        message "Password set to %arg-1%" 
command /ac-pl: 
    permission: ac.language 
    trigger: 
        set {language} to "pl" 
        message "Język ustawiony na polski!" 
command /ac-eng: 
    permission: ac.language 
    trigger: 
        set {language} to "eng" 
        message "Language set to english!" 
command /ac-logged <player> <boolean>: 
    permission: ac.logged 
    trigger: 
        set {%arg-1%.logged} to arg-2 
        message "%arg-1% logged: %arg-2%" 
command /ac: 
    trigger: 
        message "&b[AuthoCode]" 
        message "&bCreator: tomekk2006" 
        message "&bVersion: 1.0" 
        message "&b[Commands:]" 
        message "&b/ac-pass" 
        message "&b/ac-logged" 
        message "&b/ac-pl" 
        message "&b/ac-eng" 
        message "&b/ac-bypass" 
        message "&b/ac-always" 

command /ac-bypass <boolean>: 
    permission: ac.bypass 
    trigger: 
        set {bypass} to arg-1 
        message "Bypass is set to %arg-1%" 

command /ac-always <boolean>: 
    permission: ac.always 
    trigger: 
        set {password.all} to arg-1 
        message "ac-always is set to %arg-1%"

Similar projects

Plugin →