Function getPlayerNameFromId

Get the player id from a player name (if it exists)

the id of the player

Pass "throw" to throw an error if the player is not found, or "return-null" to return null

the player id if the player exists, or handles according to onMissing

  • Get the player id from a player name

    Parameters

    • id: number

      the id of the player

    • OptionalonMissing: "throw"

      Pass "throw" or omit to throw an error if the player is not found

    Returns string

    the player id, or throws if no such player exists

  • Get the player id from a player name (if it exists)

    Parameters

    • id: number

      the id of the player

    • onMissing: "throw" | "return-null"

      Pass "throw" to throw an error if the player is not found, or "return-null" to return null *

    Returns string | null

    the player id, or null if no such player exists