Home   Help Search Login Register  

Author Topic: Regarding This Script Tweeked for Arma2 OA? Mando Music  (Read 2311 times)

0 Members and 1 Guest are viewing this topic.

Offline mattchicago

  • Members
  • *
So i was looking at some "scripted" type of music players and well it does not work, i tried to add it to a unit, vehicle in the init line and also as well in the init.sqf file as well for this command the problem is listed below

1. you have to spawn a playable vehicle (unit) as driver or whatever for it to work.
2. it does not load the defined music below in the config music section.

Possibly someone can tweek these scripts to make it work its pretty brilliant actually, the clay_carradio i got to work without having to use the "pbo files as a mod but for some reason its lagging the server.


[]execVM "mando_checkradio.sqf"


script for mando_checkradio.swf

Code: [Select]
// mando_checkradio.sqf
// By Mandoble May 2007
// add an action to tune up musics and controls the volume based on distance and in/out vehicle

private ["_radio", "_op", "_volin", "_volout"];
_radio = false;
_op = 0;
_volin = musicVolume;
_volout = _volin*3/5;
while {true} do
{
   if (!_radio && (vehicle player == radio)) then
   {
      _op = radio addAction ["Tune music", "mando_showplayer.sqf"];
      _radio = true;
   };   
   if (_radio && (vehicle player != radio)) then
   {
      radio removeAction _op;
      _radio = false;
   };

   if (vehicle player distance radio < 10) then
   {
      if (vehicle player == radio) then
      {
         0.1 fadeMusic _volin;
      }
      else
      {
         0.1 fadeMusic _volout;
      };
   }
   else
   {
      0.1 fadeMusic (10/(vehicle player distance radio)*_volout);
   };
   Sleep 0.1;
};

For the mando_playtrack.sqf file

Code: [Select]
// mando_playtrack.sqf
// By Mandoble May 2007
// Handler of onLBSelChanged event configured in description.ext for the music list

disableSerialization;
_control = _this select 0;
_index = _this select 1;
_displaym = findDisplay 100;
(_displaym displayCtrl 103) ctrlSetText (_control lbData _index);
0 fadeMusic 1;
playMusic (_control lbData _index);

and for the last file mando_showplayer.sqf file

Code: [Select]
// mando_showplayer.sqf
// By Mandoble May 2007
// Executed by action menu added to player
private["_ok", "_displaym", "_list", "_cfg", "_count", "_i"];
disableSerialization;
_ok = createDialog "DlgMandoMusic";
Sleep 0.1;
_displaym = findDisplay 100;
_list = _displaym displayCtrl 102;
_cfg =(configFile >> "CfgMusic");
//_count = count _cfg;
_count = 34;
for [{_i = 1},{_i < _count},{_i = _i + 1}] do
{
   _cfgi = _cfg select _i;
   _index = _list lbAdd (getText (_cfgi >> "Name"));
   _list lbSetData [_index, format["%1", configName _cfgi]];
};
(_displaym displayCtrl 103) ctrlSetTooltip "Copy/Paste this to use with playMusic command";

class CfgMusic
{
tracks[]={matallica, nineinch, korn};

  class matallica
 {
  name = "matallica";
  sound[] = {"music\matallicamashup.ogg", db+10, 1.0};
 };
 class nineinch
 {
  name = "nineinch";
  sound[] = {"music\ninvsnellymashup.ogg", db+10, 1.0};
 };
 class korn
 {
  name = "korn";
  sound[] = {"music\kornevolutionremix.ogg", db+10, 1.0};
 };
 class kanye
 {
  name = "kanye";
  sound[] = {"music\kanyewestjesuswalks.ogg", db+10, 1.0};
 };
 class beadz
 {
  name = "beadz";
  sound[] = {"music\BeadzAmyWinehouse.ogg", db+10, 1.0};
 };
 class djaxe
 {
  name = "djaxe";
  sound[] = {"music\DJAxeGalvanize.ogg", db+10, 1.0};
 };
  class rollingdeep
 {
  name = "rollingdeep";
  sound[] = {"music\RollingIntheDeep.ogg", db+10, 1.0};
 };
 class punjabi
 {
  name = "punjabi";
  sound[] = {"music\PanjabiMCMundianToBachKe.ogg", db+10, 1.0};
 };
 class hendrix
 {
  name = "hendrix";
  sound[] = {"music\JimiHendrixvsLedZeppelin.ogg", db+10, 1.0};
 };
 class limpb
 {
  name = "limpb";
  sound[] = {"music\JameliavsLimpBizkitRollin.ogg", db+10, 1.0};
 };
 class octlet
 {
  name = "octlet";
  sound[] = {"music\OcelotOurTime.ogg", db+10, 1.0};
 };
 class weroll
 {
  name = "weroll";
  sound[] = {"music\DonOmarHowWeRoll.ogg", db+10, 1.0};
 };
};