John_Scott Posted November 9, 2014 Share Posted November 9, 2014 Hi! I have a problem with the 'getCameraMatrix' function. I would like to prit the camera matrix positions to the chat, but an error shows up every times. Code: (server side) local cx,cy,cz,lx,ly,lz = getCameraMatrix(playerSource) outputChatBox("Camera matrix: " .. cx .. ", " .. cy .. ", " .. cz .. ", " .. lx .. ", " .. ly .. ", " .. lz .. " ", playerSource) Error: When I add this thing to the code: if not lz then lz = 0 end The error say the ly pos, so all of these coordinates are nil How can I fix this? Thanks for helping! Link to comment
DiSaMe Posted November 9, 2014 Share Posted November 9, 2014 https://wiki.multitheftauto.com/wiki/GetCameraMatrix: Note: The server-side version of this function returns the last camera matrix that was set by the server, and thus does not necessarily indicate the current matrix of the camera (since it may have been changed client-side). That must be the cause, it only returns the camera matrix if it was set using setCameraMatrix. Link to comment
John_Scott Posted November 9, 2014 Author Share Posted November 9, 2014 https://wiki.multitheftauto.com/wiki/GetCameraMatrix:Note: The server-side version of this function returns the last camera matrix that was set by the server, and thus does not necessarily indicate the current matrix of the camera (since it may have been changed client-side). That must be the cause, it only returns the camera matrix if it was set using setCameraMatrix. Oh, so this function works only in client side like this?! Thank you! 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