engineRestoreElementMaterial
Client
Undoes what this resource's engineSetElementMaterial did of a single vehicle, ped or object.
bool engineRestoreElementMaterial(element element [, int|string selector = nil, material material = nil])
Parameters
| Name | Type | Description |
|---|---|---|
| element | element | A vehicle, ped, player or object. |
| selector | int|string | Only what was picked with this selector (the same index or name). With material, it also takes a name a wildcard caught out of that material. Without it, everything.default nil |
| material | material | Only what was replaced with this material. Without it, any.default nil |
Returns
true if something was undone, false if there was nothing to undo.
Example
addCommandHandler("resetpaint", function()
local vehicle = getPedOccupiedVehicle(localPlayer)
if vehicle then
engineRestoreElementMaterial(vehicle)
end
end)