M MY Multiplayer: Wiki
Side
Kind

setElementComponentVisible

Client

Shows or hides a vehicle's or object's component. The change applies on this client only.

bool setElementComponentVisible(vehicle|object element, string component, bool visible)

Parameters

NameTypeDescription
elementvehicle|objectThe vehicle or object.
componentstringThe component's name, as getElementComponents lists it.
visiblebooltrue to show it, false to hide it.

Returns

true if it was changed, false if the component does not exist.

The choice is kept while the element exists, and comes back when it streams in again.

Example

local vehicle = getPedOccupiedVehicle(localPlayer)
if vehicle then
    setElementComponentVisible(vehicle, "bonnet_dummy", false)
end
Coming from MTAThe same as MTA's setVehicleComponentVisible, but it also works on objects.

See also