BulleTTime Posted April 12, 2009 Share Posted April 12, 2009 Im having a problem with getCameraMatrix, it gives me an error like below: Bad argument @ 'getCameraMatrix' im using the function like this: local cx, cy, cz, lx, ly, lz = getCameraMatrix() anyone got an idea? Link to comment
kalitonchik Posted April 12, 2009 Share Posted April 12, 2009 Please show youre attemp and line where is eror (bad argument) Link to comment
lil Toady Posted April 12, 2009 Share Posted April 12, 2009 If it's a server side script it needs a player argument. Link to comment
BulleTTime Posted April 12, 2009 Author Share Posted April 12, 2009 I'm trying to make a function were the camera moves from 1 point to another. I noticed it needs a player arg, but im still getting a nil value though ERROR: ...script.lua:97: attempt to perform arithmetic on local 'pos2z' (a nil value) local x,y,z = getElementPosition(player) local cx, cy, cz, lx, ly, lz = getCameraMatrix(player) cameraMovement(x,y,z+start_z,cx,cy,cz,x,y,z,player) function cameraMovement(pos1x,pos1y,pos1z,pos2x,pos2y,pos2z,pointx,pointy,pointz,player) local pos1z = pos1z - 0.3 if pos1z - pos2z >0 then setTimer ( cameraMovement, 100, 1, pos1x,pos1y,pos1z,pos2x,pos2y,pos2z,pointx,pointy,pointz,player) else setCameraMode (player, "player") end setCameraMatrix(player, pos1x,pos1y,pos1z,pointx,pointy,pointz) end Link to comment
BulleTTime Posted April 12, 2009 Author Share Posted April 12, 2009 seems that getCameraMatrix is not working serverside, but setCameraMatrix is not working clientside Link to comment
50p Posted April 12, 2009 Share Posted April 12, 2009 I'm trying to make a function were the camera moves from 1 point to another.I noticed it needs a player arg, but im still getting a nil value though ERROR: ...script.lua:97: attempt to perform arithmetic on local 'pos2z' (a nil value) ... The error basically says pos2z is nil. Check your code where it was assigned a value and make sure it's a number. We can't see when pos2z is assigned a value so we can't tell you why you get an error. Link to comment
BulleTTime Posted April 13, 2009 Author Share Posted April 13, 2009 i got the script working on another way. tanks for the help though 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