Ped::getHeadOverlayNum: Difference between revisions

From RAGE Multiplayer Wiki
(Created page with " {{ClientsideJsFunction}} {{JSContainer| ===Required Params=== *'''overlayID:''' {{RageType|number}} ===Return value=== *''' {{RageType|number}} ''' ==Syntax== <syntaxhighlight lang="javascript"> mp.game.ped.getHeadOverlayNum(overlayID) </syntaxhighlight> ==Example== <syntaxhighlight lang="javascript"> //todo </syntaxhighlight> }} ==See also== {{Ped_s_function_c}} Category:Clientside API Category:TODO: Example")
 
No edit summary
 
Line 1: Line 1:
{{ClientsideJsFunction}}
{{ClientsideJsFunction}}
{{JSContainer|
{{JSContainer|


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.


===Required Params===
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.
*'''overlayID:''' {{RageType|number}}


===Return value===
=== Required Params ===
*''' {{RageType|number}} '''
* '''overlayID:''' {{RageType|number}} – The ID representing a specific head overlay component (e.g., 0 for blemishes, 1 for facial hair).


==Syntax==
=== Return Value ===
* '''{{RageType|number}}''' – Returns the number of available variations for the specified head overlay component.
 
== Syntax ==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
mp.game.ped.getHeadOverlayNum(overlayID)
mp.game.ped.getHeadOverlayNum(overlayID)
</syntaxhighlight>
</syntaxhighlight>


==Example==
== Example ==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
//todo
// 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}`);
</syntaxhighlight>
</syntaxhighlight>
}}
}}
==See also==
== See Also ==
{{Ped_s_function_c}}
{{Ped_s_function_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:TODO: Example]]
[[Category:TODO: Example]]

Latest revision as of 09:27, 2 November 2024

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