player.getConnectedPlayers: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Conversion script moved page player.getConnectedPlayers to Player.getConnectedPlayers without leaving a redirect: Converting page title to first-letter uppercase)
m (Conversion script moved page Player.getConnectedPlayers to player.getConnectedPlayers: Converting page titles to lowercase)
 
(No difference)

Latest revision as of 23:45, 9 February 2023

 Note: This refers to a proposed change that has not been implemented in the main code base yet.

player.getConnectedPlayers() Function

 Note: This function can only be used in a Trusted Macro

Introduced in version 1.10.0
Last checked for compatibility with version 1.10.0
Returns information about all connected players in the Player Database as an array of JSON objects.

Usage

player.getConnectedPlayers() - Get info on all connected players.

Parameters

  • none - none

Example

Outputs all players in database.
<pre>[r: json.indent(player.getConnectedPlayers(),2)]</pre>

Returns:

[
    {
    "name": "George",
    "role": "PLAYER",
    "connected": false
  },
    {
    "name": "Player",
    "role": "PLAYER",
    "connected": true
  },
    {
    "name": "Ringo",
    "role": "PLAYER",
    "connected": false
  },
    {
    "name": "GM",
    "role": "GM",
    "connected": true
  },
    {
    "name": "John",
    "role": "PLAYER",
    "connected": false
  },
    {
    "name": "Paul",
    "role": "PLAYER",
    "connected": false
  }
]

See Also

Version Changes

  • 1.10.0 - First added.