getVehicleComponents | Multi Theft Auto: Wiki Skip to content

getVehicleComponents

Client-side
Server-side
Shared

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


This function gets a table of the components currently on a vehicle.

OOP Syntax Help! I don't understand this!

  • Method:vehicle:getComponents(...)
  • Variable: .components

Syntax

table getVehicleComponents ( vehicle theVehicle )
Required Arguments
  • theVehicle: The vehicle you wish to get the components of.

Returns

  • table: value

Returns a table containing the name of the component as the key and visibility flag of that component as the value

Code Examples

shared
addCommandHandler ( "gvc",
function ( )
local theVehicle = getPedOccupiedVehicle ( localPlayer )
if ( theVehicle ) then
for k in pairs ( getVehicleComponents ( theVehicle ) ) do
outputChatBox ( k )
end
end
end
)

See Also

Vehicle Functions