Jump to content

Earplugs for Epoch (Arma2) ?


higgibaby

Recommended Posts

I know that Script! Thx! I linked it in my Post, above. I had tested it and wanted to solved my RPT-Errors, but then I had more and more errors. I can implementet scripts, but i can`t scripting!
Can somebody translate that script into Arma2 (or help me)?

Link to comment
Share on other sites

I know that Script! Thx! I linked it in my Post, above. I had tested it and wanted to solved my RPT-Errors, but then I had more and more errors. I can implementet scripts, but i can`t scripting!

Can somebody translate that script into Arma2 (or help me)?

 

Sorry about that. I didn't click on the link. I had assumed it was a link to the A3 Epoch ear plug script. I didn't even notice that was an Arma 3 script!

Link to comment
Share on other sites

I made an earplugs script for our server.

just do the following:

 

1. in your fn_selfactions.sqf (I'll put it directly between DZE_HeliLift && DZE_HaloJump)

if (_inVehicle && (_vehicle isKindOf "Air") && (!Earplugs)) then {

    if (s_player_put_earplugs_on < 0) then {

        airvehicle = _vehicle;

        s_player_put_earplugs_on = airvehicle addAction ["Earplugs on","custom\earplugs_on.sqf","",5,false,true];

    };

        } else {

            if (!isNil "airvehicle") then {

                airvehicle removeAction s_player_put_earplugs_on;

                s_player_put_earplugs_on = -1;

            };

        };

        

if (_inVehicle && (_vehicle isKindOf "Air") && (Earplugs)) then {

    if (s_player_put_earplugs_off < 0) then {

        airvehicle = _vehicle;

        s_player_put_earplugs_off = airvehicle addAction ["Earplugs off","custom\earplugs_off.sqf","",5,false,true];

    };

        } else {

            if (!isNil "airvehicle") then {

                airvehicle removeAction s_player_put_earplugs_off;

                s_player_put_earplugs_off = -1;

            };

        };

 

2. earplugs_on.sqf (just a note: I made it so that when a player leaves the vehicle, the earplugs go off automaticly. you can take that part out if you dont want that. if so, delete everything from waituntil to the end.)

 

private [];

Earplugs = true;

    1 fadeSound 0.2;
    titleText [format["Earplugs are on"], "PLAIN DOWN"];

    waituntil {vehicle player == player};

    if (true) then {
        Earplugs = false;
        1 fadeSound 1;
    };

 

3. earplugs_off.sqf

 

private [];

Earplugs = false;

    1 fadeSound 1;
    titleText [format["Earplugs are off"], "PLAIN DOWN"];

 

4. in your variables.sqf, where all other variables get initialized put this:

 

    s_player_put_earplugs_on = -1;
    s_player_put_earplugs_off = -1;

 

and in the same file at the bottom:

 

//earplugs init
Earplugs = false;

 

hope it helps. could be done better I think. but Im still learning. :)

Link to comment
Share on other sites

@ BetterDeadThanZed: No problem; also my fault. Next time I make that more apparent!

 

@ seelenapparat:

 

Thank you very much for your answer! That's exactly what I imagine. But it will not work on my server and I got no RPT-errors, unhappily!

 

If I set "Earplugs = true;" it should be work, isn`t it? Do not care, I tested both!

 

Serverinfo: I use "Oripoch" without InfiStar.

 

Possibly there is a conflict on my Server! In addition I get no messages like "Earplugs on" or something like that. Could it be a scriptstarting problem?

 

Regards, higgi!

Link to comment
Share on other sites

good to hear that :)

 

its way better, when you can control the volume in a heli or plane.

 

Yes, it is! :)

 

Edit:

 

Normally it should worked without "private [];", isn`t it?

I don`t know why that line must be added. Although there is nothing configured!

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...
  • 1 month later...

Do the fn_selfActions.sqf part then make two seperate files, one called

 

earplugs_on.sqf (copy the code given for this)

 

and one called

 

earplugs_off.sqf (copy the code given for this)

 

then put both of those into your missions "custom" folder.

 

Do the variables.sqf part and you're done.

 

 

(Or just use the top earplugs script, it's a hell of a lot simpler for pretty much the same thing) :)

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...