Jump to content

Detect when not Free falling/Parachuting and Force close Arsenal

Recommended Posts

What I want:

So I'm making a mission where you start of by entering Arsenal.

While you are in arsenal a timer ticks down and when it gets to 0 you get teleported away into the air.

Before this happens I want the players to be forced out of arsenal so that they don't start free falling with arsenal open or (due to the fact that they should not take any damage until they have landed) can fidle with the arsenal while the mission is playing.


When teleported into the air I want the player to not be killable.

Once the player lands (either faceplant into the ground or by landing with a parachute) the player should then be able to take damage.




What I got:

All players get forced into arsenal in the begining and there is a timer ticking down.

If you exit the arsenal you get a black screen telling you that the game is still preparing and that you can re-enter the arsenal with a button click.

Once the timer runs out the players get teleported and enters free fall where he/she has access to a parachute.




What I've tried:

For forcing out of arsenal? Nothing cuz I can't find anything else than adding arsenal on google.

For detecting if landed:

getPos of player in Z axis, and it worked, unless you land on a roof.

detect stances such as prone, crouch or standing. Did not work and got called while free falling.

some weird hasLanded thing that most likely is only for helis/planes




So again, what do I need help with:

A way to detect if a player has landed, aka stopped freefalling and is not parachuting.

A way to force the player out of  the Arsenal.

Share this post

Link to post
Share on other sites
isTouchingGround (vehicle player);

Worked like a charm!

["AmmoboxExit"] spawn BIS_fnc_arsenal;

Did not work.

It also says here: https://community.bistudio.com/wiki/BIS_fnc_arsenal that  it doesn't work. Also, I don't use a ammobox or a object at all for entering the arsenal, I just force it upon the player.




Love your 3den enhanced mod btw! :D

Share this post

Link to post
Share on other sites
h = [] spawn {
    waitUntil{ time > 0 && !isNull player };
    _display = [ "Open", [ nil, nil, player ] ] call BIS_fnc_arsenal;
    _time = time + 10;
    waitUntil{ isNull _display || time > _time };
    if !( isNull _display ) then {
        _display closeDisplay 2;
    if ( time < _time ) then {
        cutText[ "Mission loading please wait", "BLACK", 0, true ];
        waitUntil{ time > _time };
    cutText[ "Enjoy!!!", "PLAIN", 0, true ];
If your using the Open variant of arsenal like above then it returns a reference to the arsenals display.

Share this post

Link to post
Share on other sites

Ey, thanks! That really got me in the right direction!

Due to how my script looked I obviously had to redo the way you did it quiet a bit but closeDisplay was what I was looking for!

if(_prepTime == 15)then{
	if !(isnull ( uinamespace getvariable "RSCDisplayArsenal" )) then {
		_display = ( uinamespace getvariable "RSCDisplayArsenal" );
		_display closeDisplay 2;
	removeAllActions player;

that's how I ended up forcing the player out of the arsenal.

I know the script looks a bit like shit :P


Thank you both for your help! :)

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