Mishqutin Posted March 11, 2018 Share Posted March 11, 2018 (edited) I am making a vehicle turret. So far I've made a function that rotates the turret horizontaly: function rotateTurret() local rotation = getPedCameraRotation(getLocalPlayer()) local veh = getPedOccupiedVehicle(getLocalPlayer()) local _, _, vehRotation = getElementRotation(veh) setElementAttachedOffsets(vWeapon, 0, 0, 2, 0, 0, 0-vehRotation-rotation+90) if vWeapon then setTimer(rotateTurret, 100, 1) end end And I couldn't find function returning elevation of player's camera. Edited March 11, 2018 by Mishqutin Link to comment
Addlibs Posted March 11, 2018 Share Posted March 11, 2018 Have you tried getElementPosition(getCamera()) Link to comment
Mishqutin Posted March 11, 2018 Author Share Posted March 11, 2018 But getElementPosition() returns only position. Link to comment
Captain Cody Posted March 11, 2018 Share Posted March 11, 2018 https://wiki.multitheftauto.com/wiki/GetCameraRotation Link to comment
Mishqutin Posted March 11, 2018 Author Share Posted March 11, 2018 (edited) Thanks! I forgot about that function. Edited March 11, 2018 by Mishqutin 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