2 options for creating a camera
// 1. create a camera
the FreeCamTest class extends Camera
{
void FreeCamTest () {SetEventMask (EntityEvent.FRAME);}
void ~ FreeCamTest () {}
};
ref FreeCamTest m_FreeCam;
// create a camera
m_FreeCam = FreeCamTest.Cast (g_Game.CreateObject ("FreeCamTest", pos, true));
m_FreeCam.SetActive (true);
// shoot the camera
m_FreeCam.SetActive (false);
GetGame (). ObjectDelete (m_FreeCam);
// 2. create a camera
GetGame (). SelectPlayer (UserIdentity, NULL);
GetGame (). SelectSpectator (UserIdentity, "DayZSpectator", posCam);
GetGame (). UpdateSpectatorPosition (posCam);
// back to the player's body
GetGame (). SelectPlayer (UserIdentity, currentPlayer);
// basically everything works fine, but if you execute the command while in the vehicle, it will be partially disconnected from the vehicle and the information that the player is in the vehicle will also be deleted, so if after returning to the vehicle means, press jump up and you can walk through the air after restarting to the server the body will be in the air (if body removal is disabled when disconnected)
GetGame (). SelectPlayer (UserIdentity, currentPlayer);
also this command will not return anything
HumanCommandVehicle vehCommand = player.GetCommand_Vehicle ();