For the complete documentation index, see llms.txt. This page is also available as Markdown.

Exports

PHud - Exports Documentation

This document lists all available exports for PHud and how to use them in your other scripts.

Table of Contents

  • HUD Control

  • Minimap

  • Seatbelt

  • Money

  • Voice

  • Radio

  • Status

  • Settings


HUD Control

ToggleHUD

Show or hide the complete HUD.

Usage:

Parameters:

  • state (boolean): true to show, false to hide

Usage Examples:

IsHUDVisible

Check if the HUD is currently visible.

Usage:

Returns:

  • boolean: true if visible, false if hidden


Minimap

ToggleMinimap

Show or hide the minimap.

Usage:

Parameters:

  • state (boolean): true to show, false to hide


Seatbelt

SetSeatbelt / seatbelt

Enable or disable the seatbelt.

Usage:

Parameters:

  • state (boolean): true to fasten, false to unfasten

GetSeatbelt

Check if the seatbelt is fastened.

Usage:

Returns:

  • boolean: true if fastened, false otherwise


Money

SetMoney

Update the display of cash and bank money.

Usage:

Parameters:

  • cash (number): Cash amount

  • bank (number): Bank amount

Example:


Voice

UpdateVoiceRange

Update voice range (whisper/normal/shout).

Usage:

Parameters:

  • range (number): 1 = whisper, 2 = normal, 3 = shout

UpdateTalking

Update talking state (speaking or not).

Usage:

Parameters:

  • talking (boolean): true if talking, false otherwise

UpdateVoice

Update both voice range AND talking state at once.

Usage:

Parameters:

  • range (number): 1 = whisper, 2 = normal, 3 = shout

  • talking (boolean): true if talking, false otherwise

Example with pma-voice:


Radio

SetRadioFrequency / UpdateRadio

Update the displayed radio frequency.

Usage:

Parameters:

  • frequency (number): Radio frequency (0.0 = disabled)

Example with pma-voice:


Status

SetStress

Update player's stress level.

Usage:

Parameters:

  • value (number): Stress level from 0 to 100

SetDead

Indicate if the player is dead (shows an overlay).

Usage:

Parameters:

  • state (boolean): true if dead, false if alive

Example:


Settings

OpenSettings

Open the HUD settings menu.

Usage:

Example with command:


Complete Examples

Example 1: ESX Integration

Example 2: Custom Seatbelt System

Example 3: Hide HUD During Cutscene

Example 4: Complete Radio Integration


Important Notes

  1. Client-side only: All these exports are client-side. Do not call them from the server.

  2. Resource check: If you're not sure PHud is started, check before calling:

  1. Default values: If you pass an invalid value, the HUD will use its last known value.

  2. Performance: These exports are optimized and can be called frequently without major performance impact.


Support

If you encounter any issues or have questions about using the exports, check the complete documentation in the editable/ folder for more integration examples.

Last updated