GetVehicleComponents

From Multi Theft Auto: Wiki
Revision as of 12:35, 2 January 2014 by Myonlake (talk | contribs)
Jump to navigation Jump to search

ADDED/UPDATED IN VERSION 1.3.1 r4748:

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