M MY Multiplayer: Wiki
Side
Kind

engineSetElementOverlay

Client

Draws a material as an extra layer over the chosen materials of a single vehicle, ped or object.

bool engineSetElementOverlay(element element, int|string selector, material material [, int priority = 0, int order = 0])

Parameters

NameTypeDescription
elementelementA vehicle, ped, player or object.
selectorint|stringWhich material: its index from 1 or its name, as engineGetModelMaterials lists them. The name ignores case and takes the * and ? wildcards.
materialmaterialThe material drawn on top.
priorityintBreaks ties between layers of the same order: the higher priority is drawn later.default 0
orderintThe order among the layers of the same material, lowest first.default 0

Returns

true when it was applied.

Every layer that picks a material is drawn, by order and then by priority.

Example

local highlight = engineCreateMaterial("surface_emissive")
engineSetMaterialValue(highlight, "glowTint", tocolor(80, 160, 255))

local crate = createObject("trafficcone", 2490.0, -1670.0, 13.3)
engineSetElementOverlay(crate, "*", highlight)
NoteAn element that is not a vehicle, ped, player or object is an error.

See also