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
| Name | Type | Description |
|---|---|---|
| element | vehicle|object | The vehicle or object. |
| component | string | The component's name, as getElementComponents lists it. |
| visible | bool | true 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)
endComing from MTAThe same as MTA's
setVehicleComponentVisible, but it also works on objects.