Skip to content

Instantly share code, notes, and snippets.

@wiking-at
Created October 19, 2014 23:24
Show Gist options
  • Save wiking-at/f659abada8ee0fb1e122 to your computer and use it in GitHub Desktop.
Save wiking-at/f659abada8ee0fb1e122 to your computer and use it in GitHub Desktop.
1st Person Lock
if (!isDedicated) then { //preventing start on server
if (difficultyEnabled "3rdPersonView") then
{
while {true} do {
waitUntil {cameraView == "EXTERNAL" || cameraView == "GROUP"};
_timeStamp = ["combatTimestamp", -1] call _getPublicVar;
_abortDelay = ["A3W_combatAbortDelay", 0] call _getPublicVar;
if (((vehicle player) == player) && ((_timeStamp != -1 && diag_tickTime - _timeStamp < _abortDelay)) then {
player switchCamera "INTERNAL";
};
sleep 0.1;
if (((vehicle player) != player) && (speed (vehicle player)) >= 30) then {
(vehicle player) switchCamera "Internal";
};
sleep 0.1;
};
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment