Skocz do zawartości
  • 0

Skrypt na topkę ranku


lie_pan1

Pytanie

5 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0
function createTop(name: string, size: integer, format: string="[P] - [V]") :: strings:
    set {_indices::*} to indexes of {%{_name}%::*}
    set {_index} to 1
    if {_size} = 0:
        return ""
    if {_size} < 0:
        set {_reversed} to true
        set {_size} to ({_size} * (-1))
    loop {_indices::*}:
        if {%{_name}%::%loop-value%} = number or timespan or date:
            set {_values::%{_index}%} to {%{_name}%::%loop-value%}
            set {_indexes::%{_index}%} to "%loop-value%"
            add 1 to {_index}
    if {_size} > (size of {_indexes::*}):
        set {_size} to (size of {_indexes::*})
    loop {_size} times:
        loop {_values::*}:
            if {_max} is not set:
                set {_max} to loop-value-2
                set {_index} to loop-index
            else:
                if {_reversed} is not true:
                    if loop-value-2 > {_max}:
                        set {_max} to loop-value-2
                        set {_index} to loop-index
                else:
                    if loop-value-2 < {_max}:
                        set {_max} to loop-value-2
                        set {_index} to loop-index
        set {_var} to {_format}
        replace "[VALUE]" and "[V]" with "%{_max}%" in {_var}
        replace "[INDEX]" and "[I]" with "%loop-number%" in {_var}
        replace "[PLAYER]" and "[P]" with {_indexes::%{_index}%} in {_var}
        add {_var} to {_return::*}
        delete {_indexes::%{_index}%}, {_values::%{_index}%}, {_max} and {_index}
    return {_return::*}

every 5 second:
    set {_list::*} to createTop("rank", 3, "&e[I]. &6[P] &7[V]")
    set all players's tab list header to (join {_list::*} with "%nl%")

 

Odnośnik do komentarza
Udostępnij na innych stronach

Dołącz do dyskusji

Możesz dodać zawartość już teraz a zarejestrować się później. Jeśli posiadasz już konto, zaloguj się aby dodać zawartość za jego pomocą.

Nieaktywny
Odpowiedz na pytanie...

×   Wklejono zawartość z formatowaniem.   Usuń formatowanie

  Dozwolonych jest tylko 75 emoji.

×   Odnośnik został automatycznie osadzony.   Przywróć wyświetlanie jako odnośnik

×   Przywrócono poprzednią zawartość.   Wyczyść edytor

×   Nie możesz bezpośrednio wkleić grafiki. Dodaj lub załącz grafiki z adresu URL.

  • Ostatnio przeglądający   0 użytkowników

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