ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. setVehicleComponentVisible

Function

setVehicleComponentVisible

Server and clientVehiclesIdentical to MTA:SA

Shows or hides a named part of a vehicle model. On the server the change applies to every player ; on the client it applies to the local player only and takes priority over the server's setting. It works on the frames of a model from a file (engineReplaceModel): the author's variants (spoiler_1, extra1…), doors, bonnet, bumpers. The client-side getVehicleComponents lists the names for a given vehicle.

Syntax

bool setVehicleComponentVisible(vehicle vehicle, string component, bool visible)

Arguments

vehiclevehicle
The vehicle.
componentstring
Part (.dff frame) name, case-insensitive.
visiblebool
true = visible, false = hidden.

Returns

true on success.

Example

addCommandHandler("bezspojlera", function(player)
    local vehicle = getPedOccupiedVehicle(player)
    if vehicle then setVehicleComponentVisible(vehicle, "spoiler_1", false) end
end)

See also