-Blaze- Posted March 13, 2016 Share Posted March 13, 2016 Hey, function getCameraMatrixPosition(player) local camx, camy, camz, tarx, tary, tarz = getCameraMatrix(player) outputChatBox(camx..", "..camy..", "..camz..", "..tarx..", "..tary..", "..tarz, player) end addCommandHandler("matrix", getCameraMatrixPosition) I need to use getCameraMatrix on server side due to some reasons but it just won't work. it gives an error : attempt to concatenate 'tarz' a nil value, in line 4. Any help? Link to comment
Moderators IIYAMA Posted March 13, 2016 Moderators Share Posted March 13, 2016 It is a nil value when the player isn't syncing his camera. I don't know when that happens, but probably when the player is dead. Link to comment
-Blaze- Posted March 13, 2016 Author Share Posted March 13, 2016 but it works perfectly on client ... However i require it on server side Link to comment
DakiLLa Posted March 13, 2016 Share Posted March 13, 2016 My guess on why it returns nil is probably because you have to set the camera matrix first before getting it (this applies for server-side only): 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). Link to comment
Moderators IIYAMA Posted March 13, 2016 Moderators Share Posted March 13, 2016 Nope, see this page: https://wiki.multitheftauto.com/wiki/Sy ... l_settings camera_sync_interval > How often to tell the server of any client side changes to the local players camera position and target. (wiki mta) It is synced, but we don't know when it is synced. Link to comment
-Blaze- Posted March 14, 2016 Author Share Posted March 14, 2016 so , there's no way i can use getCameraMatrix on serverside? Link to comment
Moderators IIYAMA Posted March 14, 2016 Moderators Share Posted March 14, 2016 You can use it serverside. You can use the synchronization of mta. (which doesn't always works dual the data reduction and optimization) Or you use trigger events to request the data. (which has of course a delay, PING, because it isn't streamed) 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