Skip to content

Instantly share code, notes, and snippets.

@commy2
Last active June 20, 2019 19:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save commy2/052eeb4ebf487e0366eddea4836204ca to your computer and use it in GitHub Desktop.
Save commy2/052eeb4ebf487e0366eddea4836204ca to your computer and use it in GitHub Desktop.
boombox addaction ["Radion on", {
// make scheduler atomic
isNil {
// delete previsous sound source
private _soundSource = boombox getVariable ["Mission_soundSource", objNull];
deleteVehicle _soundSource;
// play sound and store sound source
_soundSource = allMissionObjects "#soundonvehicle";
boombox say3D ["track01", 100, 1];
_soundSource = allMissionObjects "#soundonvehicle" - _soundSource select 0;
boombox setVariable ["Mission_soundSource", _soundSource];
};
}];
boombox addaction ["Radio off", {
// make scheduler atomic
isNil {
// delete previsous sound source
private _soundSource = boombox getVariable ["Mission_soundSource", objNull];
deleteVehicle _soundSource;
};
}];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment