setPedHairColor
Shared
Tints a ped's hair and, if you want, its highlights.
bool setPedHairColor(ped ped, int|color|bool color [, int|color highlight = nil])
Parameters
| Name | Type | Description |
|---|---|---|
| ped | ped | The ped or player. |
| color | int|color|bool | A palette row (integer from 0 to 63) on its own, three numbers r, g, b or a tocolor value. false goes back to the hair's default colour. |
| highlight | int|color | The highlights' colour, in the same form. Without it, the hair has no highlights.default nil |
Returns
true if it changed, false if it is not a ped.
On the server, the change is sent to every client. On the client, it applies to this client only.
Example
addCommandHandler("cabelo", function(player, command, row, highlight)
setPedHairColor(player, tonumber(row) or 0, tonumber(highlight))
end)Coming from MTAMTA does not have this function. It follows FiveM's
SetPedHairColor.NoteThree numbers in a row are read as
r, g, b. For a palette row followed by highlights, give the highlights as a row or as tocolor.