Solved Need Help for function

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

xXSwainXx

Active Member
Jan 27, 2017
55
5
8
Hey Guys,

I need help for my skript.

here the code:

code_language.skript:
function getConfigType(id: number) :: number:
    set {_sections::*} to configuration section "users" get of "plugins/PermissionsEx/permissions.yml"
    if "%{_sections::1}%" contains "-":
        return 1
    else:
        return 2
function getGroups(p_name:text) :: text:
    if getConfigType(1) is 2:
        set {_groups::*} to value list "users.%{_p_name}%.group" get of "plugins/PermissionsEx/permissions.yml"
        set {_return} to "%{_groups::*}%"
        replace all " and" with "," in {_return}
        return {_return}
        stop
    if getConfigType(1) is 1:
        set {_groups::*} to value list "users.%uuid of {_p_name}%.group" get of "plugins/PermissionsEx/permissions.yml"
        set {_return} to "%{_groups::*}%"
        replace all " and" with "," in {_return}
        return {_return}
        stop

function getGroup(p_name:text) :: text:
    set {_group::*} to getGroups({_p_name}) split at ", "
    loop {_group::*} :
        add loop-value to {_groups::*}
    return {_groups::1}

Command:

code_language.skript:
command /info [<text>]:
    aliases: i
    trigger:
        if player does not have permission "{@Permission.Info}":
            message "{@Logo} {@NoPermission}"
        else:
            If arg-1 is not set:
                message "{@Logo} {@NoName}"
                message "{@Logo} &a/info &c<Spieler>"
            else:
                set {_getIP} to WasPlayerAlreadyOnline("%arg-1%")
                If {_getIP} is "false":
                    message "{@Logo} {@PlayerNotFound}"
                else:
                    set {_BannedMoreInfo} to ""
                    set {_MutedMoreInfo} to ""
                    set {_id} to "{@UUID-Support}"
                    If {_id} is "true":
                        set {_uuid} to getUUID("%arg-1%")
                        set {_Banned?} to getBannedPlayer("%{_uuid}%", "Player")
                    else:
                        set {_Banned?} to getBannedPlayer("%arg-1%", "Player")
                    If {_Banned?} is "true":
                        set {_Banned?} to "&aJa"
                    else:
                        set {_Banned?} to "&cNein"
                    If {_id} is "true":
                        set {_Muted?} to getMutedPlayer("%{_uuid}%", "Player")
                    else:
                        set {_Muted?} to getMutedPlayer("%arg-1%", "Player")
                    If {_Muted?} is "true":
                        set {_Muted?} to "&aJa"
                    else:
                        set {_Muted?} to "&cNein"
                    If {_id} is "true":
                        set {_SetResult::*} to objects in column "Log" from result of query "SELECT * FROM History WHERE Player = '%{_uuid}%'"
                    else:
                        set {_SetResult::*} to objects in column "Log" from result of query "SELECT * FROM History WHERE Player = '%arg-1%'"
                    set {_getResult} to false
                    loop {_SetResult::*}:
                        set {_getResult} to true
                    set {_Rang?} to getGroup("%arg-1%")
                    set {info.head.%arg-1%} to skull of "%arg-1%" parsed as offline player
                    set {banstat.head} to skull of "Globe" parsed as offline player
                    open hopper named "&9&l%arg-1%" to player
                    format slot 0 of player with {info.head.%arg-1%} named "&7InGame Name&8: &3%arg-1%" with lore "&a||&7Rang&8: %{_Rang?}% ||&7Status: %{on.%arg-1%}%" to be unstealable
                    format slot 4 of player with {banstat.head} named "&7Punkte" with lore "&a||&7Bannpunkte&8: &3%{banpunkte.%arg-1%}%||&7Mutepunkte&8: &3%{mutepunkte.%arg-1%}%" to be unstealable
                    format slot 3 of player with paper named "&7Status" with lore "&a||&7Ist Gebannt&8: %{_Banned?}%||&7Ist Gemuted&8: %{_Muted?}%" to be unstealable


this comes InGame:


Screenshot_9.png


Please help


Best regards

David
[doublepost=1486836914,1486741642][/doublepost]#PUSH

NEED HELP PLS
 
Last edited:
I use this to get the player group
code_language.skript:
function getPlayerGroup(p: player) :: text:
    "%configuration section ""users"" get of ""plugins/PermissionsEx/permissions.yml""%" contain "-":
        set {_p} to uuid of {_p}
    set {_group::*} to value list "users.%{_p}%.group" get of "plugins/PermissionsEx/permissions.yml"
    return {_group::1}
 
Ouh thx it works!
[doublepost=1486933681,1486907992][/doublepost]
I use this to get the player group
code_language.skript:
function getPlayerGroup(p: player) :: text:
    "%configuration section ""users"" get of ""plugins/PermissionsEx/permissions.yml""%" contain "-":
        set {_p} to uuid of {_p}
    set {_group::*} to value list "users.%{_p}%.group" get of "plugins/PermissionsEx/permissions.yml"
    return {_group::1}


Question:
code_language.skript:
 with lore "&a||&7Rang&8: &e%getPlayerGroup("%arg-1%")%||&7Status: %{on.%arg-1%}%" to be unstealable

Because I need it for a Argument
 
Ouh thx it works!
[doublepost=1486933681,1486907992][/doublepost]


Question:
code_language.skript:
 with lore "&a||&7Rang&8: &e%getPlayerGroup("%arg-1%")%||&7Status: %{on.%arg-1%}%" to be unstealable

Because I need it for a Argument
I do not think I understood correctly. but
code_language.skript:
set {_player} to "%arg-1%" parsed as offlineplayer
# and use
getPlayerGroup({_player})
 
Ok thanks i will try it
[doublepost=1486937510,1486937047][/doublepost]I have a error when i execute the command

Screenshot_17.png
 
This may be a conflict with the ViaVersion plugin
Do you get any errors on the console?
 
If you have the ViaVersion plugin, try removing it to see if the problem persists.
If is any conflict, I really do not know how I can help you
 
ehm it's working when I join with 1.8 but error in skript

Screenshot_19.png
 
I use this to get the player group
code_language.skript:
function getPlayerGroup(p: player) :: text:
    "%configuration section ""users"" get of ""plugins/PermissionsEx/permissions.yml""%" contain "-":
        set {_p} to uuid of {_p}
    set {_group::*} to value list "users.%{_p}%.group" get of "plugins/PermissionsEx/permissions.yml"
    return {_group::1}
That is a very bad way of doing it as the yml file doesn't update instantly when the player is added.
 
Ehm it works on my server i became instant the rank
[doublepost=1488557412,1488557381][/doublepost]Or send your version
 
Status
Not open for further replies.