1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

List command bug,error /list skript

Discussion in 'Skript' started by AkroDogy2005, Jan 1, 2019.

Thread Status:
Not open for further replies.
  1. AkroDogy2005

    AkroDogy2005 Member

    Joined:
    Apr 20, 2018
    Messages:
    18
    Likes Received:
    1
    Hey i have this skript:
    Code (Skript):
    1. command /list:
    2.     aliases: /who
    3.     trigger:
    4.         if player is op:
    5.             message "&7>&8&l&m--------------------------------------&7<"
    6.             message ""
    7.             set {_amountplayers} to amount of players
    8.             message "&8&7(&e!&7) &fOnline players: &e%{_amountplayers}%&f/&e200"
    9.             loop all players:
    10.                 if loop-player has permission "akrolist.staff":
    11.                     add loop-player to {_online staff::*}
    12.                     message "&8&7(&e!&7) &fStaff: &e%{_online staff::*}%"
    13.                 if loop-player has permission "akrolist.donor":
    14.                     add loop-player to {_online donor::*}
    15.                     message "&8&7(&e!&7) &fDonors: &e%{_online donor::*}%"
    16.             message ""
    17.             message "&7>&8&l&m--------------------------------------&7<"
    All it's good with 1 player (Proof» http://prntscr.com/m1vn1i)
    But with 2 player i have this bug (Proof» http://prntscr.com/m1vn6x)

    1. If isn't staff/donors online, in console it's disapear Staff and Donor lines, how can i resolve this? ( Proof» http://prntscr.com/m1vnr7)
    2. How can i make a command which to make more lines: ex: I want donor line, staff line, and noob line without to open the skript file and edit.
    Online players: 0
    Staff: 0
    Donors: 0
    Noobs: AkroDogy (if the player has permission using a command to set it ex:akrolist.noob ingame: /setpermision noobs akrolist.noob)
    3. If isn't staff/donors online, how can i do in /list command to be Staff: 0,Donor: 0?
     
  2. TPGamesNL

    Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,501
    Likes Received:
    107
    Medals:
    You should message after the loop
     
  3. AkroDogy2005

    AkroDogy2005 Member

    Joined:
    Apr 20, 2018
    Messages:
    18
    Likes Received:
    1
    can you write a example pls?
     
  4. TPGamesNL

    Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,501
    Likes Received:
    107
    Medals:
    No im not going to spoonfeed you. just move the message "online donor stuff" to somewhere after the loop
     
  5. AkroDogy2005

    AkroDogy2005 Member

    Joined:
    Apr 20, 2018
    Messages:
    18
    Likes Received:
    1
    i don t understand...
     
  6. TPGamesNL

    Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,501
    Likes Received:
    107
    Medals:
    what part of it dont you understand
     
  7. AkroDogy2005

    AkroDogy2005 Member

    Joined:
    Apr 20, 2018
    Messages:
    18
    Likes Received:
    1
    i did something, but donors and staff leave the game, in console disapear staff and donor line proof:http://prntscr.com/m1xmnx
    New code
    Code (Skript):
    1. command /list:
    2.     aliases: /who
    3.     trigger:
    4.         if player is op:
    5.             message "&7>&8&l&m--------------------------------------&7<"
    6.             message ""
    7.             set {_amountplayers} to amount of players
    8.             message "&8&7(&e!&7) &fOnline players: &e%{_amountplayers}%&f/&e200"
    9.             loop all players:
    10.                 if loop-player has permission "akrolist.staff":
    11.                     add loop-player to {_online staff::*}
    12.                     if size of {_online staff::*} = 0:
    13.                         set {_online staff::*} to 0
    14.                 if loop-player has permission "akrolist.donor":
    15.                     add loop-player to {_online donor::*}
    16.                     if size of {_online donor::*} = 0:
    17.                         set {_online donor::*} to 0
    18.             message "&8» &fStaff: &e%{_online staff::*}%"
    19.             message "&8» &fDonors: &e%{_online donor::*}%"
    20.             message ""
    21.             message "&7>&8&l&m--------------------------------------&7<"
     
    #7 AkroDogy2005, Jan 1, 2019
    Last edited: Jan 1, 2019
Thread Status:
Not open for further replies.

Share This Page

Loading...