Mishqutin Posted March 11, 2018 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
Mishqutin Posted March 11, 2018 Author Posted March 11, 2018 But getElementPosition() returns only position.
Captain Cody Posted March 11, 2018 Posted March 11, 2018 https://wiki.multitheftauto.com/wiki/GetCameraRotation
Mishqutin Posted March 11, 2018 Author Posted March 11, 2018 (edited) Thanks! I forgot about that function. Edited March 11, 2018 by Mishqutin
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