- Documentation
- Server functions
- setVehicleTurnVelocity
Function
setVehicleTurnVelocity
Sets a vehicle's rotation speed around the x, y, z axes, e.g. to make a car spin. This is the same function as setElementAngularVelocity.
Syntax
bool setVehicleTurnVelocity(vehicle element, float x, float y, float z)Arguments
elementvehicle- The vehicle.
xfloat- Rotation speed around the X axis.
yfloat- Rotation speed around the Y axis.
zfloat- Rotation speed around the Z axis (horizontal).
Returns
true on success.
Example
addCommandHandler("bak", function(player)
local vehicle = getPedOccupiedVehicle(player)
if vehicle then setVehicleTurnVelocity(vehicle, 0, 0, 0.3) end
end)
See also
getVehicleTurnVelocityReturns a vehicle's rotation speed around the x, y, z axes. This is the same function asgetElementAngularVelocity.setElementAngularVelocitySets the element's rotation speed around the X, Y and Z axes.setElementVelocitySets the element's velocity (1 is 50 m/s). On the client it works for your own character and vehicle; on the ground the ped's animation cancels horizontal movement, vertical always works.