Jump to content
  • 0

Disabling environment/ambient sounds and grass


potatochimp

Question

I am trying to add a script that toggles environment/ambient sounds on/off and, another that toggles grass on/off, to thedukes custom GUI menu:

I managed to get 2 different scripts to work for toggling grass on/off, but I'd like it to be in a single script so it's only 1 button on the menu, instead of 2.

I've tried this, but with no success:

if (getTerrainGrid < 50) then
{
   setTerrainGrid 50;
   systemChat('Grass disabled');
};
else
{
   setTerrainGrid 25;
   systemChat('Grass enabled');
};

so now I just have 2 buttons. 1 that sets terrain grid to 50, and the other to 25. I'm not even sure if that's how an if else is supposed to look, since I haven't done sql before.

 

I've had no luck in figuring out how to enable/disable ambient sounds.

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

getTerrainGrid is Arma 3 only.

if (isNil 'SetServerGrass') then {
   SetServerGrass = 1;	
   setTerrainGrid 50;
   systemChat('Grass disabled');
} else {
   SetServerGrass = nil;
   setTerrainGrid 25;
   systemChat('Grass enabled');
};
Use enableEnvironment to enable or disabled the environment.

https://community.bistudio.com/wiki/enableEnvironment
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...