Library hud

HUD library. Used for HUD specific functionality.

Functions

getChatBoxMode() Returns the current mode the chatbox is in.
getChatBoxPos() Returns the screen position of the chatbox.
getChatBoxSize() Returns the size of the chatbox.
getLinkedPlayers() Returns a list of all players that are currently linked to the current HUD instance.
getLinkedVehicle() Returns the vehicle the HUD is linked to, if it has been linked.
isChatBoxOpen() Returns true if the chatbox is currently open, false otherwise.
isLinked() Determines if the local player is linked to the HUD.
isLinkedToVehicle( vehicle ) Returns whether the given vehicle is linked to the HUD.
isPlayerLinked( ply ) Returns true if the given player is linked to the current HUD instance, false otherwise.
link() Links the chip owner to the current HUD instance.
unlink() Unlinks the chip owner/local player from the current HUD instance.
unlinkPlayer( ply ) Unlinks the given player from the current HUD instance.


Functions

hud.getChatBoxMode()
Returns the current mode the chatbox is in. If the chatbox has not yet been opened, this will return nil. This requires the READ_CHATBOX_STATE permission.

Environment:

Client
hud.getChatBoxPos()
Returns the screen position of the chatbox. If the chatbox has not yet been opened, this will return nil. This requires the READ_CHATBOX_STATE permission.

Environment:

Client

Return values:

  1. (number | nil) The x co-ordinate of the chatbox position.
  2. (number) The y co-ordinate of the chatbox position.
hud.getChatBoxSize()
Returns the size of the chatbox. If the chatbox has not yet been opened, this will return nil. This requires the READ_CHATBOX_STATE permission.

Environment:

Client

Return values:

  1. (number) The width of the chatbox.
  2. (number) The height of the chatbox.
hud.getLinkedPlayers()
Returns a list of all players that are currently linked to the current HUD instance.

Environment:

Server
hud.getLinkedVehicle()
Returns the vehicle the HUD is linked to, if it has been linked.

Environment:

Shared
hud.isChatBoxOpen()
Returns true if the chatbox is currently open, false otherwise. This requires the READ_CHATBOX_STATE permission.

Environment:

Client
hud.isLinked()
Determines if the local player is linked to the HUD.

Environment:

Client

Return value:

    (boolean) True if the local player is linked to the HUD this instance is running on.
hud.isLinkedToVehicle( vehicle )
Returns whether the given vehicle is linked to the HUD.

Environment:

Shared

Parameters:

  • vehicle: The vehicle entity to check.
hud.isPlayerLinked( ply )
Returns true if the given player is linked to the current HUD instance, false otherwise.

Environment:

Server

Parameters:

  • (Player) ply: The player to check.
hud.link()
Links the chip owner to the current HUD instance. Only works on the chip owner. Cannot link other players.

Environment:

Shared
hud.unlink()
Unlinks the chip owner/local player from the current HUD instance.

Environment:

Shared
hud.unlinkPlayer( ply )
Unlinks the given player from the current HUD instance.

Environment:

Server

Parameters:

  • (Player) ply: The player to unlink.

Valid XHTML 1.0!