Jump to content
  • 0

First person while laying down


NateDayZ

Question

19 answers to this question

Recommended Posts

  • 0

For now there is no specific command to check whether a player is proning so you have to workaround it. This is not tested but I guess this should work:

/*
Description:
AmovPpneMstpSrasWpstDnon - Proning with Pistol
AmovPpneMstpSrasWrflDnon - Proning with Rifle
*/
private ["_unit","_initialDelay","_delay","_tolerance","_isProning","_timer"];

_unit = _this select 0;
_initialDelay = _this select 1;
_delay = _this select 2;
_tolerance = _this select 3;
_isProning = false;

_timer = 0;
sleep _initialDelay;

while {_counter <= _delay} do {

	if ((animationState _unit != "AmovPpneMstpSrasWrflDnon") && (animationState _unit != "AmovPpneMstpSrasWpstDnon")) then {
		sleep _tolerance;
		_timer = _timer + _tolerance;

		if ((animationState _unit != "AmovPpneMstpSrasWrflDnon") && (animationState _unit != "AmovPpneMstpSrasWpstDnon")) then {
			_isProning = true;
		};
	};

} else {
	sleep 1;
	_isProning = false;
	_timer = _timer + 1;
};

 

Link to comment
Share on other sites

  • 0

I got a good laugh from reading all that :P

 

Thank you damnrelentless ill try it out. I was just asking as I played another server awhile ago where if you went prone on a building it would force you into first person and if you tried going back into third person three times it would force you to stand up and put your hands behind your head.

Link to comment
Share on other sites

  • 0

I don't know why you want that but actually you can use this code I posted as a scriptbase for the prone-check. You just have to add the third and first person checks and this warning system that you automatically stand up or if you still have the mission of the server you could take a look into that and see how they made that. :)

Link to comment
Share on other sites

  • 0
1 hour ago, DAmNRelentless said:

I don't know why you want that but actually you can use this code I posted as a scriptbase for the prone-check. You just have to add the third and first person checks and this warning system that you automatically stand up or if you still have the mission of the server you could take a look into that and see how they made that. :)

forcing first person near buildings is to stop players looking through and over walls usually. :)

Link to comment
Share on other sites

  • 0
If we hang he in the middle of stary?
   _unit = _this select 0;
_initialDelay = _this select 1;
_delay = _this select 2;
_tolerance = _this select 3;
_isProning = false;

_timer = 0;
sleep _initialDelay;

while {_counter <= _delay} do {

	if ((animationState _unit != "AmovPpneMstpSrasWrflDnon") && (animationState _unit != "AmovPpneMstpSrasWpstDnon")) then {
		sleep _tolerance;
		_timer = _timer + _tolerance;

		if ((animationState _unit != "AmovPpneMstpSrasWrflDnon") && (animationState _unit != "AmovPpneMstpSrasWpstDnon")) then {
			_isProning = true;
		};
	};

} else {
	sleep 1;
	_isProning = false;
	_timer = _timer + 1;
};

if (_isProning) then {
_playerpos = getposATL player;
_starytrader_pos = [6325,7807,0];
_stick = createVehicle ["FlagCarrierINS",_starytrader_pos, [], 0, "CAN_COLLIDE"];
   _unit attachTo [_stick 0,0,0];
   systemchat ("you was attached cuz i hate the way you play att. an adm");
   sleep 60;
   detach _unit;
   deletevehicle _stick;
   player setpos _playerpos;
 };

 

 

Link to comment
Share on other sites

  • 0
57 minutes ago, juandayz said:

If we hang he in the middle of stary?

   _unit = _this select 0;
_initialDelay = _this select 1;
_delay = _this select 2;
_tolerance = _this select 3;
_isProning = false;

_timer = 0;
sleep _initialDelay;

while {_counter <= _delay} do {

	if ((animationState _unit != "AmovPpneMstpSrasWrflDnon") && (animationState _unit != "AmovPpneMstpSrasWpstDnon")) then {
		sleep _tolerance;
		_timer = _timer + _tolerance;

		if ((animationState _unit != "AmovPpneMstpSrasWrflDnon") && (animationState _unit != "AmovPpneMstpSrasWpstDnon")) then {
			_isProning = true;
		};
	};

} else {
	sleep 1;
	_isProning = false;
	_timer = _timer + 1;
};

if (_isProning) then {
_playerpos = getposATL player;
_starytrader_pos = [6325,7807,0];
_stick = createVehicle ["FlagCarrierINS",_starytrader_pos, [], 0, "CAN_COLLIDE"];
   _unit attachTo [_stick 0,0,0];
   systemchat ("you was attached cuz i hate the way you play att. an adm");
   sleep 60;
   detach _unit;
   deletevehicle _stick;
   player setpos _playerpos;
 };

 

 

HAHAHA I can see a new tie up script in the work lol. Hang_Player.sqf

Link to comment
Share on other sites

  • 0
56 minutes ago, DAmNRelentless said:

Thanks for the info but why only when going to prone? :D

yeah im not too sure his reasoning why on when prone.

But it would be good in some instances. eg.

Lingor Islands has nice jungles with lots of grass. players can lay down in a ghillie suit and can barely be seen. if they were forced into first person mode it would make it so they couldn't 3rd person to spot players. Bit more realistic I think.

Link to comment
Share on other sites

  • 0

I wrote this code, it's pretty simple, all it does is check for if the player is alive, if they are it checks to see if they are in the prone animation, if they are it forces them to first person view, if they switch out to external view they will switch back.

Pretty simple, you can mess with the uiSleep timer to make it more faster switching so they can't keep pushing enter.

while {alive player} do {
	if (animationState player == "amovppnemstpsraswrfldnon") then {
		if (cameraView != "INTERNAL") then {vehicle player switchCamera "INTERNAL";};
	};
	uiSleep 0.5;
};

 

Link to comment
Share on other sites

  • 0
8 hours ago, salival said:

I wrote this code, it's pretty simple, all it does is check for if the player is alive, if they are it checks to see if they are in the prone animation, if they are it forces them to first person view, if they switch out to external view they will switch back.

Pretty simple, you can mess with the uiSleep timer to make it more faster switching so they can't keep pushing enter.


while {alive player} do {
	if (animationState player == "amovppnemstpsraswpstdnon") then {
		if (cameraView != "INTERNAL") then {vehicle player switchCamera "INTERNAL";};
	};
	uiSleep 0.5;
};

 

I thought amovppnemstpsraswpstdnon is only proning with a pistol, that's why I added the animation for proning with a rifle to my code. But I think you tested this already and if it's working it's fine. I am just wondering.

Link to comment
Share on other sites

  • 0
1 hour ago, DAmNRelentless said:

I thought amovppnemstpsraswpstdnon is only proning with a pistol, that's why I added the animation for proning with a rifle to my code. But I think you tested this already and if it's working it's fine. I am just wondering.

To be honest, you very well could be right, I think I did all my testing with the pistol out. I will test correctly and update my post.

*edit* I checked and you are correct, have updated my post.

Link to comment
Share on other sites

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
  • Advertisement
  • Discord

×
×
  • Create New...