Players V2.0


Author: KeangDavid
Created: 2014-05-03T18:05:21-0400
Edited: 2014-12-08T01:15:49-0500
Denizen Version: 0.9.6-SNAPSHOT (build 28)
Views: 38
Downloads: 859
Likes: 1


WGET
Description: A in-game ChestUserInterface of online players.

!Redid entire script. No deleting inventories!

ToDo:
- Pages for large list of players
- More information

#Made by: KeangDavid
#Server: mc.keangdom.com
#Displayes a list of online players and extra information about them in a chest interface.
PlayersCommand:
  type: command
  name: players
  description: Shows the list of online players in a CUI
  usage: /players
  aliases:
  - listplayers
  script:
  - run PlayersTask

PlayersWorld:
  type: world
  debug: false
  events:
    on player clicks in in@PLAYERSINV:
    - if <player.has_flag[ADMIN]> narrate "Open_admin_interface"
      else execute as_player "tpa <c.item.display>"
    - determine CANCELLED
    
PlayersTask:
  type: task
  debug: false
  script:
  - ^flag global players:!
  - ^foreach <server.list_online_players.parse[name].alphanumeric> {
    - define name "<aqua>Chat_name:<blue><p@%value%.name.display>"
    - define health "<aqua>Health:<blue><p@%value%.health.as_int>"
    - define money "<aqua>Money:<blue><p@%value%.flag[coins].as_int>"
    - define world "<aqua>World:<blue><p@%value%.location.world.name>"
    - define loc "<aqua>Location:<blue><p@%value%.location.x.as_int>,<p@%value%.location.y.as_int>,<p@%value%.location.z.as_int>"
    - define lore "lore=%name%|%health%|%money%|%world%|%loc%"
    - flag global players:->:i@human_skull[display_name=%value%;%lore%;skull_skin=%value%]
    }
  - ^inventory open d:in@PLAYERSINV

PlayersINV:
  type: inventory
  inventory: CHEST
  title: 'List of online players.'
  size: 54
  slots:
   - "[<global.flag[players].get[1]||i@air>] [<global.flag[players].get[2]||i@air>]"
   - "[<global.flag[players].get[3]||i@air>] [<global.flag[players].get[4]||i@air>]"
   - "[<global.flag[players].get[5]||i@air>] [<global.flag[players].get[6]||i@air>]"
   - "[<global.flag[players].get[7]||i@air>] [<global.flag[players].get[8]||i@air>]"
   - "[<global.flag[players].get[9]||i@air>] [<global.flag[players].get[10]||i@air>]"
   - "[<global.flag[players].get[11]||i@air>] [<global.flag[players].get[12]||i@air>]"
   - "[<global.flag[players].get[13]||i@air>] [<global.flag[players].get[14]||i@air>]"
   - "[<global.flag[players].get[15]||i@air>] [<global.flag[players].get[15]||i@air>]"
   - "[<global.flag[players].get[17]||i@air>] [<global.flag[players].get[18]||i@air>]"
   - "[<global.flag[players].get[19]||i@air>] [<global.flag[players].get[20]||i@air>]"
   - "[<global.flag[players].get[21]||i@air>] [<global.flag[players].get[22]||i@air>]"
   - "[<global.flag[players].get[23]||i@air>] [<global.flag[players].get[24]||i@air>]"
   - "[<global.flag[players].get[25]||i@air>] [<global.flag[players].get[26]||i@air>]"
   - "[<global.flag[players].get[27]||i@air>] [<global.flag[players].get[28]||i@air>]"
   - "[<global.flag[players].get[29]||i@air>] [<global.flag[players].get[30]||i@air>]"
   - "[<global.flag[players].get[31]||i@air>] [<global.flag[players].get[32]||i@air>]"
   - "[<global.flag[players].get[33]||i@air>] [<global.flag[players].get[34]||i@air>]"
   - "[<global.flag[players].get[35]||i@air>] [<global.flag[players].get[36]||i@air>]"
   - "[<global.flag[players].get[37]||i@air>] [<global.flag[players].get[38]||i@air>]"
   - "[<global.flag[players].get[39]||i@air>] [<global.flag[players].get[40]||i@air>]"
   - "[<global.flag[players].get[41]||i@air>] [<global.flag[players].get[42]||i@air>]"
   - "[<global.flag[players].get[43]||i@air>] [<global.flag[players].get[44]||i@air>]"
   - "[<global.flag[players].get[45]||i@air>] [<global.flag[players].get[46]||i@air>]"
   - "[<global.flag[players].get[47]||i@air>] [<global.flag[players].get[48]||i@air>]"
   - "[<global.flag[players].get[49]||i@air>] [<global.flag[players].get[50]||i@air>]"
   - "[<global.flag[players].get[51]||i@air>] [<global.flag[players].get[52]||i@air>]"
   - "[<global.flag[players].get[53]||i@air>] [<global.flag[players].get[54]||i@air>]"




Comments
2014-05-07 17:17:39 - Krowerom:

I'm pretty new to denizen too, this is far more in depth than I have attempted so far.. however, I tried the script and it cleared my inventory, now all I have is a bar full of player heads. I must have done something wrong, somewhere.. :P looks good though!
2014-12-08 06:16:57 - KeangDavid:

Sorry about that Krowerom. More than likly was my fault. Script has been entirely redone and now uses dInvetories.