M MY Multiplayer: Wiki
Side
Kind

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

NameTypeDescription
pedpedThe ped or player.
colorint|color|boolA 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.
highlightint|colorThe 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.

See also