GetVehicleComponents: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
m (→‎Required Arguments: Wrong description.)
Line 17: Line 17:


==Example==
==Example==
TODO
<section name="Client" class="client" show="true">
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
--TODO
addCommandHandler ( "gvc",
    function ( )
        local theVehicle = getPedOccupiedVehicle ( localPlayer )
        if ( theVehicle ) then
            for k in pairs ( getVehicleComponents ( theVehicle ) ) do
                outputChatBox ( k )
            end
        end
    end
)
</syntaxhighlight>
</syntaxhighlight>
</section>


==See Also==
==See Also==
{{Client_vehicle_functions}}
{{Client_vehicle_functions}}
[[Category:Needs Example]]
[[Category:Needs Example]]

Revision as of 06:29, 3 May 2013

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