# 3rd person on for Vehicles only

## 3rd person on for Vehicles only

« posted: Jan 19, 2014, 11:09 AM »
I found  script that suppose to work in ArmA2, but it does not work in ArmA3.

In Init.sqf I added:

Code: [Select]
`[] execVM "addons\3Pveh\Launchthirdperson.sqf";`
Launchthirdperson.sqf
Code: [Select]
`waitUntil { player == player };if( local player ) then{ [] execVM "addons\3Pveh\limitThirdPersonView.sqf";};`
limitThirdPersonView.sqf
Code: [Select]
`        ////Params_CameraView=1;  ////uncomment this if you do not set up parameters on mission start        // ----------------------------------------------------------------------------        //                          MAIN ROUTINE        // ----------------------------------------------------------------------------        // no loop need, if third person view is not available anyway        if (difficultyEnabled "3rdPersonView") then        {        switch (Params_CameraView) do        {        case 1://vehicles only        {        while {(true)} do        {        if (cameraView == "External") then        {        if ((vehicle player) == player) then        {        player switchCamera "Internal";        };        };        sleep 0.1;        };        };        case 2://infantry only        {        while {(true)} do        {        if (cameraView == "External") then        {        if ((vehicle player) != player) then        {        (vehicle player) switchCamera "Internal";        };        };        sleep 0.1;        };        };        case 3://disabled        {        while {(true)} do        {        if (cameraView == "External") then        {        if ((vehicle player) == cameraOn) then        {        (vehicle player) switchCamera "Internal";        };        };        sleep 0.1;        };        };        };        };`
• First Blood
• Posts: 82

## Re: 3rd person on for Vehicles only

« Reply #1 posted: Jan 19, 2014, 07:47 PM »
olutta.org's wasteland had this feature last time I checked so maybe take a look at their's

## Re: 3rd person on for Vehicles only

« Reply #2 posted: Jan 19, 2014, 11:31 PM »
olutta.org's wasteland had this feature last time I checked so maybe take a look at their's

Thanks for suggestion, I did try now but without success .

## Re: 3rd person on for Vehicles only

« Reply #3 posted: Jan 22, 2014, 09:30 AM »
I manage to solve it with this script:

Code: [Select]
`[] execVM "custom\3rd.sqf"; //3rd person limit`
Code: [Select]
`/*************************************************************************************************************************************                                                   CREATED BY MOSES @ DAYZUK.COM                                                   **************************************************************************************************************************************//*************************************************************************************************************************************                                 http://browser.six-projects.net/cfg_vehicles/classlist?version=58 ** Use the above url to find vehicle classes and types                                         ** Vehicle can be defined by type or class name ** The type 'man' is used for a player not in a vehicle ** A detailed guide to usage and installation can be found at the url below ** ----------------------------------------------------------------------- **************************************************************************************************************************************/_types = [ //List of vehicle types that cannot use thirdperson "car", //3 main types: man , car , air "man" //not in a vehicle is classed as "man" ]; _hint = false; //To have the message displayed in the form of a hint set this to true - wont work if you have a debug monitor_vMsg = "Third person allowed only in vehicles"; //Message displayed when in vehicle_fMsg = "Third person allowed only in vehicles"; //Message displayed when not in a vehicle and "man" is a dissallowed type_displayMsg = true; //To disable the message change this to false/************************************************************************************************************************************/_list = _types;_msg = _vMsg;if ("man" in _types) then {_list = _types - ["man"]; _msg = _fMsg;};if (isDedicated) exitWith {diag_log format["MOSES 3RD :: ENABLED :: 3rd Disabled in -- %1",_types];};while {difficultyEnabled "3rdPersonView"} do { waitUntil {cameraView == "EXTERNAL"}; { if (vehicle player isKindOf _x) then { (vehicle player) switchCamera "INTERNAL"; if (_displayMsg) then{if (_hint) then {hint format[_msg,_list];}else{cuttext [format [_msg,_list],"PLAIN DOWN",1];};}; }; } forEach _types;};`
There is a bug as if player lowers the weapon he can still switch to 3rd person view.