Jump to content

[HELP] GetCameraMatrix()


John_Scott

Recommended Posts

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:

error_www.kepfeltoltes.hu_.jpg

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
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...