isGM: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
No edit summary
m (Conversion script moved page isGM to IsGM without leaving a redirect: Converting page title to first-letter uppercase)
(No difference)

Revision as of 22:18, 9 February 2023

isGM() Function

Introduced in version 1.3b48
Returns true(1) if the player is a GM or false(0) if they are not.

Usage

isGM()
isGM(player)

Parameters

  • player - player's name as a string to check if he is a GM or not.

Examples

1. Test to see if current player is a GM.
I am a [r,if(isGM()): "GM"; "Player"]


2. Display a list of GMs.

[H: allPlayers = getAllPlayerNames("json")]
[H: GMList = "[]"]
[H: foreach(player,allPlayers), code: {
   [H, if(isGM(player)): GMList = json.append(GMList,player)]
}]
[R, if(! json.isEmpty(GMList)): "GM List: " + json.toList(GMList); "No players are listed as GM"]

Version Changes

  • b91 - Added player parameter