Player::setHeadOverlay: Difference between revisions

From RAGE Multiplayer Wiki
No edit summary
m (updated max makeup volume)
 
(9 intermediate revisions by 5 users not shown)
Line 1: Line 1:
OverlayID ranges from 0 to 12, index from 0 to _GET_NUM_OVERLAY_VALUES(overlayID)-1, and opacity from 0.0 to 1.0. <br><br>overlayID      Part                  Index, to disable<br>0              Blemishes            0 - 23, 255<br>1              Facial Hair          0 - 28, 255<br>2              Eyebrows              0 - 33, 255<br>3              Ageing                0 - 14, 255<br>4              Makeup                0 - 74, 255<br>5              Blush                0 - 6, 255<br>6              Complexion            0 - 11, 255<br>7              Sun Damage            0 - 10, 255<br>8              Lipstick              0 - 9, 255<br>9              Moles/Freckles        0 - 17, 255<br>10              Chest Hair            0 - 16, 255<br>11              Body Blemishes        0 - 11, 255<br>12              Add Body Blemishes    0 - 1, 255
OverlayID ranges from 0 to 12, index from 0 to _GET_NUM_OVERLAY_VALUES(overlayID)-1, and opacity from 0.0 to 1.0.<br>
 
First and second color you can take in the list of hair colors.<br>
List of colors: https://wiki.rage.mp/wiki/Makeup_Colors
<br>
{| class="wikitable"
{| class="wikitable"


Line 6: Line 8:
| Part                   
| Part                   
| Index
| Index
|-


| 0
| 0
|
| Blemishes   
|
| 0-23
|-


| 1
| 1
|
| Facial Hair
|
| 0-28 
|-


| 2
| 2
|
| Eyebrows 
|
| 0-33
|-


| 3
| 3
|
| Ageing
|
| 0-14
|-


| 4
| 4
|
| Makeup
|
| 0-94
|-


| 5
| 5
|
| Blush
|
| 0-32
|-


| 6
| 6
|
| Complexion
|
| 0-11
|-


| 7
| 7
|
| Sun Damage
|
| 0-10
|-


| 8
| 8
|
| Lipstick
|
| 0-9
|-




| 9
| 9
|
| Moles/Freckles
|
| 0-17
|-




| 10
| 10
|
| Chest Hair
|
| 0-16
|-




| 11
| 11
|
| Body Blemishes
|
| 0-11
|-
 
| 12
| Add Body Blemishes
| 0-1
|-


|}
|}


<b>To disable any overlay use 255 as OverlayID.</b>
<b>To disable any overlay use 255 as index.</b>


==Syntax==
==Syntax==
Line 66: Line 86:
<pre>
<pre>
player.setHeadOverlay(overlayID, index, opacity, firstColor, secondColor);
player.setHeadOverlay(overlayID, index, opacity, firstColor, secondColor);
// The variation of this function for peds (mp.peds) does not take values to set the overlay color. It uses the syntax used in the native.
ped.setHeadOverlay(overlayID, index, opacity);
</pre>
</pre>
}}
}}
Line 85: Line 108:


==Example==
==Example==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="cs">
// todo
C# Serverside Example
 
private static readonly string[] headOverlayNames = { "blemishes", "facialHair", "eyebrows", "ageing", "makeup", "blush", "complexion", "sunDamage", "lipstick", "molesFreckles", "chestHair", "bodyBlemishes", "addBodyBlemishes" };
 
private static HeadOverlay CreateHeadOverlay(Byte index, Byte color, Byte secondaryColor, float opacity)
{
    return new HeadOverlay
    {
      Index = index,
      Color = color,
      SecondaryColor = secondaryColor,
      Opacity = opacity
    };
}
 
[Command("beard")]
public void Beard(Client c, byte Index, byte Color, byte SeconardyColor, byte Opacity)
{
    Dictionary<int, HeadOverlay> headOverlays = new Dictionary<int, HeadOverlay>();
    headOverlays.Add(1, CreateHeadOverlay((byte)Index, (byte)Color, (byte)SeconardyColor, (byte)Opacity));
    c.SetHeadOverlay(1, headOverlays[1]);
}
 
Testexamples use Command:
beard 1 0 0 1 = Set beard 1 with PrimaryColor 0 SecondardyColor 0 and opacity 1 (use opacity 0 for invisible, 1 for full visible)
beard 2 22 0 1 = Set beard 1 with PrimaryColor 22(red) SecondardyColor 0 and opacity 1 (use opacity 0 for invisible, 1 for full visible)
Restriction: Command can just handle 0, 1 on opacity but it is a byte and can have a value from 0.0 - 1.0
 
 
 
</syntaxhighlight>
</syntaxhighlight>
==See also==
==See also==
{{Player_function_c}}
{{Player_function_c}}

Latest revision as of 12:23, 2 June 2026

OverlayID ranges from 0 to 12, index from 0 to _GET_NUM_OVERLAY_VALUES(overlayID)-1, and opacity from 0.0 to 1.0.
First and second color you can take in the list of hair colors.
List of colors: https://wiki.rage.mp/wiki/Makeup_Colors

OverlayID Part Index
0 Blemishes 0-23
1 Facial Hair 0-28
2 Eyebrows 0-33
3 Ageing 0-14
4 Makeup 0-94
5 Blush 0-32
6 Complexion 0-11
7 Sun Damage 0-10
8 Lipstick 0-9
9 Moles/Freckles 0-17
10 Chest Hair 0-16
11 Body Blemishes 0-11
12 Add Body Blemishes 0-1

To disable any overlay use 255 as index.

Syntax

Client-Side
player.setHeadOverlay(overlayID, index, opacity, firstColor, secondColor);

// The variation of this function for peds (mp.peds) does not take values to set the overlay color. It uses the syntax used in the native.
ped.setHeadOverlay(overlayID, index, opacity);


Server-Side
player.setHeadOverlay(overlayID, [index, opacity, firstColor, secondColor]);

Required Arguments

  • overlayID: int
  • index: int
  • opacity: float
  • firstColor: int
  • secondColor: int

Return value

  • Undefined

Example

C# Serverside Example

 private static readonly string[] headOverlayNames = { "blemishes", "facialHair", "eyebrows", "ageing", "makeup", "blush", "complexion", "sunDamage", "lipstick", "molesFreckles", "chestHair", "bodyBlemishes", "addBodyBlemishes" };

private static HeadOverlay CreateHeadOverlay(Byte index, Byte color, Byte secondaryColor, float opacity)
{
    return new HeadOverlay
    {
       Index = index,
       Color = color,
       SecondaryColor = secondaryColor,
       Opacity = opacity
    };
}

[Command("beard")]
public void Beard(Client c, byte Index, byte Color, byte SeconardyColor, byte Opacity)
{
    Dictionary<int, HeadOverlay> headOverlays = new Dictionary<int, HeadOverlay>();
    headOverlays.Add(1, CreateHeadOverlay((byte)Index, (byte)Color, (byte)SeconardyColor, (byte)Opacity));
    c.SetHeadOverlay(1, headOverlays[1]);
}

Testexamples use Command:
beard 1 0 0 1 = Set beard 1 with PrimaryColor 0 SecondardyColor 0 and opacity 1 (use opacity 0 for invisible, 1 for full visible)
beard 2 22 0 1 = Set beard 1 with PrimaryColor 22(red) SecondardyColor 0 and opacity 1 (use opacity 0 for invisible, 1 for full visible)
Restriction: Command can just handle 0, 1 on opacity but it is a byte and can have a value from 0.0 - 1.0

See also