Client: FiveM Canary
Version: 1182460
Server: FXServer-master v1.0.0.4947 linux
I’m trying to write a script to control the AWD car’s wheel speed, I tried this, but it looks like not working.
local wheelPower
Citizen.CreateThread(function()
local vehicle = nil
while true do
Wait(0)
vehicle = GetVehiclePedIsIn(PlayerPedId(), false)
SetVehicleWheelRotationSpeed(vehicle, 0, -30.0)
SetVehicleWheelPower(vehicle, 0, 1.0)
wheelPower = GetVehicleWheelPower(vehicle, 0)
end
end)
RegisterCommand("test", function(source, args, rawCmd)
print(wheelPower)
end, false)
When I type the /test
command, it will always print 0
.
The wheel only rotation when it is floating, it will stop if it touches the road.