OnlineCheater Posted February 15, 2016 Share Posted February 15, 2016 Hey all, I just want to save a camera target when I die whilte I'm in a vehicle and then even if the vehicle moves, the camera keeps motionless thanks to the camera saved when the player died. Could you please tell me how I can do this? I have no idea how to save the coordonates of the camera when the player dies... addEventHandler("onClientPlayerWasted",root, function() ........ end) Link to comment
TAPL Posted February 15, 2016 Share Posted February 15, 2016 addEventHandler("onClientPlayerWasted", localPlayer, function() setCameraMatrix(unpack({getCameraMatrix()})) end) Link to comment
OnlineCheater Posted February 16, 2016 Author Share Posted February 16, 2016 addEventHandler("onClientPlayerWasted", localPlayer, function() setCameraMatrix(unpack({getCameraMatrix()})) end) Gonna test it, thank you TAPL! Link to comment
tosfera Posted February 16, 2016 Share Posted February 16, 2016 addEventHandler("onClientPlayerWasted", localPlayer, function() setCameraMatrix(unpack({getCameraMatrix()})) end) I'm not quite sure but this can also be done without the unpack. If I'm not mistaken, the function getCameraMatrix returns a total of 8 parameters which are enough and actually correctly used in setCameraMatrix. If you want to save your head from clusterf*cks, you can try it by simply doing; setCameraMatrix ( getCameraMatrix() ) That might even save a little tiny bit of cpu usage too. Link to comment
OnlineCheater Posted February 16, 2016 Author Share Posted February 16, 2016 Works perfectly, thank you TAPL! I had already tried this way before tosfera but it didn't worked, thank you anyway 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