Custom Info
The Info HUD module can be customized to include custom segments using the create_info client-side export.
Basic Usage
The create_info function takes InfoOptions object as an argument, and returns an Info object.
Examples
Basic Example: Server ID
Let's create an info segment that displays the player's server ID.
![]()
We can also use HTML in the content property to display the server ID in a different color.
![]()
Advanced Example: QBCore Money
We can use QBCore's QBCore:Player:SetPlayerData event to listen for changes in the player's data an update the info segment accordingly, and use a server-side event to request the money data when the resource starts so that restarting the resource doesn't require the player to rejoin the server.
The UPDATE_EVENT and REQUEST_EVENT variables are just string constants that you can define to your liking.

Advanced Example: ESX Money
Similarly to QBCore, we can use ESX's esx:setAccountMoney event to listen for changes in the player's money and update the info segment accordingly. We can also use a server-side event to request the money data when the resource starts.
In this example, we are also utilizing the Info object's update_label function.

Advanced Example: Re-Create Location Info
In this example, we will re-create the location info segment by utilizing the style property of the InfoOptions object to add custom CSS styles, and the update_content function of the returned Info object to update the content of the info segment. The wrap property is set to false to prevent the info segment from using its default CSS styles.

Footnotes
- Type definitions that can be used with the Lua extension in VSCode are available on the public GitHub repository.