M MY Multiplayer: Wiki
Side
Kind

engineRestoreTxdTexture

Client

Removes the links this resource made in a txd with engineSetTxdTexture, so it gives its own textures again.

bool engineRestoreTxdTexture(txd|string txd [, string name = nil, texture|dui|bool source = nil])

Parameters

NameTypeDescription
txdtxd|stringA txd element, a txd's name, or the same glob pattern the link was made with.
namestringOnly the links made under this name. Without it, every link of this resource in the txd.default nil
sourcetexture|dui|boolOnly the links to this source (false for the ones that hide).default nil

Returns

true if at least one link was removed, false if none matched.

Example

local lights = engineCreateTexture("images/lights.png")
engineSetTxdTexture("infernus", "vehiclelights128", lights)

addCommandHandler("stocklights", function()
    engineRestoreTxdTexture("infernus", "vehiclelights128")
end)

See also