Seaweed's No Third Person Whoring

seaweeduk

OpenDayZ Rockstar!
I hate people who spend hours doing things like laying on top of a firestation whilst prone. They can see literally everything around them and cannot be shot until they sit up to shoot someone else. I'm not a fan of the third person camera in general but unfortunately it's too unpopular to run a 1st person server.

I wrote this script to try and improve the combat somewhat in certain areas, particularly firestations.

What it does

  • Players cannot use the 3rd person camera in any prone animation, if they are more than 1 metre above ground level.
  • If players attempt to repeatedly try to use the 3rd person camera whilst in an illegal animation their character will stand up and surrender.

Installation

In init.sqf at the bottom add:

Code:
if (!isDedicated) then {
    [] execVM "fixes\thirdPersonWhores.sqf";
};

Create a thirdPersonWhores.sqf in your fixes directory or wherever you want to put it. Paste this as the contents.

Code:
waitUntil {!isNull player};
sleep 5;
_count = 0;
_playerHeight = 2;
_lastTime = diag_tickTime;
_lastTriggeredTime = diag_tickTime;
_whoreanimations = ["amovppnemstpsraswpstdnon","awopppnemstpsoptwbindnon_amovppnemstpsraswpstdnon","awopppnemstpsoptwbindnon_amovppnemstpsraswpstdnon_mid",
"awopppnemstpsoptwbindnon_amovppnemstpsraswpstdnon_end","amovpercmstpsraswrfldnon_amovppnemstpsraswrfldnon","amovppnemstpsraswrfldnon",
"amovppnemstpsraswrfldnon_amovppnemevaslowwrfldl","amovppnemstpsraswrfldnon_amovppnemevaslowwrfldr","amovppnemsprslowwrfldfr","amovppnemrunslowwrfldf",
"amovppnemrunsnonwnondr","amovppnemrunsnonwnondl","amovppnemrunsnonwnondf","amovppnemrunsnonwnondb","amovppnemrunsnonwnondbr","amovppnemrunsnonwnondfr","awopppnemstpsoptwbindnon_amovppnemstpsnonwnondnon_end",
"awopppnemstpsoptwbindnon_amovppnemstpsnonwnondnon","awopppnemstpsoptwbindnon_non","amovppnemstpsnonwnondnon_awopppnemstpsoptwbindnon_end","amovppnemstpsnonwnondnon_awopppnemstpsoptwbindnon",
"amovppnemstpsnonwnondnon_turnr","amovppnemstpsnonwnondnon_amovppnemevasnonwnondr","amovppnemstpsnonwnondnon_amovppnemevasnonwnondl","amovppnemrunsnonwnondfl","amovppnemrunsnonwnondbl",
"amovppnemsprslowwrfldfl","amovppnemsprslowwrfldbl","amovppnemsprslowwrfldr","amovppnemsprslowwrfldb","amovppnemstpsnonwnondnon","amovppnemstpsnonwnondnon_turnl","amovpknlmstpsnonwnondnon_amovppnemstpsnonwnondnon",
"amovppnemstpsraswrfldnon_amovppnemstpsraswpstdnon","amovppnemstpsraswrfldnon_amovppnemstpsraswpstdnon_end","amovppnemrunslowwpstdf","amovppnemstpsraswpstdnon_amovppnemevaslowwpstdl",
"amovppnemstpsraswpstdnon_amovpknlmstpsraswpstdnon","amovppnemrunslowwpstdfl","amovppnemrunslowwpstdbl","amovppnemsprslowwrfldbr","amovppnemsprslowwrfldf","amovppnemrunslowwpstdb",
"amovppnemrunslowwpstdfr","amovppnemrunslowwpstdbr","amovppnemstpsraswpstdnon_awopppnemstpsoptwbindnon_mid","awopppnemstpsoptwbindnon_rfl","amovppnemwlksoptwbindf_rfl",
"amovppnemrunsnonwbindf_rfl","amovppnemstpsraswrfldnon_awopppnemstpsoptwbindnon_end","amovppnemstpsraswrfldnon_awopppnemstpsoptwbindnon"];


while {true} do
{
    _tickTime = diag_tickTime;

    if ((_tickTime - _lastTime) > 10) then {
        _playerPosition = getPosATL  player;
        _playerHeight = _playerPosition select 2;
        _lastTime = diag_tickTime;
    };

    if (((_tickTime - _lastTriggeredTime) > 30) && (_count > 0)) then {
        _count = 0;
    };



    if (_playerHeight > 1) then {
      _animation =  animationState player;
        if ((_animation in _whoreanimations) && (cameraView == "External")) then {
            player switchCamera "Internal";
            _count = _count + 1;
            _lastTriggeredTime = diag_tickTime;
           
            if (_count > 5) then {
                player playMove "amovpercmstpssurwnondnon";
                disableUserInput true;
                sleep 0.5;
                _count = 0;
                disableUserInput false;
            };

        };
    };
    sleep 0.01;
};

Enjoy!

Terms & Conditions - When you download or copy this code you agree to not charge any money for installing this script. You may not use the code for profit in any way. Please give credit to the author and link to this thread if you add it to you server.
 
Last edited:
Better way to to check if the player is in a prone animation:
Code:
    _animation =  animationState player;
    _state = (getText (configFile >> "CfgMovesMaleSdr" >> "States" >> _animation >> "actions"));
    _proneActions = ["RifleProneActions","PistolProneActions","CivilProneActions"];
        if (_state in _proneActions) then {
            hint "PRONE!";
        };

Other then that, nice idea ;)
 
You can also stop people looking through walls using third person camera and leaning. Add this inside your dayz_spaceInterrupt section in compiles.sqf

_inVehicle = (_vehicle != player);

if !(_inVehicle) then {
if ((_dikCode in actionKeys "LeanLeft") || (_dikCode in actionKeys "LeanRight") || (_dikCode in actionKeys "LeanLeftToggle") || (_dikCode in actionKeys "LeanRightToggle")) then {
player switchCamera "Internal";
};
};

edit: appears double tapping can work around this one
 
Last edited:
Back
Top