Exports

Server

get_aop()

Gets the AOP status text.

Returns

ReturnsTypeDescription
textstringThe AOP status text.

Example

server.lua
local aop = exports.rhud:get_aop()

set_aop(text)

Sets the AOP status text.

Parameters

ParameterTypeDescription
textstringThe AOP status text.

Example

server.lua
exports.rhud:set_aop('Los Santos')

clear_aop()

Clears the AOP status text.

Example

server.lua
exports.rhud:clear_aop()

get_peacetime()

Gets whether PeaceTime is active.

Returns

ReturnsTypeDescription
activebooleanWhether PeaceTime is active.

Example

server.lua
local peacetime = exports.rhud:get_peacetime()

set_peacetime(active)

Sets whether PeaceTime is active.

Parameters

ParameterTypeDescription
activebooleanWhether PeaceTime is active.

Example

server.lua
exports.rhud:set_peacetime(true)

toggle_peacetime()

Toggles the PeaceTime status.

Example

server.lua
exports.rhud:toggle_peacetime()

get_priority()

Gets the current priority status.

Returns

ReturnsTypeDescription
status"active" | "cooldown" | "inactive" | "onhold"The priority status.

Example

server.lua
local priority = exports.rhud:get_priority()

set_priority(status, text)

Sets the current priority status.

Parameters

ParameterTypeDescription
status"active" | "cooldown" | "inactive" | "onhold"The priority status.
textstring?The priority status text.
Only used for "active" status.

Examples

server.lua
exports.rhud:set_priority('active', 'AUsername')
server.lua
exports.rhud:set_priority('inactive')

get_postal(pos)

Get the nearest postal code of the specified location.

Parameters

ParameterTypeDescription
posvector2The position to get the postal code for.

Returns

ReturnsTypeDescription
postalPostalThe nearest postal.

Example

server.lua
local pos = vector2(0, 0)
local postal = exports.rhud:get_postal(pos)
 
print('code', postal.code)
print('dist', postal.dist)

Footnotes

On this page