Advertisement
Thatguy5532

Untitled

Jun 1st, 2023
531
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 4.85 KB | None | 0 0
  1. // params["_player", "_fob"];
  2. params["_player"];
  3. private _fob = "";
  4.  
  5. private _choices = [
  6.     "Light Vehicles",
  7.     "Heavy Vehicles",
  8.     "Aircraft"
  9. ] apply {
  10.     [
  11.         [_x],
  12.         [],
  13.         [],
  14.         [],
  15.         _x,
  16.         _x
  17.     ]
  18. };
  19.  
  20. [
  21.     [
  22.         _choices,
  23.         4, // Selects the quadbike by default
  24.         false // Multi select disabled
  25.     ],
  26.     "What Type Of Vehicle",
  27.     [{
  28.         params["_player", "_fob"];
  29.  
  30.         private _success = false;
  31.  
  32.         try {
  33.             if (_confirmed) exitWith {
  34.                 switch (_index) do {
  35.                     case 0: {
  36.                         _success = [_player, _fob] call TRA_menuLightVeh;
  37.                         systemChat (str _success);
  38.                         _success
  39.                     };
  40.                     case 1: {
  41.                         _success = [_player, _fob] call TRA_menuHeavyVeh;
  42.                         systemChat (str _success);
  43.                         _success
  44.                     };
  45.                     case 2: {
  46.                         _success = [_player, _fob] call TRA_menuAircraft;
  47.                         systemChat (str _success);
  48.                         _success
  49.                     };
  50.                     default {
  51.                         diag_log "[TRA] Build Menu: something went wrong with _index";
  52.                         false
  53.                     };
  54.                 };
  55.             };
  56.         } catch {
  57.             throw _exception;
  58.         };
  59.  
  60.         systemChat (str _success);
  61.     },
  62.     [_player, _fob]
  63.     ],
  64.     "SELECT", // reverts to default
  65.     ""  // reverts to default, disable cancel option
  66. ] call CAU_UserInputMenus_fnc_listbox; 
  67.  
  68.  
  69. TRA_menuLightVeh = {
  70.     params["_player", "_fob"];
  71.     private _lightVeh = TRA_playerVehicles get "veh_light";
  72.  
  73.     private _vehicles = _lightVeh apply {
  74.         [
  75.             [getText(configFile >> "CfgVehicles" >> (_x select 0) >> "displayName")],
  76.             [format[" %1 | %2 | %3", [(_x select 1) select 0, 6] call TRA_fnc_format, [(_x select 1) select 1, 6] call TRA_fnc_format, [(_x select 1) select 2, 6] call TRA_fnc_format]],
  77.             [getText(configFile >> "CfgVehicles" >> (_x select 0) >> "picture")],
  78.             [],
  79.             getText(configFile >> "CfgVehicles" >> (_x select 0) >> "displayName"),
  80.             str _x,
  81.             getNumber(configFile >> "CfgVehicles" >> (_x select 0) >> "scope")
  82.         ]
  83.     };
  84.  
  85.     _vehicles = [[["Vehicle:"],[" Supply |  Ammo  |  Fuel  "],[],[],"Header","2"]] + _vehicles;
  86.     [
  87.         [
  88.             _vehicles,
  89.             4, // Selects the quadbike by default
  90.             false // Multi select disabled
  91.         ],
  92.         "Vehicle selection",
  93.         [{
  94.             params["_player", "_fob"];
  95.             private _parsedData = parseSimpleArray _data;
  96.             private _success = [_player, _parsedData select 0, _parsedData select 1, _fob] spawn TRA_fnc_build;
  97.             _success
  98.         },
  99.         [_player, _fob]
  100.         ],
  101.         "BUILD", // reverts to default
  102.         ""  // reverts to default, disable cancel option
  103.     ] call CAU_UserInputMenus_fnc_listbox; 
  104. };
  105.  
  106. TRA_menuHeavyVeh = {
  107.     params["_player"];
  108.     private _lightVeh = TRA_playerVehicles get "veh_heavy";
  109.  
  110.     private _vehicles = _lightVeh apply {
  111.         [
  112.             [getText(configFile >> "CfgVehicles" >> (_x select 0) >> "displayName")],
  113.             [format[" %1 | %2 | %3", [(_x select 1) select 0, 6] call TRA_fnc_format, [(_x select 1) select 1, 6] call TRA_fnc_format, [(_x select 1) select 2, 6] call TRA_fnc_format]],
  114.             [getText(configFile >> "CfgVehicles" >> (_x select 0) >> "picture")],
  115.             [],
  116.             getText(configFile >> "CfgVehicles" >> (_x select 0) >> "displayName"),
  117.             str _x,
  118.             getNumber(configFile >> "CfgVehicles" >> (_x select 0) >> "scope")
  119.         ]
  120.     };
  121.  
  122.     _vehicles = [[["Vehicle:"],["Supply  | Ammo    | Fuel   "],[],[],"Header","2"]] + _vehicles;
  123.     [
  124.         [
  125.             _vehicles,
  126.             4, // Selects the quadbike by default
  127.             false // Multi select disabled
  128.         ],
  129.         "Vehicle selection",
  130.         [{
  131.             params["_player"];
  132.             private _parsedData = parseSimpleArray _data;
  133.             private _success = [_player, _parsedData select 0, _parsedData select 1, false] spawn TRA_fnc_build;
  134.             _success
  135.         },
  136.         [_player]
  137.         ],
  138.         "BUILD", // reverts to default
  139.         ""  // reverts to default, disable cancel option
  140.     ] call CAU_UserInputMenus_fnc_listbox; 
  141. };
  142.  
  143. TRA_menuAircraft = {
  144.     params["_player"];
  145.     private _lightVeh = TRA_playerVehicles get "veh_aircraft";
  146.  
  147.     private _vehicles = _lightVeh apply {
  148.         [
  149.             [getText(configFile >> "CfgVehicles" >> (_x select 0) >> "displayName")],
  150.             [format[" %1 | %2 | %3", [(_x select 1) select 0, 6] call TRA_fnc_format, [(_x select 1) select 1, 6] call TRA_fnc_format, [(_x select 1) select 2, 6] call TRA_fnc_format]],
  151.             [getText(configFile >> "CfgVehicles" >> (_x select 0) >> "picture")],
  152.             [],
  153.             getText(configFile >> "CfgVehicles" >> (_x select 0) >> "displayName"),
  154.             str _x,
  155.             getNumber(configFile >> "CfgVehicles" >> (_x select 0) >> "scope")
  156.         ]
  157.     };
  158.  
  159.     _vehicles = [[["Vehicle:"],["Supply  | Ammo    | Fuel   "],[],[],"Header","2"]] + _vehicles;
  160.     [
  161.         [
  162.             _vehicles,
  163.             4, // Selects the quadbike by default
  164.             false // Multi select disabled
  165.         ],
  166.         "Vehicle selection",
  167.         [{
  168.             params["_player"];
  169.             private _parsedData = parseSimpleArray _data;
  170.             private _success = [_player, _parsedData select 0, _parsedData select 1, false] spawn TRA_fnc_build;
  171.             _success
  172.         },
  173.         [_player]
  174.         ],
  175.         "BUILD", // reverts to default
  176.         ""  // reverts to default, disable cancel option
  177.     ] call CAU_UserInputMenus_fnc_listbox; 
  178. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement