M MY Multiplayer: Wiki
Side
Kind

engineSetElementTexture

Client

Swaps a texture on one vehicle, ped, player or object alone. Other instances of the same model keep their textures.

bool engineSetElementTexture(element element, string name, texture|dui|bool source [, int priority = 0])

Parameters

NameTypeDescription
elementelementThe vehicle, ped, player or object.
namestringThe texture name its materials use, or a glob pattern.
sourcetexture|dui|boolA texture, a dui, or false to hide the texture.
priorityintAmong several swaps for the same texture, the highest priority answers; among equals, the newest.default 0

Returns

true once the swap is set. Raises an error if the element is not a vehicle, ped, player or object, or the source is not an image or false.

The swap is kept while the element lives, whether it is streamed in or out. An element's swaps answer before the model's (engineSetModelTexture) and the world's (engineSetWorldTexture).

Example

local vehicle = createVehicle("infernus", 1544.0, -1675.0, 13.6)
local lights = engineCreateTexture("images/lights.png")
engineSetElementTexture(vehicle, "vehiclelights128", lights)

See also