isa_Khamdan Posted October 5, 2013 Share Posted October 5, 2013 Why this code doesn't work? addCommandHandler( "get", function ( thePlayer ) local x, y, z, x1, y1, z1 = getCameraMatrix ( thePlayer ) outputChatBox( x , y , z , x1 , y1 , z1 , thePlayer) end ) Link to comment
WASSIm. Posted October 5, 2013 Share Posted October 5, 2013 addCommandHandler( "get", function ( thePlayer ) local x, y, z, x1, y1, z1 = getCameraMatrix ( thePlayer ) outputChatBox( x..","..y..","..z..","..x1..","..y1..","..z1 , thePlayer) end ) Link to comment
isa_Khamdan Posted October 5, 2013 Author Share Posted October 5, 2013 addCommandHandler( "get", function ( thePlayer ) local x, y, z, x1, y1, z1 = getCameraMatrix ( thePlayer ) outputChatBox( x..","..y..","..z..","..x1..","..y1..","..z1 , thePlayer) end ) Dosen't work [19:04:11] ERROR: get\get.lua:8: attempt to concatenate local 'z1' (a nil value) Link to comment
Castillo Posted October 5, 2013 Share Posted October 5, 2013 addCommandHandler ( "get", function ( thePlayer ) outputChatBox ( table.concat ( { getCameraMatrix ( thePlayer ) }, ", " ), thePlayer ) end ) Link to comment
mr.Extreme Posted October 5, 2013 Share Posted October 5, 2013 put this codes in client side clientside: addCommandHandler( "get", function ( thePlayer ) local x, y, z, x1, y1, z1 = getCameraMatrix ( thePlayer ) outputChatBox( x..","..y..","..z..","..x1..","..y1..","..z1 , thePlayer) end ) Link to comment
Castillo Posted October 5, 2013 Share Posted October 5, 2013 There's no need for 'thePlayer' in the client side, as getCameraMatrix has no arguments when used client side, nor command handler has a player element on the client side. Link to comment
isa_Khamdan Posted October 5, 2013 Author Share Posted October 5, 2013 Hmm how do I know if the camera is facing north? Link to comment
mr.Extreme Posted October 5, 2013 Share Posted October 5, 2013 Hmm how do I know if the camera is facing north? i dont know Link to comment
isa_Khamdan Posted October 5, 2013 Author Share Posted October 5, 2013 script works? The one that solidsnake gave me works but I don't know which number mean that the camera is facing north , south .. etc. Link to comment
mr.Extreme Posted October 5, 2013 Share Posted October 5, 2013 I think that the camera is moving north and south it " x1 " Link to comment
xXMADEXx Posted October 5, 2013 Share Posted October 5, 2013 Hmm how do I know if the camera is facing north? Use the findRotation function. Hmm how do I know if the camera is facing north? i dont know If you don't know, there is no need to reply. Link to comment
isa_Khamdan Posted October 6, 2013 Author Share Posted October 6, 2013 This won't be helpful , I don't want the Rotation of the element. I want to check the rotation of the camera and see if it is facing north or no. Link to comment
WASSIm. Posted October 6, 2013 Share Posted October 6, 2013 0 = N 90 = E 180 = S 270 = W function findRotation(x1,y1,x2,y2) local t = -math.deg(math.atan2(x2-x1,y2-y1)) if t < 0 then t = t + 360 end; return t; end addCommandHandler( "get", function ( thePlayer ) local x, y, z, x1, y1, z1 = getCameraMatrix ( thePlayer ) local rx, ry, rz = findRotation(x, y, x1, y1) outputChatBox( rz, thePlayer) end ) Link to comment
isa_Khamdan Posted October 7, 2013 Author Share Posted October 7, 2013 I am getting error with the source function [15:22:09] ERROR: xTStreetsOrganizer\Server.lua:13: attempt to perform arithmetic on local 'x2' (a nil value) 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