Jump to content

[HELP]Rotate Object Problem


DeiwnEdits

Recommended Posts

Hi guys , I have problem

I want rotate "steer" object . (Example : İf steering angle 65 , rotate object 650 degree) but has errors;

" 'then' expected near '=' "

Thanks for help. (and sorry for my bad eng)

Function;

function steeringwheel()
local theVeh = getPedOccupiedVehicle(localPlayer)    
    if getVehicleComponentRotation = handlingGetSteeringLock then
        local rotX, rotY, rotZ = getElementRotation(theVeh, "steer")    
        setElementRotation(theVeh,"steer"rotX,rotY,rotX*10)
        end
    end
end
addEventHandler("onClientRender", root, steeringwheel)

 

Edited by Naruto Edits
Link to comment
  • Scripting Moderators
if getVehicleComponentRotation = handlingGetSteeringLock then

To

if getVehicleComponentRotation == handlingGetSteeringLock then

But, your code still seems to be incorrect logically.

Edited by thisdp
Link to comment
function steeringwheel()
local theVeh = getPedOccupiedVehicle(localPlayer)    
    if getVehicleComponentRotation == handlingGetSteeringLock then
        local rotX, rotY, rotZ = getVehicleComponentRotation (theVeh, "steer" )
  setVehicleComponentRotation(theVeh,'steer',rotX,rotY,rotX*10)
  end
end
addEventHandler("onClientRender", root, steeringwheel)

 

Edited by Dimos7
Link to comment
  • Scripting Moderators
On 14/01/2019 at 12:59, Dimos7 said:

function steeringwheel()
local theVeh = getPedOccupiedVehicle(localPlayer)    
    if getVehicleComponentRotation == handlingGetSteeringLock then
        local rotX, rotY, rotZ = getVehicleComponentRotation (theVeh, "steer" )
  setVehicleComponentRotation(theVeh,'steer',rotX,rotY,rotX*10)
  end
end
addEventHandler("onClientRender", root, steeringwheel)

 

what about onClientPreRender?

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...