- Documentation
- Server functions
- setVehicleTurretPosition
Function
setVehicleTurretPosition
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.