Permissions In Certain World Filtering

  • 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 community!

    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.

Inferno

Member
Feb 2, 2017
20
0
0
Skript Version: Skript 2.2 (dev24b)
Skript Author: Bensku
Minecraft Version: 1.11.2
---

In my script (below, but note that it is not finished so there are probably many issues) I have created a new help command. From what I can see, where it should filter it does not. My server uses PEX for permissions and in certain worlds the player has differnt permissions than in others. Correct me if I am wrong, but the "if player has permission" is in all worlds, not only the one they are in. Is there any way I can resolve this? Thanks.

Full Code:

code_language.skript:
on load:
    if file "plugins/HelpPage/Config.yml" doesn't exist:
        create file "plugins/HelpPage/Config.yml"
        set yaml value "Settings.Commands-Per-Page" from file "plugins/HelpPage/Config.yml" to 9
        set yaml value "Settings.Header" from file "plugins/HelpPage/Config.yml" to "&e ---- &6Help &e-- &6Page &c{PAGE}&6/&c{TOTAL} &e----"
        set yaml value "Settings.Footer" from file "plugins/HelpPage/Config.yml" to "&6Type &c/help {NEXTPAGE} &6to read the next page."
        stop trigger

command /help [<text>]:
    trigger:
        set {_all::*} to all commands
        loop {_all::*}:
            set {_perm} to the permission of command "%loop-value%"
            if player has permission "%{_perm}%":
                send "%{_perm}%"
                set {_desc} to the description of command "%loop-value%"
                set {_commands::%loop-value%} to "%{_desc}%"
                add 1 to {_num}
        if yaml path "Settings.Commands-Per-Page" in file "plugins/HelpPage/Config.yml" does not exist:
            set yaml value "Settings.Commands-Per-Page" from file "plugins/HelpPage/Config.yml" to 9
        set {_commandsPerPage} to yaml value "Settings.Commands-Per-Page" from file "plugins/HelpPage/Config.yml"
        if yaml path "Settings.Header" in file "plugins/HelpPage/Config.yml" does not exist:
            set yaml value "Settings.Header" from file "plugins/HelpPage/Config.yml" to "&e ---- &6Help &e-- &6Page &c{PAGE}&6/&c{TOTAL} &e----"
        set {_header} to yaml value "Settings.Header" from file "plugins/HelpPage/Config.yml"
        if yaml path "Settings.Footer" in file "plugins/HelpPage/Config.yml" does not exist:
            set yaml value "Settings.Footer" from file "plugins/HelpPage/Config.yml" to "&6Type &c/help {NEXTPAGE} &6to read the next page."
        set {_Footer} to yaml value "Settings.Footer" from file "plugins/HelpPage/Config.yml"
        set {_pages} to {_num} / {_commandsPerPage}
        if "%{_pages}%" contains ".":
            set {_pages} to ("%{_pages}%" parsed as int) + 1
        if arg 1 is not set:
            send "%{_header}%"
            loop {_commands::*}:
                if "%{_loop}%" is not "%{_commandsPerPage}%":
                    add 1 to {_loop}
                    send "/%loop-index%: %loop-value%"
                else:
                    send "%{_footer}%"
                    stop trigger


Errors on Reload:

None

Console Errors: (if applicable)

None

Addons using (including versions): SkQuery 3.5.8-Lime, skUtilities 0.8.8, ExertSK 1.3b, Skellett 1.9.4a, SharpSK 1.6.1.2, TuSKe 1.7.6, skRayFall 1.9.7


Troubleshooting:

Have you tried searching the docs? Yes
Have you tried searching the forums? Yes
What other methods have you tried to fix it? None
 
code_language.skript:
player's world is "world"

Maybe I've misunderstood (and sorry if I have), but that doesn't seem to fix the problem. I am asking if there is a way to check a players' permissions in a world, not if they are in a world.
 
Maybe I've misunderstood (and sorry if I have), but that doesn't seem to fix the problem. I am asking if there is a way to check a players' permissions in a world, not if they are in a world.
Oh, so i can suggest you to make per world variables like {perms::%player's world::*}
 
Oh, so i can suggest you to make per world variables like {perms::%player's world::*}
I think I see what you mean now, but wouldn't that just add it to a different variable for the world? Here's an example of what I mean, if it helps any:

The player in 'World1' has the permissions 'essentials.help', and 'essentials.msg'. When the player changes worlds to 'World2', they have 'essentials.kill' and 'essentials.fireball', but not the permissions they had in World1. My script loops through all the commands and eliminates the ones that they have no permission for whatsoever, but bunches all the worlds together. So, if the player is in World1 the script would return that they have the permission essentials.help, essentials.msg, essentials.fireball, and essentials.kill when in reality they can only user essentials.help and essentials.msg in World1.
[doublepost=1498838198,1498666753][/doublepost]Bump..
 
Status
Not open for further replies.