Guest User

Generate Airplane / Helicopter

a guest
May 18th, 2013
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 45.54 KB | None | 0 0
  1. Hi,
  2.  
  3. I'm having some issues with the addgroup script, it seems that sometimes it works and sometimes it doesn't :huh:
  4.  
  5. The trigger is simple -
  6. Switched condition - Group dead - Do script, activate group.
  7. [SPOILER]coalition.addGroup(country.id.USA, Group.Category.AIRPLANE, {
  8.                                 ["modulation"] = 0,
  9.                                 ["tasks"] =
  10.                                 {
  11.                                 }, -- end of ["tasks"]
  12.                                 ["radioSet"] = false,
  13.                                 ["task"] = "CAP",
  14.                                 ["uncontrolled"] = false,
  15.                                 ["route"] =
  16.                                 {
  17.                                     ["points"] =
  18.                                     {
  19.                                         [1] =
  20.                                         {
  21.                                             ["alt"] = 320,
  22.                                             ["type"] = "TakeOff",
  23.                                             ["action"] = "From Runway",
  24.                                             ["alt_type"] = "BARO",
  25.                                             ["formation_template"] = "",
  26.                                             ["properties"] =
  27.                                             {
  28.                                                 ["vnav"] = 1,
  29.                                                 ["scale"] = 0,
  30.                                                 ["angle"] = 0,
  31.                                                 ["vangle"] = 0,
  32.                                                 ["steer"] = 2,
  33.                                             }, -- end of ["properties"]
  34.                                             ["ETA"] = 0,
  35.                                             ["airdromeId"] = 26,
  36.                                             ["y"] = 705718.47981263,
  37.                                             ["x"] = -51251.551717591,
  38.                                             ["speed"] = 138.88888888889,
  39.                                             ["ETA_locked"] = true,
  40.                                             ["task"] =
  41.                                             {
  42.                                                 ["id"] = "ComboTask",
  43.                                                 ["params"] =
  44.                                                 {
  45.                                                     ["tasks"] =
  46.                                                     {
  47.                                                         [1] =
  48.                                                         {
  49.                                                             ["enabled"] = true,
  50.                                                             ["key"] = "CAP",
  51.                                                             ["id"] = "EngageTargets",
  52.                                                             ["number"] = 1,
  53.                                                             ["auto"] = true,
  54.                                                             ["params"] =
  55.                                                             {
  56.                                                                 ["targetTypes"] =
  57.                                                                 {
  58.                                                                     [1] = "Air",
  59.                                                                 }, -- end of ["targetTypes"]
  60.                                                                 ["priority"] = 0,
  61.                                                             }, -- end of ["params"]
  62.                                                         }, -- end of [1]
  63.                                                         [2] =
  64.                                                         {
  65.                                                             ["number"] = 2,
  66.                                                             ["auto"] = false,
  67.                                                             ["id"] = "WrappedAction",
  68.                                                             ["enabled"] = true,
  69.                                                             ["params"] =
  70.                                                             {
  71.                                                                 ["action"] =
  72.                                                                 {
  73.                                                                     ["id"] = "Option",
  74.                                                                     ["params"] =
  75.                                                                     {
  76.                                                                         ["value"] = 1,
  77.                                                                         ["name"] = 0,
  78.                                                                     }, -- end of ["params"]
  79.                                                                 }, -- end of ["action"]
  80.                                                             }, -- end of ["params"]
  81.                                                         }, -- end of [2]
  82.                                                     }, -- end of ["tasks"]
  83.                                                 }, -- end of ["params"]
  84.                                             }, -- end of ["task"]
  85.                                             ["speed_locked"] = true,
  86.                                         }, -- end of [1]
  87.                                         [2] =
  88.                                         {
  89.                                             ["alt"] = 1524,
  90.                                             ["type"] = "Turning Point",
  91.                                             ["action"] = "Turning Point",
  92.                                             ["alt_type"] = "BARO",
  93.                                             ["formation_template"] = "",
  94.                                             ["properties"] =
  95.                                             {
  96.                                                 ["vnav"] = 1,
  97.                                                 ["scale"] = 0,
  98.                                                 ["angle"] = 0,
  99.                                                 ["vangle"] = 0,
  100.                                                 ["steer"] = 2,
  101.                                             }, -- end of ["properties"]
  102.                                             ["ETA"] = 390.41662629717,
  103.                                             ["y"] = 744407.42857143,
  104.                                             ["x"] = -104979.42857143,
  105.                                             ["speed"] = 169.58333333333,
  106.                                             ["ETA_locked"] = false,
  107.                                             ["task"] =
  108.                                             {
  109.                                                 ["id"] = "ComboTask",
  110.                                                 ["params"] =
  111.                                                 {
  112.                                                     ["tasks"] =
  113.                                                     {
  114.                                                         [1] =
  115.                                                         {
  116.                                                             ["enabled"] = true,
  117.                                                             ["auto"] = false,
  118.                                                             ["id"] = "Orbit",
  119.                                                             ["number"] = 1,
  120.                                                             ["params"] =
  121.                                                             {
  122.                                                                 ["altitude"] = 1524,
  123.                                                                 ["pattern"] = "Race-Track",
  124.                                                                 ["speed"] = 169.58333333333,
  125.                                                                 ["speedEdited"] = true,
  126.                                                             }, -- end of ["params"]
  127.                                                         }, -- end of [1]
  128.                                                     }, -- end of ["tasks"]
  129.                                                 }, -- end of ["params"]
  130.                                             }, -- end of ["task"]
  131.                                             ["speed_locked"] = true,
  132.                                         }, -- end of [2]
  133.                                         [3] =
  134.                                         {
  135.                                             ["alt"] = 333,
  136.                                             ["type"] = "Turning Point",
  137.                                             ["action"] = "Turning Point",
  138.                                             ["alt_type"] = "BARO",
  139.                                             ["formation_template"] = "",
  140.                                             ["properties"] =
  141.                                             {
  142.                                                 ["vnav"] = 1,
  143.                                                 ["scale"] = 0,
  144.                                                 ["angle"] = 0,
  145.                                                 ["vangle"] = 0,
  146.                                                 ["steer"] = 2,
  147.                                             }, -- end of ["properties"]
  148.                                             ["ETA"] = 825.1362291002,
  149.                                             ["y"] = 800407.42857143,
  150.                                             ["x"] = -82408,
  151.                                             ["speed"] = 138.88888888889,
  152.                                             ["ETA_locked"] = false,
  153.                                             ["task"] =
  154.                                             {
  155.                                                 ["id"] = "ComboTask",
  156.                                                 ["params"] =
  157.                                                 {
  158.                                                     ["tasks"] =
  159.                                                     {
  160.                                                     }, -- end of ["tasks"]
  161.                                                 }, -- end of ["params"]
  162.                                             }, -- end of ["task"]
  163.                                             ["speed_locked"] = true,
  164.                                         }, -- end of [3]
  165.                                     }, -- end of ["points"]
  166.                                 }, -- end of ["route"]
  167.                                 ["groupId"] = 287,
  168.                                 ["hidden"] = false,
  169.                                 ["units"] =
  170.                                 {
  171.                                     [1] =
  172.                                     {
  173.                                         ["alt"] = 320,
  174.                                         ["heading"] = 2.5175098164787,
  175.                                         ["callsign"] =
  176.                                         {
  177.                                             [1] = 4,
  178.                                             [2] = 1,
  179.                                             [3] = 1,
  180.                                             ["name"] = "Colt11",
  181.                                         }, -- end of ["callsign"]
  182.                                         ["psi"] = -2.5175098164787,
  183.                                         ["livery_id"] = "19th Fighter SQN (AK)",
  184.                                         ["onboard_num"] = "55",
  185.                                         ["type"] = "F-15C",
  186.                                         ["y"] = 705718.47981263,
  187.                                         ["x"] = -51251.551717591,
  188.                                         ["name"] = "F15_1",
  189.                                         ["payload"] =
  190.                                         {
  191.                                             ["pylons"] =
  192.                                             {
  193.                                                 [1] =
  194.                                                 {
  195.                                                     ["CLSID"] = "{D078E3E5-30C1-444e-A09E-6EEDCD334582}",
  196.                                                 }, -- end of [1]
  197.                                                 [2] =
  198.                                                 {
  199.                                                     ["CLSID"] = "{E1F29B21-F291-4589-9FD8-3272EEC69506}",
  200.                                                 }, -- end of [2]
  201.                                                 [3] =
  202.                                                 {
  203.                                                     ["CLSID"] = "{6CEB49FC-DED8-4DED-B053-E1F033FF72D3}",
  204.                                                 }, -- end of [3]
  205.                                                 [4] =
  206.                                                 {
  207.                                                     ["CLSID"] = "{8D399DDA-FF81-4F14-904D-099B34FE7918}",
  208.                                                 }, -- end of [4]
  209.                                                 [5] =
  210.                                                 {
  211.                                                     ["CLSID"] = "{02CAFD34-010A-4874-8506-4A7C89210353}",
  212.                                                 }, -- end of [5]
  213.                                                 [6] =
  214.                                                 {
  215.                                                     ["CLSID"] = "{E1F29B21-F291-4589-9FD8-3272EEC69506}",
  216.                                                 }, -- end of [6]
  217.                                                 [7] =
  218.                                                 {
  219.                                                     ["CLSID"] = "{8D399DDA-FF81-4F14-904D-099B34FE7918}",
  220.                                                 }, -- end of [7]
  221.                                                 [8] =
  222.                                                 {
  223.                                                     ["CLSID"] = "{33556742-C0F5-4643-BD8F-530B4DEC719B}",
  224.                                                 }, -- end of [8]
  225.                                                 [9] =
  226.                                                 {
  227.                                                     ["CLSID"] = "{6CEB49FC-DED8-4DED-B053-E1F033FF72D3}",
  228.                                                 }, -- end of [9]
  229.                                                 [10] =
  230.                                                 {
  231.                                                     ["CLSID"] = "{E1F29B21-F291-4589-9FD8-3272EEC69506}",
  232.                                                 }, -- end of [10]
  233.                                                 [11] =
  234.                                                 {
  235.                                                     ["CLSID"] = "{34271A1E-477E-4754-8C72-DF7C1855A782}",
  236.                                                 }, -- end of [11]
  237.                                             }, -- end of ["pylons"]
  238.                                             ["fuel"] = "6103",
  239.                                             ["flare"] = 60,
  240.                                             ["chaff"] = 120,
  241.                                             ["gun"] = 100,
  242.                                         }, -- end of ["payload"]
  243.                                         ["speed"] = 138.88888888889,
  244.                                         ["unitId"] = 475,
  245.                                         ["alt_type"] = "BARO",
  246.                                         ["skill"] = "Random",
  247.                                     }, -- end of [1]
  248.                                 }, -- end of ["units"]
  249.                                 ["y"] = 705718.47981263,
  250.                                 ["x"] = -51251.551717591,
  251.                                 ["name"] = "AI - F-15C",
  252.                                 ["communication"] = true,
  253.                                 ["start_time"] = 0,
  254.                                 ["frequency"] = 124,
  255.                             })[/SPOILER]
  256.  
  257. After the F-15 is destroyed it should be respawning at the Miner...Vody, in Runway position, it sometimes work and sometimes doesn't, I've tried to experiment with the other takeoff options such as ramp and hot, both don't work - no spawn at all.
  258. Another issue is that if i destroy the F-15 The trigger will sometimes start before I get the kill message and the score.
  259.  
  260. Is there a way to change the trigger to fix these issues?
  261.  
  262.  
  263. 2nd thing, I want to add an option to spawn an airplane using the radio menu, I'm trying to impliment the AddCommandForGroup option but I need some help, here is the script (this is the first attempt to make somthing, pretty sure i messed it up :doh:) -
  264.  
  265. [SPOILER]groupid = 800
  266.  
  267. a10c =      (
  268.                                 ["groupId"] = groupid,
  269.                                 ["hidden"] = false,
  270.                                 ["units"] =
  271.                                 {
  272.                                     [1] =
  273.                                     {
  274.                                         ["alt"] = 449,
  275.                                         ["heading"] = 0,
  276.                                         ["callsign"] =
  277.                                         {
  278.                                             [1] = 6,
  279.                                             [2] = 1,
  280.                                             [3] = 1,
  281.                                             ["name"] = "Ford11",
  282.                                         }, -- end of ["callsign"]
  283.                                         ["psi"] = 0,
  284.                                         ["livery_id"] = "104th FS Maryland ANG, Baltimore (MD)",
  285.                                         ["onboard_num"] = "56",
  286.                                         ["type"] = "A-10C",
  287.                                         ["y"] = 895424.57142858,
  288.                                         ["x"] = -317838.57142857,
  289.                                         ["name"] = "A-10C" .. groupid,
  290.                                         ["payload"] =
  291.                                         {
  292.                                             ["pylons"] =
  293.                                             {
  294.                                                 [1] =
  295.                                                 {
  296.                                                     ["CLSID"] = "{DB434044-F5D0-4F1F-9BA9-B73027E18DD3}",
  297.                                                 }, -- end of [1]
  298.                                                 [11] =
  299.                                                 {
  300.                                                     ["CLSID"] = "{DB434044-F5D0-4F1F-9BA9-B73027E18DD3}",
  301.                                                 }, -- end of [11]
  302.                                             }, -- end of ["pylons"]
  303.                                             ["fuel"] = 2515,
  304.                                             ["flare"] = 120,
  305.                                             ["ammo_type"] = 1,
  306.                                             ["chaff"] = 240,
  307.                                             ["gun"] = 100,
  308.                                         }, -- end of ["payload"]
  309.                                         ["speed"] = 138.88888888889,
  310.                                         ["unitId"] = groupid,
  311.                                         ["alt_type"] = "BARO",
  312.                                         ["skill"] = "Random",
  313.                                     }, -- end of [1]
  314.                                 }, -- end of ["units"]
  315.                                 ["y"] = 895424.57142858,
  316.                                 ["x"] = -317838.57142857,
  317.                                 ["name"] = "A-10C" .. groupid,
  318.                                 ["communication"] = true,
  319.                                 ["start_time"] = 0,
  320.                                 ["modulation"] = 0,
  321.                                 ["frequency"] = 124,
  322.             ),
  323. mig29s =    (
  324.                                 ["groupId"] = groupid,
  325.                                 ["hidden"] = false,
  326.                                 ["units"] =
  327.                                 {
  328.                                     [1] =
  329.                                     {
  330.                                         ["alt"] = 449,
  331.                                         ["heading"] = 0,
  332.                                         ["callsign"] = 113,
  333.                                         ["psi"] = 0,
  334.                                         ["livery_id"] = "1038th guards ctc, mary ab",
  335.                                         ["onboard_num"] = "56",
  336.                                         ["type"] = "MiG-29S",
  337.                                         ["y"] = 895424.57142858,
  338.                                         ["x"] = -317838.57142857,
  339.                                         ["name"] = "Mig-29" .. groupid,
  340.                                         ["payload"] =
  341.                                         {
  342.                                             ["pylons"] =
  343.                                             {
  344.                                                 [1] =
  345.                                                 {
  346.                                                     ["CLSID"] = "{682A481F-0CB5-4693-A382-D00DD4A156D7}",
  347.                                                 }, -- end of [1]
  348.                                                 [2] =
  349.                                                 {
  350.                                                     ["CLSID"] = "{682A481F-0CB5-4693-A382-D00DD4A156D7}",
  351.                                                 }, -- end of [2]
  352.                                                 [7] =
  353.                                                 {
  354.                                                     ["CLSID"] = "{682A481F-0CB5-4693-A382-D00DD4A156D7}",
  355.                                                 }, -- end of [7]
  356.                                                 [6] =
  357.                                                 {
  358.                                                     ["CLSID"] = "{682A481F-0CB5-4693-A382-D00DD4A156D7}",
  359.                                                 }, -- end of [6]
  360.                                             }, -- end of ["pylons"]
  361.                                             ["fuel"] = "3500",
  362.                                             ["flare"] = 30,
  363.                                             ["chaff"] = 30,
  364.                                             ["gun"] = 100,
  365.                                         }, -- end of ["payload"]
  366.                                         ["speed"] = 138.88888888889,
  367.                                         ["unitId"] = 487,
  368.                                         ["alt_type"] = "BARO",
  369.                                         ["skill"] = "Random",
  370.                                     }, -- end of [1]
  371.                                 }, -- end of ["units"]
  372.                                 ["y"] = 895424.57142858,
  373.                                 ["x"] = -317838.57142857,
  374.                                 ["name"] = "Mig-29S" .. groupid,
  375.                                 ["communication"] = true,
  376.                                 ["start_time"] = 0,
  377.                                 ["modulation"] = 0,
  378.                                 ["frequency"] = 124,
  379.             ),
  380. f15c =      (
  381.                                 ["groupId"] = groupid,
  382.                                 ["hidden"] = false,
  383.                                 ["units"] =
  384.                                 {
  385.                                     [1] =
  386.                                     {
  387.                                         ["alt"] = 449,
  388.                                         ["heading"] = 0,
  389.                                         ["callsign"] =
  390.                                         {
  391.                                             [1] = 6,
  392.                                             [2] = 1,
  393.                                             [3] = 1,
  394.                                             ["name"] = "Ford11",
  395.                                         }, -- end of ["callsign"]
  396.                                         ["psi"] = 0,
  397.                                         ["livery_id"] = "19th Fighter SQN (AK)",
  398.                                         ["onboard_num"] = "56",
  399.                                         ["type"] = "F-15C",
  400.                                         ["y"] = 895424.57142858,
  401.                                         ["x"] = -317838.57142857,
  402.                                         ["name"] = "F-15C" .. groupid,
  403.                                         ["payload"] =
  404.                                         {
  405.                                             ["pylons"] =
  406.                                             {
  407.                                                 [1] =
  408.                                                 {
  409.                                                     ["CLSID"] = "{6CEB49FC-DED8-4DED-B053-E1F033FF72D3}",
  410.                                                 }, -- end of [1]
  411.                                                 [11] =
  412.                                                 {
  413.                                                     ["CLSID"] = "{6CEB49FC-DED8-4DED-B053-E1F033FF72D3}",
  414.                                                 }, -- end of [11]
  415.                                                 [9] =
  416.                                                 {
  417.                                                     ["CLSID"] = "{9BFD8C90-F7AE-4e90-833B-BFD0CED0E536}",
  418.                                                 }, -- end of [9]
  419.                                                 [3] =
  420.                                                 {
  421.                                                     ["CLSID"] = "{9BFD8C90-F7AE-4e90-833B-BFD0CED0E536}",
  422.                                                 }, -- end of [3]
  423.                                             }, -- end of ["pylons"]
  424.                                             ["fuel"] = "6103",
  425.                                             ["flare"] = 60,
  426.                                             ["chaff"] = 120,
  427.                                             ["gun"] = 100,
  428.                                         }, -- end of ["payload"]
  429.                                         ["speed"] = 138.88888888889,
  430.                                         ["unitId"] = 485,
  431.                                         ["alt_type"] = "BARO",
  432.                                         ["skill"] = "Random",
  433.                                     }, -- end of [1]
  434.                                 }, -- end of ["units"]
  435.                                 ["y"] = 895424.57142858,
  436.                                 ["x"] = -317838.57142857,
  437.                                 ["name"] = "F-15C" .. groupid,
  438.                                 ["communication"] = true,
  439.                                 ["start_time"] = 0,
  440.                                 ["modulation"] = 0,
  441.                                 ["frequency"] = 124,
  442.             ),
  443. su27 =      (
  444.                                 ["groupId"] = groupid,
  445.                                 ["hidden"] = false,
  446.                                 ["units"] =
  447.                                 {
  448.                                     [1] =
  449.                                     {
  450.                                         ["alt"] = 449,
  451.                                         ["heading"] = 0,
  452.                                         ["callsign"] = 115,
  453.                                         ["psi"] = 0,
  454.                                         ["livery_id"] = "Air Force Standard",
  455.                                         ["onboard_num"] = "56",
  456.                                         ["type"] = "Su-27",
  457.                                         ["y"] = 895424.57142858,
  458.                                         ["x"] = -317838.57142857,
  459.                                         ["name"] = "Su-27" .. groupid,
  460.                                         ["payload"] =
  461.                                         {
  462.                                             ["pylons"] =
  463.                                             {
  464.                                                 [1] =
  465.                                                 {
  466.                                                     ["CLSID"] = "{FBC29BFE-3D24-4C64-B81D-941239D12249}",
  467.                                                 }, -- end of [1]
  468.                                                 [2] =
  469.                                                 {
  470.                                                     ["CLSID"] = "{FBC29BFE-3D24-4C64-B81D-941239D12249}",
  471.                                                 }, -- end of [2]
  472.                                                 [9] =
  473.                                                 {
  474.                                                     ["CLSID"] = "{FBC29BFE-3D24-4C64-B81D-941239D12249}",
  475.                                                 }, -- end of [9]
  476.                                                 [10] =
  477.                                                 {
  478.                                                     ["CLSID"] = "{FBC29BFE-3D24-4C64-B81D-941239D12249}",
  479.                                                 }, -- end of [10]
  480.                                             }, -- end of ["pylons"]
  481.                                             ["fuel"] = "9400",
  482.                                             ["flare"] = 96,
  483.                                             ["chaff"] = 96,
  484.                                             ["gun"] = 100,
  485.                                         }, -- end of ["payload"]
  486.                                         ["speed"] = 138.88888888889,
  487.                                         ["unitId"] = 490,
  488.                                         ["alt_type"] = "BARO",
  489.                                         ["skill"] = "Random",
  490.                                     }, -- end of [1]
  491.                                 }, -- end of ["units"]
  492.                                 ["y"] = 895424.57142858,
  493.                                 ["x"] = -317838.57142857,
  494.                                 ["name"] = "Su-27" .. groupid,
  495.                                 ["communication"] = true,
  496.                                 ["start_time"] = 0,
  497.                                 ["modulation"] = 0,
  498.                                 ["frequency"] = 124,
  499.             ),
  500. su33 =      (
  501.                                 ["groupId"] = groupid,
  502.                                 ["hidden"] = false,
  503.                                 ["units"] =
  504.                                 {
  505.                                     [1] =
  506.                                     {
  507.                                         ["alt"] = 449,
  508.                                         ["heading"] = 0,
  509.                                         ["callsign"] = 116,
  510.                                         ["psi"] = 0,
  511.                                         ["livery_id"] = "279th kiap 1st squad navy",
  512.                                         ["onboard_num"] = "56",
  513.                                         ["type"] = "Su-33",
  514.                                         ["y"] = 895424.57142858,
  515.                                         ["x"] = -317838.57142857,
  516.                                         ["name"] = "Su-33" .. groupid,
  517.                                         ["payload"] =
  518.                                         {
  519.                                             ["pylons"] =
  520.                                             {
  521.                                                 [11] =
  522.                                                 {
  523.                                                     ["CLSID"] = "{FBC29BFE-3D24-4C64-B81D-941239D12249}",
  524.                                                 }, -- end of [11]
  525.                                                 [2] =
  526.                                                 {
  527.                                                     ["CLSID"] = "{FBC29BFE-3D24-4C64-B81D-941239D12249}",
  528.                                                 }, -- end of [2]
  529.                                                 [12] =
  530.                                                 {
  531.                                                     ["CLSID"] = "{FBC29BFE-3D24-4C64-B81D-941239D12249}",
  532.                                                 }, -- end of [12]
  533.                                                 [1] =
  534.                                                 {
  535.                                                     ["CLSID"] = "{FBC29BFE-3D24-4C64-B81D-941239D12249}",
  536.                                                 }, -- end of [1]
  537.                                             }, -- end of ["pylons"]
  538.                                             ["fuel"] = "9400",
  539.                                             ["flare"] = 48,
  540.                                             ["chaff"] = 48,
  541.                                             ["gun"] = 100,
  542.                                         }, -- end of ["payload"]
  543.                                         ["speed"] = 138.88888888889,
  544.                                         ["unitId"] = 491,
  545.                                         ["alt_type"] = "BARO",
  546.                                         ["skill"] = "Random",
  547.                                     }, -- end of [1]
  548.                                 }, -- end of ["units"]
  549.                                 ["y"] = 895424.57142858,
  550.                                 ["x"] = -317838.57142857,
  551.                                 ["name"] = "Su-33" .. groupid,
  552.                                 ["communication"] = true,
  553.                                 ["start_time"] = 0,
  554.                                 ["modulation"] = 0,
  555.                                 ["frequency"] = 124,
  556.             ),
  557. p51d =      (
  558.                                 ["groupId"] = groupid,
  559.                                 ["hidden"] = false,
  560.                                 ["units"] =
  561.                                 {
  562.                                     [1] =
  563.                                     {
  564.                                         ["alt"] = 449,
  565.                                         ["heading"] = 0,
  566.                                         ["callsign"] =
  567.                                         {
  568.                                             [1] = 6,
  569.                                             [2] = 1,
  570.                                             [3] = 1,
  571.                                             ["name"] = "Ford11",
  572.                                         }, -- end of ["callsign"]
  573.                                         ["psi"] = 0,
  574.                                         ["livery_id"] = "DCS_P51D_Big_Dick",
  575.                                         ["onboard_num"] = "56",
  576.                                         ["type"] = "P-51D",
  577.                                         ["y"] = 895424.57142858,
  578.                                         ["x"] = -317838.57142857,
  579.                                         ["name"] = "P-51D" .. groupid,
  580.                                         ["payload"] =
  581.                                         {
  582.                                             ["pylons"] =
  583.                                             {
  584.                                             }, -- end of ["pylons"]
  585.                                             ["fuel"] = 366,
  586.                                             ["flare"] = 0,
  587.                                             ["chaff"] = 0,
  588.                                             ["gun"] = 100,
  589.                                         }, -- end of ["payload"]
  590.                                         ["speed"] = 138.88888888889,
  591.                                         ["unitId"] = 484,
  592.                                         ["alt_type"] = "BARO",
  593.                                         ["skill"] = "Random",
  594.                                     }, -- end of [1]
  595.                                 }, -- end of ["units"]
  596.                                 ["y"] = 895424.57142858,
  597.                                 ["x"] = -317838.57142857,
  598.                                 ["name"] = "P-51D" .. groupid,
  599.                                 ["communication"] = true,
  600.                                 ["start_time"] = 0,
  601.                                 ["modulation"] = 0,
  602.                                 ["frequency"] = 124,
  603.             ),
  604. ka50 =      (
  605.                                 ["groupId"] = groupid,
  606.                                 ["hidden"] = false,
  607.                                 ["units"] =
  608.                                 {
  609.                                     [1] =
  610.                                     {
  611.                                         ["alt"] = 449,
  612.                                         ["heading"] = 0,
  613.                                         ["callsign"] = 118,
  614.                                         ["psi"] = 0,
  615.                                         ["livery_id"] = "Russia Demo #024",
  616.                                         ["onboard_num"] = "57",
  617.                                         ["type"] = "Ka-50",
  618.                                         ["y"] = 895424.57142858,
  619.                                         ["x"] = -317838.57142857,
  620.                                         ["name"] = "Ka-50" .. groupid,
  621.                                         ["payload"] =
  622.                                         {
  623.                                             ["pylons"] =
  624.                                             {
  625.                                             }, -- end of ["pylons"]
  626.                                             ["fuel"] = "1450",
  627.                                             ["flare"] = 128,
  628.                                             ["chaff"] = 0,
  629.                                             ["gun"] = 100,
  630.                                         }, -- end of ["payload"]
  631.                                         ["speed"] = 41.666666666667,
  632.                                         ["unitId"] = 498,
  633.                                         ["alt_type"] = "BARO",
  634.                                         ["skill"] = "Random",
  635.                                     }, -- end of [1]
  636.                                 }, -- end of ["units"]
  637.                                 ["y"] = 895424.57142858,
  638.                                 ["x"] = -317838.57142857,
  639.                                 ["name"] = "Ka-50" .. groupid,
  640.                                 ["communication"] = true,
  641.                                 ["start_time"] = 0,
  642.                                 ["frequency"] = 124,
  643.             ),
  644. huey =      (
  645.                                 ["groupId"] = groupid,
  646.                                 ["hidden"] = false,
  647.                                 ["units"] =
  648.                                 {
  649.                                     [1] =
  650.                                     {
  651.                                         ["alt"] = 449,
  652.                                         ["heading"] = 0,
  653.                                         ["callsign"] =
  654.                                         {
  655.                                             [1] = 7,
  656.                                             [2] = 1,
  657.                                             [3] = 1,
  658.                                             ["name"] = "Chevy11",
  659.                                         }, -- end of ["callsign"]
  660.                                         ["psi"] = 0,
  661.                                         ["livery_id"] = "Army Standard",
  662.                                         ["onboard_num"] = "57",
  663.                                         ["type"] = "UH-1H",
  664.                                         ["y"] = 895424.57142858,
  665.                                         ["x"] = -317838.57142857,
  666.                                         ["name"] = "Huey" .. groupid,
  667.                                         ["payload"] =
  668.                                         {
  669.                                             ["pylons"] =
  670.                                             {
  671.                                                 [1] =
  672.                                                 {
  673.                                                     ["CLSID"] = "M134_L",
  674.                                                 }, -- end of [1]
  675.                                                 [4] =
  676.                                                 {
  677.                                                     ["CLSID"] = "M134_R",
  678.                                                 }, -- end of [4]
  679.                                             }, -- end of ["pylons"]
  680.                                             ["fuel"] = "631",
  681.                                             ["flare"] = 0,
  682.                                             ["chaff"] = 0,
  683.                                             ["gun"] = 100,
  684.                                         }, -- end of ["payload"]
  685.                                         ["speed"] = 41.666666666667,
  686.                                         ["unitId"] = 497,
  687.                                         ["alt_type"] = "BARO",
  688.                                         ["skill"] = "Random",
  689.                                     }, -- end of [1]
  690.                                 }, -- end of ["units"]
  691.                                 ["y"] = 895424.57142858,
  692.                                 ["x"] = -317838.57142857,
  693.                                 ["name"] = "Huey" .. groupid,
  694.                                 ["communication"] = true,
  695.                                 ["start_time"] = 0,
  696.                                 ["frequency"] = 124,
  697.             ),
  698. fw190d9 =   (
  699.                                 ["groupId"] = groupid,
  700.                                 ["hidden"] = false,
  701.                                 ["units"] =
  702.                                 {
  703.                                     [1] =
  704.                                     {
  705.                                         ["alt"] = 449,
  706.                                         ["type"] = "FW-190D9",
  707.                                         ["unitId"] = 499,
  708.                                         ["psi"] = 0,
  709.                                         ["alt_type"] = "BARO",
  710.                                         ["skill"] = "Random",
  711.                                         ["y"] = 895424.57142858,
  712.                                         ["x"] = -317838.57142857,
  713.                                         ["name"] = "FW-190D9" .. groupid,
  714.                                         ["payload"] =
  715.                                         {
  716.                                             ["pylons"] =
  717.                                             {
  718.                                             }, -- end of ["pylons"]
  719.                                             ["fuel"] = 277,
  720.                                             ["flare"] = 0,
  721.                                             ["chaff"] = 0,
  722.                                             ["gun"] = 100,
  723.                                         }, -- end of ["payload"]
  724.                                         ["speed"] = 138.88888888889,
  725.                                         ["heading"] = 0,
  726.                                         ["callsign"] = 117,
  727.                                         ["onboard_num"] = "56",
  728.                                     }, -- end of [1]
  729.                                 }, -- end of ["units"]
  730.                                 ["y"] = 895424.57142858,
  731.                                 ["x"] = -317838.57142857,
  732.                                 ["name"] = "FW-190D9" .. groupid,
  733.                                 ["communication"] = true,
  734.                                 ["start_time"] = 213,
  735.                                 ["modulation"] = 0,
  736.                                 ["frequency"] = 124,
  737.             )
  738.            
  739.  
  740.  
  741. function UnitRadioCommand(arg)
  742.     if arg == f15c or p51d then
  743.         coalition.addGroup(country.id.USA, Group.Category.AIRPLANE, arg)
  744.         groupid = groupid + 1
  745.         trigger.action.outTextForGroup(GroupId groupId, string text, Time delay)
  746.         return
  747.     end
  748.     if arg == su25t or su27 or su33 or mig29s or fw190d9 then
  749.         coalition.addGroup(country.id.RUSSIA, Group.Category.AIRPLANE, arg)
  750.         groupid = groupid + 1
  751.         return
  752.     end
  753.     if arg == ka50 then
  754.         coalition.addGroup(country.id.RUSSIA, Group.Category.HELICOPTER, arg)
  755.         groupid = groupid + 1
  756.         return
  757.     end
  758.     if arg == huey then
  759.         coalition.addGroup(country.id.USA, Group.Category.HELICOPTER, arg)
  760.         groupid = groupid + 1
  761.         return
  762.     end
  763.     local playerName = unit:getPlayerName()
  764.     trigger.action.outTextForGroup(gid,PlayerName .. " generated " .. arg, 15)
  765. end
  766.  
  767.  
  768. function AddRadioCommand(unitName)
  769.         gid = group:getID()
  770.        
  771.         missionCommands.addCommandForGroup(gid, "F-15C", nil, UnitRadioCommand, f15c)
  772.         missionCommands.addCommandForGroup(gid, "Su-25T", nil, UnitRadioCommand, su25t)
  773.         missionCommands.addCommandForGroup(gid, "Su-27", nil, UnitRadioCommand, su27)
  774.         missionCommands.addCommandForGroup(gid, "Su-33", nil, UnitRadioCommand, su33)
  775.         missionCommands.addCommandForGroup(gid, "Mig-29S", nil, UnitRadioCommand, mig29s)
  776.         missionCommands.addCommandForGroup(gid, "A-10C", nil, UnitRadioCommand, a10c)
  777.         missionCommands.addCommandForGroup(gid, "P-51D", nil, UnitRadioCommand, p51d)
  778.         missionCommands.addCommandForGroup(gid, "FW-190D9", nil, UnitRadioCommand, fw190d9)
  779.         missionCommands.addCommandForGroup(gid, "Huey", nil, UnitRadioCommand, huey)
  780.         missionCommands.addCommandForGroup(gid, "Ka-50", nil, UnitRadioCommand, ka50)
  781.                
  782.    
  783. end
  784.  
  785.  
  786.  
  787. function AddRadioCommands(arg, time)
  788.     AddRadioCommand("GEN - F-15C")
  789.     AddRadioCommand("GEN - Su-25T")
  790.     AddRadioCommand("GEN - Su-27")
  791.     AddRadioCommand("GEN - Su-33")
  792.     AddRadioCommand("GEN - Mig-29S")
  793.     AddRadioCommand("GEN - A-10C")
  794.     AddRadioCommand("GEN - P-51D")
  795.     AddRadioCommand("GEN - Huey")
  796.     AddRadioCommand("GEN - Ka-50")      
  797.     return time + 5
  798. end[/SPOILER]
Advertisement
Add Comment
Please, Sign In to add comment