setPedOverlay
Shared
Puts an overlay on a ped's face or takes it off, such as a beard, eyebrows or make-up.
bool setPedOverlay(ped ped, string name [, int|bool variation = 0, float opacity = 1])
Parameters
| Name | Type | Description |
|---|---|---|
| ped | ped | The ped or player. |
| name | string | The overlay's name, as the ped's head declares it. Case does not matter. |
| variation | int|bool | The overlay's variant, from 0 to 255, or false to remove it.default 0 |
| opacity | float | Opacity, from 0 to 1. Not used with false.default 1 |
Returns
true if it changed, false when asked to remove an overlay the ped does not wear. Raises an error if the name is over 32 characters, the variant is outside 0 to 255 or the opacity is outside 0 to 1.
On the server, the change is sent to every client. On the client, it applies to this client only.
Example
addCommandHandler("barba", function(player, command, variation)
if variation then
setPedOverlay(player, "beard", tonumber(variation), 0.9)
else
setPedOverlay(player, "beard", false)
end
end)Coming from MTAMTA does not have this function. It follows FiveM's
SetPedHeadOverlay.NoteA ped wears up to 64 overlays. Past that, a new one raises the same bad argument error.