Exports

Client

get_visible()

Gets whether the HUD is visible.

Returns

ReturnsTypeDescription
visiblebooleanWhether the HUD is visible.

Example

client.lua
local visible = exports.rhud:get_visible()

set_visible(visible)

Sets whether the HUD is visible.

Parameters

ParameterTypeDescription
visiblebooleanWhether the HUD is visible.

Example

client.lua
exports.rhud:set_visible(true)

toggle_visible()

Toggles the visibility of the HUD.

Example

client.lua
exports.rhud:toggle_visible()

create_info(options)

Creates a custom segment to the info module.

Parameters

ParameterTypeDescription
optionsInfoOptionsThe options for the segment.

Returns

ReturnsTypeDescription
infoInfoThe info segment.

Example

client.lua
local example_info = exports.rhud:create_info({
  id = 'example_info',
  visible = true,
  label = 'Example Info',
  content = 'Example Content'
})

remove_info(id)

Removes a custom segment from the info module.

Parameters

ParameterTypeDescription
idstringThe ID of the segment to remove.

Returns

ReturnsTypeDescription
successbooleanWhether the segment was removed successfully.

Example

client.lua
local success = exports.rhud:remove_info('example_info')

get_postal()

Alternate: getPostal()
Gets the nearest postal code of the player's current location.

Returns

ReturnsTypeDescription
postalstringThe nearest postal code.

Example

client.lua
local postal = exports.rhud:get_postal()

set_indicator_seatbelt(state)

Sets the seatbelt indicator on or off.

Parameters

ParameterTypeDescription
statebooleanWhether the seatbelt indicator is on or off.

Example

client.lua
exports.rhud:set_indicator_seatbelt(true)

set_indicator_anchor(state)

Sets the anchor indicator on or off.

Parameters

ParameterTypeDescription
statebooleanWhether the anchor indicator is on or off.

Example

client.lua
exports.rhud:set_indicator_anchor(true)

Footnotes