Razish / japp

JA++ server and client modification for Jedi Academy
GNU General Public License v2.0
44 stars 30 forks source link

What about player camera api? #322

Closed keyten closed 9 years ago

keyten commented 9 years ago

For example:

local player = GetPlayer( 0 )
player.camera.activate()
player.camera.position = Vector3( x, y, z )
player.camera.angles = Vector3( x, y, z )
-- and player.camera.deactivate()
Exmirai commented 9 years ago

can you explain each function in your example?

keyten commented 9 years ago

Of course.

I mean server api (is it possible?). On the client I can change cvars, but I want to manipulate player's camera from server.

player.camera -- special camera (not attached to player). player.camera.activate -- activates special camera instead of main.

For example:

player1.camera.activate()
function MainLoop()
 player1.camera.position = player2.position
 player1.camera.angles = player2.angles
end

-- allows player1 to see everything player2 sees (like in spectator).

Or:

AddClientCommand('cameraset', function(ply)
 ply.camera.position = ply.position
 ply.camera.angles = ply.angles
end)
AddClientCommand('cameraview', function(ply)
 ply.camera.activate()
end)
-- and 'cameradeactivate'

-- allows any player to set a camera in any place and watch it.

Razish commented 9 years ago

Can't be done, client decides for itself where to place the camera.

Exmirai commented 9 years ago

^

keyten commented 9 years ago

:(