Jump to content
kgino1045

How can i restrict 3rd person perspective at only specific position?

Recommended Posts

As title said i'd like to make player see their looks only around at base so they can see what they are wearing but after went out i want them only using 1st person perspective. is there any script that make this happen?

Share this post


Link to post
Share on other sites

Just a quick mock up, can likely be made cleaner.

//initPlayerLocal.sqf
h = [] spawn {
	waitUntil{ !isNull findDisplay 46 };

	findDisplay 46 displayAddEventHandler [ "KeyDown", {
		if ( inputAction "personView" > 0 && { !TAG_allowTPV } ) then {
			if !( isNil "TAG_handleTPV" ) then {
				terminate TAG_handleTPV;
			};
			TAG_handleTPV = [] spawn {
				waitUntil{ cameraView == "EXTERNAL" };
				player switchCamera "INTERNAL";
				TAG_handleTPV = nil;
			};
		};
	}];
};


_trg = NameOfATriggerThatEncompassesBase; //<<<<<<< EDIT this

_trg triggerAttachVehicle[ player ];
_trg setTriggerActivation [ "VEHICLE", "PRESENT", true ];
_trg setTriggerStatements ["this", "
	TAG_allowTPV = true;
	if !( isnil 'TAG_handleTPV' ) then {
		terminate TAG_handleTPV;
	};
", "
	player switchCamera 'INTERNAL';
	TAG_allowTPV = false
"];

TAG_allowTPV = player inArea _trg;
  • Thanks 2

Share this post


Link to post
Share on other sites

I'm totally noob.should i just put this at any random object or should i write another init or sqf like files?

Share this post


Link to post
Share on other sites

if you are making a Sp you can put it inside your INIT.SQF file

if you make a MP you have to put it in INITPLAYERLOCAL.SQF

 

if you have made any of the files with any other text you just copy and paste the text in your own files

 

 

Share this post


Link to post
Share on other sites
2 hours ago, Play3r said:

if you are making a Sp you can put it inside your INIT.SQF file

if you make a MP you have to put it in INITPLAYERLOCAL.SQF

 

if you have made any of the files with any other text you just copy and paste the text in your own files

 

 

 

then how do i know which place i can make them restrict or free?

Share this post


Link to post
Share on other sites
2 hours ago, kgino1045 said:

 

then how do i know which place i can make them restrict or free?

by using this one     >>   _trg = NameOfATriggerThatEncompassesBase; //<<<<<<< EDIT this  <<

i think that means that you put a trigger over the area you want to be 3rd person area and when player moves outside it the get first person..

and in the NameOfATriggerThatEncompassesBase you write the name of the trigger you have placed down, the NameOfATriggerThatEncompassesBase is the varibelname of the trigger.

  • Like 1

Share this post


Link to post
Share on other sites

Thanks for the reply. I'll try to do what you advice and if i stuck at some point i'll ask to you again

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×