(C list) Sorting Clans - Most members online

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

AlexTeal03

Member
Dec 4, 2019
1
0
0
Hi, I'm currently coding a clans script and I'm stuck at this point where I want to order all my clans into the most members online.

Code:
Code:
            else if arg-1 is "list":
                set {_number} to arg-2 parsed as an integer
                clear {_online::*}
                if {_number} is not set:
                    set {_page} to 1
                    send "%{p}% &6Clans list &b(%{_page}%/undefined)"
                    loop {clan::list::*}:
                        set {_c} to loop-value
                        set {_online} to size of {clan::%{_c}%::online::*}
                        set {_total} to {_online} + size of {clan::%{_c}%::offline::*}
                        set {_i} to loop-index parsed as int
                        {_i} >= {_page} * 10 - 9 #where if {_page} is 1, all integers above 0 is valid
                        {_i} <= {_page} * 10 #where if {_page} is 1, all integers below 11 is valid
                        #meaning all integers between 1 and 10 are valid equaling to 10 results
                        #send "&c%{_c}% &b%{_online}%/%{_total}%"
                        add "&b%{_c}% &a%{_online}%/%{_total}%" to {_online2::*}
                        set {_clan::listmessage::*} to sorted {_online2::*}
                        loop {_online2::*}:
                            set {_reversed::%loop-index-2%} to last element of {_clan::listmessage::*}
                            remove {_reversed::%loop-index-2%} from {_clan::listmessage::*}
                            send "%{_reversed::%loop-index-2%}% Online"
                        clear {_online2::*}

Currently all my clans are listing in the /c list but are not being shown in order of members online.
I hope there is a way to do this, thanks :emoji_slight_smile:
[doublepost=1576023924,1575680884][/doublepost]Anyone got any ideas on this?
 
Status
Not open for further replies.