Created
October 21, 2014 11:16
-
-
Save wiking-at/fd802b6e88fab9a7885c to your computer and use it in GitHub Desktop.
First Person Camera Checks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @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