Skip to content

Instantly share code, notes, and snippets.

@wiking-at
Created October 21, 2014 11:16
Show Gist options
  • Save wiking-at/fd802b6e88fab9a7885c to your computer and use it in GitHub Desktop.
Save wiking-at/fd802b6e88fab9a7885c to your computer and use it in GitHub Desktop.
First Person Camera Checks
// @file Name: cameraChecks.sqf
// @file Author: AgentRev, Wiking
if (!hasInterface) exitWith {};
private ["_fpOnFoot", "_forceFP", "_forceFPveh"];
_fpOnFoot = (difficultyEnabled "3rdPersonView" && ["A3W_firstPersonCamOnFoot"] call isConfigOn);
_fpNotDriver = (difficultyEnabled "3rdPersonView" && ["A3W_firstPersonCamNotDriver"] call isConfigOn);
while {true} do
{
waitUntil
{
_forceFP = (_fpOnFoot && alive player && cameraOn == player); //check if camera is on player
_forceFPveh = (_fpNotDriver && alive player && cameraOn == (vehicle player) && (player != driver (vehicle player))); //Camera on player in vehicle, not driver
((_forceFP && cameraView == "EXTERNAL") || (_forceFPveh && cameraView == "EXTERNAL") || cameraView == "GROUP")
};
if (cameraView == "GROUP") then //Disable Commander View
{
cameraOn switchCamera "EXTERNAL";
};
if (_forceFP && cameraView == "EXTERNAL") then
{
cameraOn switchCamera "INTERNAL";
};
if (_forceFPveh && cameraView == "EXTERNAL") then
{
cameraOn switchCamera "INTERNAL";
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment