Ped::getHeadOverlayNum

From RAGE Multiplayer Wiki
Revision as of 09:27, 2 November 2024 by Shr0x (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Client-Side
Function

 JavaScript



JavaScript Syntax


The `getHeadOverlayNum` function retrieves the number of available variations for a specified head overlay component on a pedestrian (ped). In GTA V and RAGEMP, "head overlays" refer to customizable facial features such as blemishes, facial hair, or makeup. By providing the `overlayID`, you can determine the number of available styles for a given overlay, allowing for more precise character customization options in your script.

This function is particularly useful in character creation systems where you need to cycle through different overlay styles (e.g., beard types, makeup options) based on the player's selection.

Required Params

  • overlayID: number – The ID representing a specific head overlay component (e.g., 0 for blemishes, 1 for facial hair).

Return Value

  • 'number' – Returns the number of available variations for the specified head overlay component.

Syntax

mp.game.ped.getHeadOverlayNum(overlayID)

Example

// Example usage of getHeadOverlayNum

const overlayID = 1; // Facial hair overlay ID

// Get the number of available facial hair styles
const numFacialHairStyles = mp.game.ped.getHeadOverlayNum(overlayID);

// Output the number to chat for confirmation
mp.gui.chat.push(`Number of facial hair styles available: ${numFacialHairStyles}`);


See Also