bombajack

[UPDATED]EXILE 1st person in Combat mode and in vehicle

29 posts in this topic

Hello.

I have for you simple script for 1st view if is player in Combat Mode.

Its good for little bit harder server,not for MY LITTLE PONNY servers. :D

 

INSTRUCTIONS:

1.create file name viewrestriction.sqf and put it to your mission folder.

2.to viewrestriction.sqf file put this code :

 

if (!isDedicated) then {

    waitUntil {!isNull (findDisplay 46)};

    if ((difficultyOption "thirdPersonView")==1) then
    {
        while {true} do {

            waitUntil {cameraView == "EXTERNAL" || cameraView == "GROUP"};

            if (ExileClientPlayerIsInCombat) then {
                player switchCamera "INTERNAL";
            };
            sleep 0.1;

         };
    };

};

or you can use second version.Second version switch 1st person view if you are in combat and if you drive vehicle:

if (!isDedicated) then {

    waitUntil {!isNull (findDisplay 46)};

    if ((difficultyOption "thirdPersonView")==1) then
    {
        while {true} do {

            waitUntil {cameraView == "EXTERNAL" || cameraView == "GROUP"};

            if (ExileClientPlayerIsInCombat) then {
                player switchCamera "INTERNAL";
            };
            sleep 0.1;

            if  (((ExileClientPlayer) == player) && (speed ( player)) >= 4.4) then {
                player switchCamera "INTERNAL";
            };
            sleep 0.1;

            if (((ExileClientPlayer)isKindOf "LandVehicle") && (speed (ExileClientPlayer)) >= 10) then {
                (ExileClientPlayer) switchCamera "Internal";
            };
            sleep 0.1;

            if (( ExileClientPlayer) isKindOf "Helicopter" && (getPosVisual (ExileClientPlayer) select 2) > 5) then {
                (vehicle player) switchCamera "Internal";
            };
            sleep 0.1;

            if ((ExileClientPlayer) isKindOf "Plane" && (speed (ExileClientPlayer)) >= 60) then {
                (ExileClientPlayer) switchCamera "Internal";
            };
            sleep 0.1;

            if (((ExileClientPlayer)isKindOf "Ship") && (speed (ExileClientPlayer)) >= 20) then {
                (ExileClientPlayer) switchCamera "Internal";
            };
            sleep 0.1;


        };
    };

};

 

3.to the initPlayerLocal.sqf put:

[] execVM "viewrestriction.sqf";

 

Original script 3rdviewRestriction from armaholic.com by Rodeostar42,edited by Bombajack.:)

THATS IT! ENJOY!

 

 

 

Edited by bombajack
  • Like 8

Share this post


Link to post
Share on other sites
Advertisement
20 hours ago, C][G GhostTown™ said:

The issue with these and when your flying or driving and someone shoots near you or AI shoot and the instant camera switch into 1st.

I know this sounds silly but it caused alot of vehicle crashes haha

I think its OK...simple tip...dont fly near fight :)

Share this post


Link to post
Share on other sites
38 minutes ago, bombajack said:

I think its OK...simple tip...dont fly near fight :)

Except if someone shoots at you, you're instantly in combat..

  • Like 1

Share this post


Link to post
Share on other sites
47 minutes ago, kuplion said:

Except if someone shoots at you, you're instantly in combat..

it logically....if someone fire on you ..yes-you are in combat. ;)

Share this post


Link to post
Share on other sites
4 minutes ago, bombajack said:

it logically....if someone fire on you ..yes-you are in combat. ;)

Which means you can't avoid flying over combat.. ;)

Share this post


Link to post
Share on other sites

Like Dirty said, I'd suggest as well to move it to ExileClient_object_player_event_onFiredNear.sqf. 

Also, you can add something like the following to make sure a player isn't in a vehicle... 

if (vehicle player == player) then {
	//Change to firstperson
} else {
	// Don't change
};

 

  • Like 2

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.