GetVehicleComponents

From Multi Theft Auto: Wiki
Revision as of 17:36, 8 July 2014 by Miki785 (talk | contribs)
Jump to navigation Jump to search

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

Syntax

table getVehicleComponents ( vehicle theVehicle )

Required Arguments

  • theVehicle: The vehicle you wish to get the components of.

Returns

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

Example

Click to collapse [-]
Client
addCommandHandler ( "gvc",
    function ( )
        local theVehicle = getPedOccupiedVehicle ( localPlayer )
        if ( theVehicle ) then
            for k in pairs ( getVehicleComponents ( theVehicle ) ) do
                outputChatBox ( k )
            end
        end
    end
)

See Also