setVehicleComponentPosition | Multi Theft Auto: Wiki Skip to content

setVehicleComponentPosition

Client-side
Server-side
Shared

Pair: getVehicleComponentPosition

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 sets the component position of a vehicle.

Syntax

setVehicleComponentPosition ( )

Code Examples

client

Example 1:This example would set the position of the component.

addCommandHandler("scp", -- short for 'set 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) --get the position of the component
setVehicleComponentPosition(theVeh, k, x+1, y+1, z+1) -- increases by 1 unit
end
end
end
)

See Also

Vehicle Functions