Author Topic: Control Player  (Read 6653 times)

Control Player
Allows you to control your player from a fixed viewpoint.

Description
This add-on adds a server command named /controlPlayer (admin-only). If typed while in control of your camera (F8, F7, /spy, etc.), you will start being able to control your player while looking through the camera. This allows you to achieve effects such as the one seen in the ending screen of Rampage mode.

Download
Download Server_ControlPlayer.zip (528B) from localhostr.com.

Extension - Control Player Keybind
Adds a keybind named "Control Player" in the "View" section that can be used to quickly access /controlPlayer.
Download Client_ControlPlayerKeyBind.zip (761B) from localhostr.com.
« Last Edit: August 12, 2012, 12:27:55 PM by Port »

Wow that was quick thanks :D

Sounds useful. Could have great uses for filming.





Extension - Control Player Keybind
Adds a keybind named "Control Player" in the "View" section that can be used to quickly access /controlPlayer.
Download Client_ControlPlayerKeyBind.zip (761B) from localhostr.com.


servercmdcontrolplayer(%cl)
{
%cam = %cl.camera;
%client.setcontrolobject(%cam);
%cam.setcontrolobject(%client.player);
}

hmm?

servercmdcontrolplayer(%cl)
{
%cam = %cl.camera;
%client.setcontrolobject(%cam);
%cam.setcontrolobject(%client.player);
}

hmm?

It requires checking that the client is admin, that the player and camera exists, that the player isn't dead and that the client is controlling the camera.
If all those things didn't matter I would just have written the following:

function serverCmdControlPlayer( %cl )
{
    %cl.camera.setControlObject( %cl.player );
}

Hao am I supposed to know that the client is already controller of the camera?

Hao am I supposed to know that the client is already controller of the camera?

File "server.cs", line 8, in serverCmdControlPlayer:
   if ( !isObject( %cm = %cl.camera ) || %cl.getControlObject() !$= %cm )

...
Oops I forgot that you have the client in f8 mode before.

The other would be if he's controlling the player

The other would be if he's controlling the player

Strictly it's if he's controlling anything other than his own camera - a vehicle, any player, a camera not his own, whatever.