Jump to content
Sign in to follow this  
1para{god-father}

Limit 3rd Person View by class

Recommended Posts

Does anyone know how i can restrict 3rd person by Class ?

As I want ONLY pilots & engineers to be able to have 3rd person view

am using this ATM -

Params_CameraView=1;  // could set in decription but no need for this mission
// ----------------------------------------------------------------------------
//                          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;
		};
	};
};
};

Share this post


Link to post
Share on other sites

Engineers can be easily identified via their "engineer = 1" config entry. Pilots do not have anything like that so you'd have to check for something else instead.

Anyway, why don't you simply allow thirdperson only for the driver/pilot of a vehicle?

Share this post


Link to post
Share on other sites

I need engineers to have 3rd person as you will be base building and need external view to move Objects :)

Share this post


Link to post
Share on other sites


_whitelist = [ "B_soldier_...", "bla" ];
_top = typeof player;

if ( _top in _whitelist ) exitWith {};

while {(true)} do
{
if (cameraView == "External") then
{
	(vehicle player) switchCamera "Internal";
};

sleep 0.5;
};

something like this?

Share this post


Link to post
Share on other sites

Hi. I am almost new to editing so I gotta ask this :)

I've made an Insurgency mission to play with friends(we have a dedicated server) and I too would like to allow the pilots 3rd person view. So this PHP code above, where am I to put that and do we need to allow the 3rd Person view in the server settings(we play only 1st person)?

Thanks guys.

Share this post


Link to post
Share on other sites

Good morning community,

i would like to set my server to first person out of vehicles and 3rd person in vehicles like Hunter or Ghost Hawk.

Can someone help me ? what script i have to use and how can i set it up.

I´m sorry for my bad englisch im german.

best regards eXpeRienC

Share this post


Link to post
Share on other sites

Run on client (untested):

_code = {
if ((vehicle player) == player) then {
	player switchCamera "Internal";
} else {
	(vehicle player) switchCamera "External";
};
};

["IP_OnEachFrameEH", "onEachFrame", _code] call BIS_fnc_addStackedEventHandler;

Share this post


Link to post
Share on other sites

You would include it in the mission.

Share this post


Link to post
Share on other sites
Does anyone know how i can restrict 3rd person by Class ?

As I want ONLY pilots & engineers to be able to have 3rd person view

am using this ATM -

Params_CameraView=1;  // could set in decription but no need for this mission
// ----------------------------------------------------------------------------
//                          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;
		};
	};
};
};

Where do you actually put this code? I'm pretty new at this. I copied and pasted this into my description.ext and it crashed my game. I'm obviously doing it wrong.

Thanks

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
Sign in to follow this  

×