Jump to content

[HELP]Rotate Object Problem


DeiwnEdits

Recommended Posts

Posted (edited)

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
Posted (edited)
setElementRotation(theVeh,"steer"rotX,rotY,rotX*10)

Well that's completely wrong, and even if it was the right function; you missed a comma after "steer"

setVehicleComponentRotation(theVeh,'steer',rotX,rotY,rotX*10)

 

Edited by CodyJ(L)
  • Scripting Moderators
Posted (edited)
if getVehicleComponentRotation = handlingGetSteeringLock then

To

if getVehicleComponentRotation == handlingGetSteeringLock then

But, your code still seems to be incorrect logically.

Edited by thisdp
Posted (edited)
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
  • Scripting Moderators
Posted
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?

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...