Player HUD

Step-by-step installation guide, common issues & solutions, code snippets, error codes, config previews, locales previews, SQL previews, and changelogs; all in 1 easily accessible place.

Buy Here

FiveM Forums Post

YouTube Showcase Video

This resource can be purchased as part of a bundle for a discount here.

Translate

INSTALLATION GUIDE

Step 0 - First Steps

Step 1 - Fxmanifest

Step 2 - Configure Resource

Step 3 - SQL Database

Step 4 - Configure Key Binds

Step 4 - Basic Needs & Status

Basic Needs

Do you want to use the built-in basic needs system (hunger & thirst)?

No? Then set the Config.BasicNeeds.ENABLE in the config.lua to false.

Yes? Then set the Config.BasicNeeds.ENABLE in the config.lua to true and configure the Config.BasicNeeds config options. You must also add your usable food & drink items to the Config.BasicNeeds.Items config table.

Do you want to save hunger & thirst in the database?

No? Then set the Config.BasicNeeds.save_in_database in the config.lua to false.

Yes? Then set the Config.BasicNeeds.save_in_database in the config.lua to true and import the SQL file which is located inside theREAD_ME_AFTER_PURCHASING folder, the file is named SQL_main.sql. Watch this video if you are unsure how to do this HeidiSQL / PHPMyAdmin.

Stress

Do you want to use the built-in stress system?

No? Then set the Config.Stress.ENABLE in the config.lua to false.

Yes? Then set the Config.Stress.ENABLE in the config.lua to true and configure the Config.Stress config options.

Do you want to save stress in the database?

No? Then set the Config.Stress.save_in_database in the config.lua to false.

Yes? Then set the Config.Stress.save_in_database in the config.lua to true and import the SQL file which is located inside theREAD_ME_AFTER_PURCHASING folder, the file is named SQL_main.sql. Watch this video if you are unsure how to do this HeidiSQL / PHPMyAdmin.

Create your own apps

Tips for creating Your own app screens

The position in the screens.list array determines the order of displaying the screens. Do not change screens.current unless you want a different screen to display first (screens.current goes from 0 to screens.list.length-1)

Currently, the screens.list.name value has no use; however, it is reserved for future use, such as setting options for certain apps. // The screens.list.id is the id of the element containing the app screen. It will be displayed once it is cycled.

To make your app functional you would either need to create another JavaScript file and include it through the HTML or add inline JavaScript to the index.html file itself.

To place the screen in the correct position, use the .app-screen class on your HTML element.

The existing apps are not editable; however, you can change their order if you wish.

INFORMATION

Default Key Binds

These keys can be modified and/or disabled in the Keys and Commands section of the [configs/config.lua].

Please make sure you understand how Key Mapping works.

Key

Description

I

Toggle the watch UI.

K

Toggle move mode.

Right Click

Disable move mode.

Left / Right Arrows

Cycle through the screens.

Chat Commands

These chat commands can be renamed and/or disabled in the Keys and Commands section of the [configs/config.lua].

The exact usage for each command will be displayed in the chat suggestions when using the commands in-game.

Command

Description

/watchhud

Toggle the watch UI.

/resetstatus

(Staff Only) Reset a player's hunger, thirst, stress, and oxygen stats.

Events

These events are completely optional; you can use them if needed.Here is some information about this event.

Event Name

Description

Event Type

TriggerEvent('cd_playerhud:status:add', Status_Type, Amount)

Add a status to a player.

client

What does Status_Type and Amount mean?

Status_Type (string)

Amount (number)

'hunger'

0 - 100 (0 is empty and 100 is full)

'thirst'

0 - 100 (0 is empty and 100 is full)

'stress

0 - 100 (0 is empty and 100 is full)

'oxygen'

0 - ∞ (You can add any amount, this is to support the use of diving gear, etc. But be sure to set a player's oxygen back to the maximum default value of 30 when the diving gear has been removed)

Do you need an example?

The example below will add 20 'hunger' to a player when being triggered from the client-side to the client-side.

TriggerEvent('cd_playerhud:status:add', 'hunger', 20)

The example below will add 20 'hunger' to a player when being triggered from the server-side to the client-side.

TriggerClientEvent('cd_playerhud:status:add', source, 'hunger', 20)

Exports

These exports are completely optional; you can use them if needed.

Get Status

Returns the hunger, thirst, stress, and oxygen stats (table).
exports['cd_playerhud']:GetStatus()

COMMON ISSUES

Please check out our Troubleshooting Guide before contacting our support.

🔔 Folder Name Make sure the name of the folder is cd_playerhud.

🔔 Encrypted Files Do not edit the encrypted files in any way.

Money/Hunger etc is not being updated on the UI?

eg., if certain things like your hunger/thirst/stress/money are not being updated, that most likely means your framework has renamed the events.

✔️ We can not directly offer support with this, we create compatibility for default versions of frameworks. But what you need to do is change the event names in the client_customise_me.lua to the ones that currently work for your framework.

ERROR CODES

If you see an error code not listed below, please open a script support ticket in the Codesign Discord.

N/A

CHANGELOG

Files Changed

Not every update requires you to replace the whole folder. We do this because we understand it's a pain to redo the configs for every update.

  • All Files - This means you should delete your old cd_playerhud folder, download and add in the latest version, reconfigure the configs folder and restart your server.

  • All Files Except config.lua - This means you should do all of the above (in the All Files section) but additionally make a backup of the config.lua file and replace the new config.lua file with the one you made a backup of.

  • Specific Files - This means you can copy and paste the SPECIFIC new files over the old ones and restart the server.

Update Type

On rare occasions, you are forced to update to the latest version. Mostly due to authentication updates where the old versions will no longer work.

  • Mandatory - This means you MUST update to this new version, or the old versions will no longer work.

  • Optional - This means it's completely your choice whether you wish to update to the latest version. But we do not offer support for old versions for obvious reasons; they are old.

26/12/2020 - 10/08/2021

v3.0.0 - v3.1.1

Files Changed:

Update Type:

Changelog:

Edit

  • Changed disable move mode to right click instead of K.

  • Updated the codesign error handlers.

  • Allowed the stress value to be changed even tho config.stress is disabled.

  • Added the oxygen (in water) to the GetStatus() export.

  • Re-wrote and updated parts of the code.

  • Reworked the logic behind getting a players money to be far more optimized so it does not need to get the data from the server-side anymore.

Last updated

Was this helpful?