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

Function

getVehicleComponents

Server and clientVehiclesIdentical to MTA:SA

Returns a vehicle model's parts as a table of name → visible. On the client, for a model from a file (engineReplaceModel) it is the full list of .dff frames (body, doors, bonnet, bumpers, wheel_*_dummy wheels, the author's variants); for game cars only parts changed by script. On the server only parts changed by script.

Syntax

table getVehicleComponents(vehicle vehicle)

Arguments

vehiclevehicle
The vehicle.

Returns

A table { [name] = bool }.

Example

addCommandHandler("czesci", function()
    local vehicle = getPedOccupiedVehicle(localPlayer)
    if not vehicle then return end
    for name, visible in pairs(getVehicleComponents(vehicle)) do
        outputChatBox(name .. (visible and "" or " (ukryta)"))
    end
end)

See also