Class Server.XPlayer

Extends: Server.DBSC

Fields

identifier: string
Visibility: public
the identifier of the player
joined: string
Visibility: public
the timestamp when the player joined
last_seen: string
Visibility: public
the timestamp when the player was last seen
current_character: Server.XCharacter?
Visibility: public
the character this player is currently playing
hPlayer: HPlayer?
Visibility: public
the connected HELIX player

Methods

new(identifier: string): Server.XPlayer
Creates a new player instance.
Parameters:
  • identifier (string): The identifier of the player.
Returns: xPlayer The new player instance.
connected()
This function will be called when a player connected to the server. It will set the last seen timestamp to the current time and call the onJoin function.
onJoin()
This function will be called when a player joins the server, or unloads his current character.
loadCharacter(citizenId: string): boolean
Note: @nodiscard - Return value should not be ignored
Sets the character this player is currently playing.
Parameters:
  • citizenId (string): the citizen ID of the character to load
Returns: success Whether the character was successfully loaded.