GetVehicleComponents: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 1: Line 1:
__NOTOC__
__NOTOC__
{{Client function}}
{{Client function}}
{{Needs_Example}}
{{New feature/item|4.0140|1.3.1|4748|
{{New feature/item|4.0140|1.3.1|4748|
This function gets a table of the components currently on a [[vehicle]].
This function gets a table of the components currently on a [[vehicle]].

Revision as of 12:35, 2 January 2014

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