Player Details

FiveM Pause Menu Script

Overview

Player details allow you to display custom information about players in the pause menu. This feature is highly customizable and can show various player statistics like money, bank balance, job information, or any other server-specific data.

Customizable: You can display any player information by creating custom functions and linking them to the player details system.


1. Defining Player Details in Customize.lua

Edit the PlayerDetails section in the Customize.lua file to adjust how you want to display player details.

PlayerDetails = {
    icon = 'money.svg',  -- icon file path (resources/images/PlayerDetails)
    header = 'Money',    -- header (e.g., "Money")
    event = 'GetMoney'   -- event to be called (defined in server/function.lua)
}

Configuration Parameters

Parameter
Type
Description

icon

String

Icon filename (stored in resources/images/PlayerDetails)

header

String

Display name/title for this detail

event

String

Function name in server/function.lua to fetch the data


2. Defining the Function in server/function.lua

Add the relevant function to the server/function.lua file to define how to obtain player details on the server side.

GetMoney = function(Player, data)
    return '$ ' .. Player?.PlayerData?.money?.cash
end

Function Parameters

Parameter
Type
Description

Player

Object

Player object containing all player data

data

Object

Content of PlayerDetails (icon, header, event)

Example Functions

GetMoney = function(Player, data)
    return '$ ' .. Player?.PlayerData?.money?.cash
end

3. Multiple Player Details

You can display multiple player details by creating an array of detail objects:

PlayerDetails = {
    {
        icon = 'money.svg',
        header = 'Cash',
        event = 'GetMoney'
    },
    {
        icon = 'bank.svg',
        header = 'Bank',
        event = 'GetBank'
    },
    {
        icon = 'job.svg',
        header = 'Job',
        event = 'GetJob'
    }
}

4. Icon Customization

Icon Requirements

  • Format: SVG (recommended) or PNG

  • Size: 24x24 pixels or larger

  • Location: resources/images/PlayerDetails/

  • Style: Simple, clean icons work best

Available Default Icons

Icon Name
Purpose

money.svg

Cash/Money display

bank.svg

Bank balance

job.svg

Job information

level.svg

Player level

health.svg

Health status


5. Testing Your Customizations

After making all the adjustments, verify in-game that the information is displayed correctly.

Troubleshooting Steps

  1. Check Console: Look for any Lua errors

  2. Verify Function Names: Ensure event names match function names

  3. Test Data: Make sure the player data structure is correct

  4. Icon Paths: Verify icon files exist in the correct directory

Debugging Tip: Use print() statements in your functions to debug data values during testing.

Example Debugging Function

GetMoney = function(Player, data)
    print('Player Data:', json.encode(Player?.PlayerData))
    local cash = Player?.PlayerData?.money?.cash or 0
    print('Cash Amount:', cash)
    return '$ ' .. cash
end

Custom PagesSocial Online Time

Last updated

Was this helpful?