getVehicleComponentPosition | Multi Theft Auto: Wiki Skip to content

getVehicleComponentPosition

Client-side
Server-side
Shared

Pair: setVehicleComponentPosition

This page is incomplete! Help wanted!

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


This function gets the component position of a vehicle. The vehicle must be streamed in.

Syntax

getVehicleComponentPosition ( )

Code Examples

client
addCommandHandler("vcp", -- short for 'vehicle component position'
function()
local theVeh = getPedOccupiedVehicle(localPlayer)
local getComponent = getVehicleComponents(theVeh) -- returns table with all the components of the vehicle
if (theVeh) then
for k in pairs (getComponent) do
local x, y, z = getVehicleComponentPosition(theVeh, k)
outputChatBox("Position of "..k.." is"..x.." "..y.." "..z)
end
end
end
)

See Also

Vehicle Functions