Xwad Posted January 25, 2016 Share Posted January 25, 2016 Hi. Is it possible to use players camera to rotate an objects? I mean for example: if i move the player camera right then the object will rotate right too. is this possible? if yes what functions need i use? thanks. Link to comment
KariiiM Posted January 25, 2016 Share Posted January 25, 2016 If I understand what you means, you've to use the usefull function, findRotation Link to comment
Castillo Posted January 25, 2016 Share Posted January 25, 2016 https://wiki.multitheftauto.com/wiki/Ge ... raRotation Maybe that could work? Link to comment
Xwad Posted January 25, 2016 Author Share Posted January 25, 2016 i dont really understand this function.. Can yoou make me an example pls? Link to comment
Xwad Posted January 25, 2016 Author Share Posted January 25, 2016 (edited) Is it good? local weapon = createWeapon("m4", -2376.80, -578.50, 132.3) setWeaponState(weapon, "ready") Function bindFire () local rotX, rotY, rotZ = getElementRotation(weapon) local x, y, z = getElementPosition (weapon) local x, y, z = getElementPosition(source) local rotX, rotY, rotZ = getElementRotation(source) setElementRotation(weapon, findRotation(x,y,rotX,rotY) ); end addEvent( "bindFire", true ) addEventHandler( "bindFire", localPlayer, bindFire ) Edited January 27, 2016 by Guest Link to comment
Xwad Posted January 27, 2016 Author Share Posted January 27, 2016 Please help me:( this is the last think i need to finish my script 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