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

Function

setVehicleTurretPosition

ServerVehiclesIdentical to MTA:SA

Stores the turret rotation of a vehicle (Rhino tank, SWAT van, fire truck): horizontal and vertical, in radians.

Syntax

bool setVehicleTurretPosition(vehicle vehicle, float horizontal, float vertical)

Arguments

vehiclevehicle
A vehicle with a turret.
horizontalfloat
Horizontal rotation in radians.
verticalfloat
Vertical rotation in radians.

Returns

true on success.

Example

local tank = createVehicle(432, 300, 1900, 18)
setVehicleTurretPosition(tank, math.pi / 2, 0)

Notes

State for scripts. In the game the driver aims the turret and other players see it; setting it by script does not turn the turret yet.

See also