Skocz do zawartości
  • 0

Gdzie dodać funkcje?


Pytanie

11 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0

W komendzie /exp-give:

Spoiler

command /exp-give [<text>] [<number>] [<text>] [<text>] [<text>]:
    usage: /exp-give <gracz> <iloϾ> [-s] [-n] [-c]
    permission: admin
    permission message: {@msg-no-perm}
    executable by: console and player
    trigger:
        if arg 1 is not set:
            send "&f/exp-give &c<gracz> &f<iloϾ> [-s] [-n] [-c]"
            stop
        set {_p} to arg 1 parsed as offlineplayer
        if {lv::%{_p}%} is not set:
            send "{@msg-not-found}"
            stop
        if arg 2 is not set:
            send "&f/exp-give <gracz> &c<iloϾ> &f[-s] [-n] [-c]"
            stop
        if arg 2 > {@max-exp-give-limit}:
            send "&cPodana iloœæ expa jest zbyt du¿a."
            stop
        if arg 2 < -{@max-exp-give-limit}:
            send "&cPodana iloœæ expa jest zbyt du¿a."
            stop
        if {dxppl.%{_p}%} < now:
            delete {dxppl.%{_p}%}
        {lv::%{_p}%} < {@max-lvl}
        set {_arg2} to arg 2
        if {@exp-rounding} is true:
            set {xp::%{_p}%} to round {xp::%{_p}%}
            set {_arg2} to round up {_arg2}
        if {expmultiplier} is false:
            if arg 3 or arg 4 or arg 5 is "-n":
                set {_x2} to 1
                set {_exp} to "{@exp-name}"
            else:
                set {_x2} to 1
                set {_exp} to "{@exp-name}"
                if {dxppl.%{_p}%} is set:
                    set {_x2} to {@exp-multiplier-1}
                    set {_exp} to "{@multiplier-1-name}"
        if {expmultiplier} is true:
            if arg 3 or arg 4 or arg 5 is "-n":
                set {_x2} to 1
                set {_exp} to "{@exp-name}"
            else:
                set {_x2} to {@exp-multiplier-1}
                set {_exp} to "{@multiplier-1-name}"
                if {@allow-multiplier-2} is true:
                    if {dxppl.%{_p}%} is set:
                        set {_x2} to {@exp-multiplier-2}
                        set {_exp} to "{@multiplier-2-name}"
                if {_arg2} < 0:
                    if {@multiplier-negative-exp} is false:
                        set {_x2} to 1
                        set {_exp} to "{@exp-name}"
        set {_prexp::%{_p}%} to {xp::%{_p}%}
        if {xp::%{_p}%} < {mxp::%{_p}%}:
            add {_arg2}*{_x2} to {xp::%{_p}%}
            set {_ilosc} to "%{_arg2}*{_x2}%"
        if {_arg2} > 0:
            set {_znak} to "{@exp-give-plus}"
        if {_arg2} <= 0:
            set {_znak} to "{@exp-give-minus}"
            if {xp::%{_p}%} < 0:
                if {@max-negative-exp} <= 0:
                    if {xp::%{_p}%} < {@max-negative-exp}:
                        if {_prexp::%{_p}%} < {@max-negative-exp}:
                            set {xp::%{_p}%} to {_prexp::%{_p}%}
                        else:
                            set {xp::%{_p}%} to {@max-negative-exp}
        if {xp::%{_p}%} >= {mxp::%{_p}%}:
            if {@large-exp-mode} is 1:
                set {_iloscgl.%{_p}%} to {_ilosc}-{mxp::%{_p}%}-{xp::%{_p}%}
                add 1 to {lv::%{_p}%}
                execute console command "/maxexpchange %{_p}%"
                loop {@max-lvl} times:
                    if {_iloscgl.%{_p}%} >= {mxp::%{_p}%}:
                        set {_iloscgl.%{_p}%} to {_iloscgl.%{_p}%}-{mxp::%{_p}%}
                        add 1 to {lv::%{_p}%}
                        execute console command "/maxexpchange %{_p}%"
                        if {lv::%{_p}%} >= {@max-lvl}:
                            stop loop
                    if {_iloscgl.%{_p}%} < {mxp::%{_p}%}:
                        set {xp::%{_p}%} to {_iloscgl.%{_p}%}
                        stop loop
            if {@large-exp-mode} is 2:
                add 1 to {lv::%{_p}%}
                execute console command "/maxexpchange %{_p}%"
            if {lv::%{_p}%} >= {@max-lvl}:
                set {xp::%{_p}%} to {mxp::%{_p}%}
                set {lv::%{_p}%} to {@max-lvl}
            else:
                if {@large-exp-mode} is 2:
                    set {xp::%{_p}%} to 0
            send "{@msg-lvl-up}" to {_p}
			addPoint({_p})
            if {@lvlup-lighting-effect} is true:
                strike lightning effect at location of {_p}
            if {@head-level-enabled} is true:
                execute console command "/scoreboard players set %{_p}% Levels %{lv::%{_p}%}%"
            if {@broadcast-lvlup} is true:
                if {@bc-each-level} is true:
                    set {_bclvlup} to true
                if {lv::%{_p}%} is {@distinction-levels}:
                    set {_bclvlup} to true
                if {_bclvlup} is set:
                    loop all players:
                        if {_p} is not loop-player:
                            send "{@msg-lvl-up-bc}" to loop-player
            if {xp::%{_p}%} is -0:
                set {xp::%{_p}%} to 0
        if executor is player:
            if player is not {_p}:
                send "{@msg-exp-other}"
        if arg 3 or arg 4 or arg 5 is "-c":
            if executor is console:
                send "{@msg-exp-other}"
        if arg 3 or arg 4 or arg 5 is "-s":
            stop
        else:
            send "{@msg-exp}" to {_p}

 

 

Odnośnik do komentarza
https://skript.pl/temat/30796-gdzie-doda%C4%87-funkcje/#findComment-201120
Udostępnij na innych stronach

  • 0
1 minutę temu, knugi napisał:

W komendzie /exp-give:

  Ukryj zawartość


command /exp-give [<text>] [<number>] [<text>] [<text>] [<text>]:
    usage: /exp-give <gracz> <iloϾ> [-s] [-n] [-c]
    permission: admin
    permission message: {@msg-no-perm}
    executable by: console and player
    trigger:
        if arg 1 is not set:
            send "&f/exp-give &c<gracz> &f<iloϾ> [-s] [-n] [-c]"
            stop
        set {_p} to arg 1 parsed as offlineplayer
        if {lv::%{_p}%} is not set:
            send "{@msg-not-found}"
            stop
        if arg 2 is not set:
            send "&f/exp-give <gracz> &c<iloϾ> &f[-s] [-n] [-c]"
            stop
        if arg 2 > {@max-exp-give-limit}:
            send "&cPodana iloœæ expa jest zbyt du¿a."
            stop
        if arg 2 < -{@max-exp-give-limit}:
            send "&cPodana iloœæ expa jest zbyt du¿a."
            stop
        if {dxppl.%{_p}%} < now:
            delete {dxppl.%{_p}%}
        {lv::%{_p}%} < {@max-lvl}
        set {_arg2} to arg 2
        if {@exp-rounding} is true:
            set {xp::%{_p}%} to round {xp::%{_p}%}
            set {_arg2} to round up {_arg2}
        if {expmultiplier} is false:
            if arg 3 or arg 4 or arg 5 is "-n":
                set {_x2} to 1
                set {_exp} to "{@exp-name}"
            else:
                set {_x2} to 1
                set {_exp} to "{@exp-name}"
                if {dxppl.%{_p}%} is set:
                    set {_x2} to {@exp-multiplier-1}
                    set {_exp} to "{@multiplier-1-name}"
        if {expmultiplier} is true:
            if arg 3 or arg 4 or arg 5 is "-n":
                set {_x2} to 1
                set {_exp} to "{@exp-name}"
            else:
                set {_x2} to {@exp-multiplier-1}
                set {_exp} to "{@multiplier-1-name}"
                if {@allow-multiplier-2} is true:
                    if {dxppl.%{_p}%} is set:
                        set {_x2} to {@exp-multiplier-2}
                        set {_exp} to "{@multiplier-2-name}"
                if {_arg2} < 0:
                    if {@multiplier-negative-exp} is false:
                        set {_x2} to 1
                        set {_exp} to "{@exp-name}"
        set {_prexp::%{_p}%} to {xp::%{_p}%}
        if {xp::%{_p}%} < {mxp::%{_p}%}:
            add {_arg2}*{_x2} to {xp::%{_p}%}
            set {_ilosc} to "%{_arg2}*{_x2}%"
        if {_arg2} > 0:
            set {_znak} to "{@exp-give-plus}"
        if {_arg2} <= 0:
            set {_znak} to "{@exp-give-minus}"
            if {xp::%{_p}%} < 0:
                if {@max-negative-exp} <= 0:
                    if {xp::%{_p}%} < {@max-negative-exp}:
                        if {_prexp::%{_p}%} < {@max-negative-exp}:
                            set {xp::%{_p}%} to {_prexp::%{_p}%}
                        else:
                            set {xp::%{_p}%} to {@max-negative-exp}
        if {xp::%{_p}%} >= {mxp::%{_p}%}:
            if {@large-exp-mode} is 1:
                set {_iloscgl.%{_p}%} to {_ilosc}-{mxp::%{_p}%}-{xp::%{_p}%}
                add 1 to {lv::%{_p}%}
                execute console command "/maxexpchange %{_p}%"
                loop {@max-lvl} times:
                    if {_iloscgl.%{_p}%} >= {mxp::%{_p}%}:
                        set {_iloscgl.%{_p}%} to {_iloscgl.%{_p}%}-{mxp::%{_p}%}
                        add 1 to {lv::%{_p}%}
                        execute console command "/maxexpchange %{_p}%"
                        if {lv::%{_p}%} >= {@max-lvl}:
                            stop loop
                    if {_iloscgl.%{_p}%} < {mxp::%{_p}%}:
                        set {xp::%{_p}%} to {_iloscgl.%{_p}%}
                        stop loop
            if {@large-exp-mode} is 2:
                add 1 to {lv::%{_p}%}
                execute console command "/maxexpchange %{_p}%"
            if {lv::%{_p}%} >= {@max-lvl}:
                set {xp::%{_p}%} to {mxp::%{_p}%}
                set {lv::%{_p}%} to {@max-lvl}
            else:
                if {@large-exp-mode} is 2:
                    set {xp::%{_p}%} to 0
            send "{@msg-lvl-up}" to {_p}
			addPoint({_p})
            if {@lvlup-lighting-effect} is true:
                strike lightning effect at location of {_p}
            if {@head-level-enabled} is true:
                execute console command "/scoreboard players set %{_p}% Levels %{lv::%{_p}%}%"
            if {@broadcast-lvlup} is true:
                if {@bc-each-level} is true:
                    set {_bclvlup} to true
                if {lv::%{_p}%} is {@distinction-levels}:
                    set {_bclvlup} to true
                if {_bclvlup} is set:
                    loop all players:
                        if {_p} is not loop-player:
                            send "{@msg-lvl-up-bc}" to loop-player
            if {xp::%{_p}%} is -0:
                set {xp::%{_p}%} to 0
        if executor is player:
            if player is not {_p}:
                send "{@msg-exp-other}"
        if arg 3 or arg 4 or arg 5 is "-c":
            if executor is console:
                send "{@msg-exp-other}"
        if arg 3 or arg 4 or arg 5 is "-s":
            stop
        else:
            send "{@msg-exp}" to {_p}

 

 

Przetestuję jutro. Chciałbym powiedzieć, że tą komenda exp-give w innym skripcie jest nadawany exp. Nie chciałbym aby okazało się, że za każdym zabiciem moba, czyli wywołaniem komendy exp-give nadawało punkt. 

Odnośnik do komentarza
https://skript.pl/temat/30796-gdzie-doda%C4%87-funkcje/#findComment-201121
Udostępnij na innych stronach

  • 0
[18:41:20] [Server thread/ERROR]: 'addPoint({_p})' is not a boolean (yes/no) (levele.sk, line 639: addPoint({_p})')
[

Moglby ktoś zrobic reset expa po wbiciu lvl

teraz jest tak:

700/700

Level UP

700/1400

####

chcialbym, aby bylo tak:

700/700

Level UP

0/1400

Edytowane przez EvoChestenchpl
Odnośnik do komentarza
https://skript.pl/temat/30796-gdzie-doda%C4%87-funkcje/#findComment-201215
Udostępnij na innych stronach

  • 0
W dniu 19.12.2018 o 10:16, knugi napisał:

Podaj kod z tą funkcją addPoint, która zrobiłeś

command /exp-give [<text>] [<number>] [<text>] [<text>] [<text>]:
    usage: /exp-give <gracz> <iloϾ> [-s] [-n] [-c]
    permission: admin
    permission message: {@msg-no-perm}
    executable by: console and player
    trigger:
        if arg 1 is not set:
            send "&f/exp-give &c<gracz> &f<iloϾ> [-s] [-n] [-c]"
            stop
        set {_p} to arg 1 parsed as offlineplayer
        if {lv::%{_p}%} is not set:
            send "{@msg-not-found}"
            stop
        if arg 2 is not set:
            send "&f/exp-give <gracz> &c<iloϾ> &f[-s] [-n] [-c]"
            stop
        if arg 2 > {@max-exp-give-limit}:
            send "&cPodana iloœæ expa jest zbyt du¿a."
            stop
        if arg 2 < -{@max-exp-give-limit}:
            send "&cPodana iloœæ expa jest zbyt du¿a."
            stop
        if {dxppl.%{_p}%} < now:
            delete {dxppl.%{_p}%}
        {lv::%{_p}%} < {@max-lvl}
        set {_arg2} to arg 2
        if {@exp-rounding} is true:
            set {xp::%{_p}%} to round {xp::%{_p}%}
            set {_arg2} to round up {_arg2}
        if {expmultiplier} is false:
            if arg 3 or arg 4 or arg 5 is "-n":
                set {_x2} to 1
                set {_exp} to "{@exp-name}"
            else:
                set {_x2} to 1
                set {_exp} to "{@exp-name}"
                if {dxppl.%{_p}%} is set:
                    set {_x2} to {@exp-multiplier-1}
                    set {_exp} to "{@multiplier-1-name}"
        if {expmultiplier} is true:
            if arg 3 or arg 4 or arg 5 is "-n":
                set {_x2} to 1
                set {_exp} to "{@exp-name}"
            else:
                set {_x2} to {@exp-multiplier-1}
                set {_exp} to "{@multiplier-1-name}"
                if {@allow-multiplier-2} is true:
                    if {dxppl.%{_p}%} is set:
                        set {_x2} to {@exp-multiplier-2}
                        set {_exp} to "{@multiplier-2-name}"
                if {_arg2} < 0:
                    if {@multiplier-negative-exp} is false:
                        set {_x2} to 1
                        set {_exp} to "{@exp-name}"
        set {_prexp::%{_p}%} to {xp::%{_p}%}
        if {xp::%{_p}%} < {mxp::%{_p}%}:
            add {_arg2}*{_x2} to {xp::%{_p}%}
            set {_ilosc} to "%{_arg2}*{_x2}%"
        if {_arg2} > 0:
            set {_znak} to "{@exp-give-plus}"
        if {_arg2} <= 0:
            set {_znak} to "{@exp-give-minus}"
            if {xp::%{_p}%} < 0:
                if {@max-negative-exp} <= 0:
                    if {xp::%{_p}%} < {@max-negative-exp}:
                        if {_prexp::%{_p}%} < {@max-negative-exp}:
                            set {xp::%{_p}%} to {_prexp::%{_p}%}
                        else:
                            set {xp::%{_p}%} to {@max-negative-exp}
        if {xp::%{_p}%} >= {mxp::%{_p}%}:
            if {@large-exp-mode} is 1:
                set {_iloscgl.%{_p}%} to {_ilosc}-{mxp::%{_p}%}-{xp::%{_p}%}
                add 1 to {lv::%{_p}%}
                execute console command "/maxexpchange %{_p}%"
                loop {@max-lvl} times:
                    if {_iloscgl.%{_p}%} >= {mxp::%{_p}%}:
                        set {_iloscgl.%{_p}%} to {_iloscgl.%{_p}%}-{mxp::%{_p}%}
                        add 1 to {lv::%{_p}%}
                        execute console command "/maxexpchange %{_p}%"
                        if {lv::%{_p}%} >= {@max-lvl}:
                            stop loop
                    if {_iloscgl.%{_p}%} < {mxp::%{_p}%}:
                        set {xp::%{_p}%} to {_iloscgl.%{_p}%}
                        stop loop
            if {@large-exp-mode} is 2:
                add 1 to {lv::%{_p}%}
                execute console command "/maxexpchange %{_p}%"
            if {lv::%{_p}%} >= {@max-lvl}:
                set {xp::%{_p}%} to {mxp::%{_p}%}
                set {lv::%{_p}%} to {@max-lvl}
            else:
                if {@large-exp-mode} is 2:
                    set {xp::%{_p}%} to 0
            send "{@msg-lvl-up}" to {_p}
            addPoint({_p})
            clear {xp::%{_p}%}
            if {@lvlup-lighting-effect} is true:
                strike lightning effect at location of {_p}
            if {@head-level-enabled} is true:
                execute console command "/scoreboard players set %{_p}% Levels %{lv::%{_p}%}%"
            if {@broadcast-lvlup} is true:
                if {@bc-each-level} is true:
                    set {_bclvlup} to true
                if {lv::%{_p}%} is {@distinction-levels}:
                    set {_bclvlup} to true
                if {_bclvlup} is set:
                    loop all players:
                        if {_p} is not loop-player:
                            send "{@msg-lvl-up-bc}" to loop-player
            if {xp::%{_p}%} is -0:
                set {xp::%{_p}%} to 0
        if executor is player:
            if player is not {_p}:
                send "{@msg-exp-other}"
        if arg 3 or arg 4 or arg 5 is "-c":
            if executor is console:
                send "{@msg-exp-other}"
        if arg 3 or arg 4 or arg 5 is "-s":
            stop
        else:
            send "{@msg-exp}" to {_p}

Niby clear xp dziala, ale powinno resetowac do 0, a to czysci zmienna i wtedy jest none

AddPoint nadal nie dziala ten sam blad

 

@edit Naprawilem 

set {xp::%{_p}%} to 0

zadzialalo 

Edytowane przez EvoChestenchpl
Odnośnik do komentarza
https://skript.pl/temat/30796-gdzie-doda%C4%87-funkcje/#findComment-201448
Udostępnij na innych stronach

  • 0
32 minuty temu, knugi napisał:

Z clearem, mój błąd. Bardzo dobrze, że sobie poradziłeś.

I nie chodziło mi o komendę exp-give tylko te funkcję. Masz ją w ogóle czy nazwę se z **** wziąłeś?

Aha, no jest podam Ci kod za chwilę 

@edit 

 

Edytowane przez EvoChestenchpl
Odnośnik do komentarza
https://skript.pl/temat/30796-gdzie-doda%C4%87-funkcje/#findComment-201489
Udostępnij na innych stronach

Nieaktywny
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...