ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. setVehicleComponentRotation

Function

setVehicleComponentRotation

Stores a rotation for a named part of a vehicle model in degrees (x, y, z).

Syntax

bool setVehicleComponentRotation(vehicle vehicle, string component, float x [, float y = 0, float z = 0])

Arguments

vehiclevehicle
The vehicle.
componentstring
Part name.
xfloat
Rotation around the X axis in degrees (or a vector).
yfloat, optional = 0
Rotation around the Y axis.
zfloat, optional = 0
Rotation around the Z axis.

Differences from MTA:SA

  • These MTA:SA arguments are not here: string base = "parent"

In MTA:SA

setVehicleComponentRotation(vehicle theVehicle, string theComponent, float rotX, float rotY, float rotZ, string base = "parent")

Returns

true on success.

Example

local vehicle = createVehicle(411, 2000, -1690, 13.5)
setVehicleComponentRotation(vehicle, "bonnet_dummy", 45, 0, 0)

Notes

State for scripts. The model does not change (see setVehicleComponentPosition).

See also