DeiwnEdits Posted January 13, 2019 Share Posted January 13, 2019 (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 January 13, 2019 by Naruto Edits Link to comment
Captain Cody Posted January 13, 2019 Share Posted January 13, 2019 (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 January 13, 2019 by CodyJ(L) Link to comment
Scripting Moderators thisdp Posted January 13, 2019 Scripting Moderators Share Posted January 13, 2019 (edited) if getVehicleComponentRotation = handlingGetSteeringLock then To if getVehicleComponentRotation == handlingGetSteeringLock then But, your code still seems to be incorrect logically. Edited January 13, 2019 by thisdp Link to comment
Captain Cody Posted January 13, 2019 Share Posted January 13, 2019 Didn't even notice that holy crap the codes missing alot of stuff. Link to comment
Dimos7 Posted January 14, 2019 Share Posted January 14, 2019 (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 January 14, 2019 by Dimos7 Link to comment
DeiwnEdits Posted January 14, 2019 Author Share Posted January 14, 2019 Don't working bro. Link to comment
Scripting Moderators thisdp Posted January 16, 2019 Scripting Moderators Share Posted January 16, 2019 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now