Advertisement
Guest User

pabstmirrors tfr setup

a guest
Jan 25th, 2015
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //START: TFR Settings (PabstMirror) [2014/04/29] [TFR 0.9.0 Update]
  2. tf_no_auto_long_range_radio = true;
  3. tf_same_sw_frequencies_for_side = true;
  4. tf_same_lr_frequencies_for_side = true;
  5.  
  6. tf_freq_west =       [0 ,7, ["31","32","33","34","35","36","37","38","39"],0, nil, -1, 0];
  7. tf_freq_west_lr =    [3 ,7, ["31","32","33","34","35","36","37","38","39"],0, nil, -1, 0];
  8. tf_freq_east  =       [0 ,7, ["31","32","33","34","35","36","37","38","39"],0, nil, -1, 0];
  9. tf_freq_east_lr =    [3 ,7, ["31","32","33","34","35","36","37","38","39"],0, nil, -1, 0];
  10. tf_freq_guer  =      [0 ,7, ["31","32","33","34","35","36","37","38","39"],0, nil, -1, 0];
  11. tf_freq_guer_lr =      [3 ,7, ["31","32","33","34","35","36","37","38","39"],0, nil, -1, 0];
  12.  
  13. #define SIDE_ARRAY             ["GrpNATO", "GrpCSAT", "GrpAAF", "GrpFIA"]
  14. #define CHANNELS_ARRAYS         [["A1", "A2"], ["B1", "B2"], ["C1", "C2"], ["CO", "DC"], ["TH1", "TH", "TH3", "TH4", "AH1", "AH2"], ["IFV1", "IFV2", "IFV3", "IFV4", "IFV5", "IFV6", "TNK1"]]
  15.  
  16. [] spawn {
  17.    if (isDedicated) exitWith {};
  18.    waitUntil {player == player};
  19.    
  20.    _groupFreqIndex = -1;//Figure out what channel the player's group uses
  21.    {
  22.       _theSide = _x;
  23.       {
  24.          _theGroupArrayIndex = _forEachIndex;
  25.          {
  26.             if ((group player) == (missionNameSpace getVariable [(format ["%1_%2", _theSide, _x]), grpNull])) then {
  27.                _groupFreqIndex = _theGroupArrayIndex;
  28.             };
  29.          } forEach _x;
  30.       } forEach CHANNELS_ARRAYS;
  31.       if (_groupFreqIndex != -1) exitWith {};
  32.    } forEach SIDE_ARRAY;
  33.    
  34.    if (_groupFreqIndex == -1) then {
  35.       systemChat format ["I have no idea what group you are in"];
  36.       _groupFreqIndex = 0;
  37.    };
  38.    
  39.    waitUntil {
  40.       sleep 1;
  41.       _swRadioList = [] call TFAR_fnc_radiosListSorted;
  42.       (!isNil "_swRadioList") && {(count _swRadioList) > 0}
  43.    };
  44.    sleep 1;
  45.    _swRadioList = [] call TFAR_fnc_radiosListSorted;
  46.    
  47.    {
  48.       if ((_forEachIndex == 0) || (_forEachIndex < ((count _swRadioList) - 1))) then {   //First Or No Last)
  49.          [_x, _groupFreqIndex] call TFAR_fnc_setSwChannel;
  50.          // if (((count _swRadioList) == 1) || (_forEachIndex != 0)) then {
  51.          systemChat format ["SR Radio [%1] is set to [CH %2]", _x, (_groupFreqIndex + 1)];
  52.          // } else {
  53.          // systemChat format ["SR Radio [%1] is set to [CH %2] and [CH 4]", _x, (_groupFreqIndex + 1)];
  54.          // [_x, 3] call TFAR_fnc_setAdditionalSwChannel;
  55.          // };
  56.       } else {   //Last radio, when you have more than 1, is set to command.
  57.          [_x, 3] call TFAR_fnc_setSwChannel;
  58.          systemChat format ["Last SR Radio [%1] is set to Command [CH 4]", _x];
  59.       };
  60.    } forEach _swRadioList;
  61.    
  62.    if (player getVariable ["shouldHaveRadioBackpack", false]) then {      //this is all because TFR fucks up when you have a backpack at mission start, won't need if it gets patched out
  63.       systemChat format ["Setting Up Long Range Radio Backpack [Channel 4]"];
  64.       _backpackItems = backpackItems player;   //backup items
  65.       removeBackpack player;
  66.       switch ((player call BIS_fnc_objectSide)) do {
  67.       case (west): {player addBackpack "tf_rt1523g";};
  68.       case (east): {player addBackpack "tf_mr3000";};
  69.          default {player addBackpack "tf_anprc155";};
  70.       };
  71.       {player addItemToBackpack _x;   } forEach _backpackItems; //add old bp items to new radio bp
  72.    };
  73.    systemChat "-Radio Setup Complete-";
  74. };
  75. //END: TFR Settings (PabstMirror)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement