Problem with variable

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

DasSkript

Member
Aug 22, 2018
2
0
0
19
Hey guys

I've a problem with my ban system with skript
When I want to ban a player it works. But when I try them to unban it doesn't works the banned player can't join the server

I've a problem with my ban system with skript
When I want to ban a player it works. But when I try them to unban it doesn't works the banned player can't join the server

code_language.skript:
on connect:
    if {ban.%player's UUID%} is true:
        kick player due to "&8&m----------&r &4&oBan &r&8&m----------%nl%%nl%&cYou were banned from the server%nl%Reason: %{ban.reason.%player's UUID%}%"

command /ban [<offlineplayer>] [<text>]:
    permission: ban.use
    permission message: &cYou don't have the permission to execute this command
    trigger:
        if arg-1 is set:
            if arg-2 is set:
                if arg-1 doesn't have permission "ban.use":
                    set {ban.reason.%arg-1's UUID%} to arg-2
                    set {ban.%arg-1's UUID%} to true
                    kick arg-1 due to "&8&m----------&r &4&oBan &r&8&m----------%nl%%nl%&cYou were banned from the server%nl%Reason: %arg-2%"
                    send "&cYou banned %arg-1% for %arg-2%"
                else:
                send "&cYou can't ban this player"
            else:
            send "&cCorrect usage: /ban [<player>] [<reason>]"
        else:
        send "&cCorrect usage: /ban [<player>] [<reason>]"

command /unban [<offlineplayer>]:
    permission: ban.use
    permission message: &cYou don't have the permission to execute this command
    trigger:
        if arg-1 is set:
            set {ban.%arg-1's UUID%} to true
            message "&cYou unbanned %arg-1%"


MyPlugins (Skript): SkQuery,Skellett,Skript,WildSkript,skDragon,skRayfall,skUtilities

Sorry for my bad English im German ;(
[doublepost=1534967531,1534967209][/doublepost]At the unban code there should be
code_language.skript:
set {ban.%arg-1's UUID%} to false
I can't edit the thread
 
First of all to edit your thread, you click edit, bottom left by report.
Second, based on how's its written there is no reason the player shouldn't be able to connect if they are unbanned
 
Third of all learn how to use list variables e.g. {ban::%player%}
JD is 100% correct. List variables are much more optimized, especially when coming to deleting them or needing to loop them.
You can delete an ENTIRE list with just 1 line of code, rather than having to delete EACH and every variable one by one.
Just replace all the periods in your variables with double colons.... so {variable.%player%} would become {variable::%player%}
 
Status
Not open for further replies.