Advertisement
Guest User

Untitled

a guest
Dec 8th, 2024
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 88.11 KB | None | 0 0
  1. -- filename: @QA2D.lua
  2. -- version: lua51
  3. -- line: [0, 0] id: 0
  4. parse("mp_wpndmg \"Chainsaw\" 0")
  5. parse("mp_wpndmg \"Grenade Launcher\" 100")
  6. parse("mp_wpndmg \"Rocket Launcher\" 0")
  7. parse("mp_wpndmg \"Laser\" 0")
  8. parse("mp_wpndmg \"Machete\" 50")
  9. parse("mp_wpndmg \"M3\" 0")
  10. parse("mp_wpndmg \"TMP\" 0")
  11. parse("mp_wpndmg \"Galil\" 0")
  12. parse("mp_wpndmg \"XM1014\" 0")
  13. parse("restart")
  14. Achievements = {
  15.   [1] = {
  16.     name = "Double kill",
  17.     tip = "made double kill",
  18.     needcount = 1,
  19.     imgoff = "",
  20.     imgon = "",
  21.   },
  22.   [2] = {
  23.     name = "Flying killer",
  24.     tip = "Kill a player in flight",
  25.     needcount = 1,
  26.     imgoff = "",
  27.     imgon = "",
  28.   },
  29. }
  30. qa_maiw = {
  31.   1,
  32.   200,
  33.   100,
  34.   100,
  35.   100,
  36.   200,
  37.   100,
  38.   200,
  39.   100
  40. }
  41. qa_agwp = {
  42.   1,
  43.   1,
  44.   10,
  45.   10,
  46.   10,
  47.   50,
  48.   10,
  49.   100,
  50.   20
  51. }
  52. qa_agap = {
  53.   1,
  54.   50,
  55.   10,
  56.   5,
  57.   5,
  58.   30,
  59.   10,
  60.   60,
  61.   15
  62. }
  63. qa_weaponsspeed = {
  64.   0,
  65.   5,
  66.   5,
  67.   6,
  68.   0,
  69.   7,
  70.   0,
  71.   5,
  72.   5
  73. }
  74. qa_mapitems = {}
  75. qa_itemsimg = {}
  76. qa_strike_delay = 40
  77. qa_player_radius = 14
  78. qa_time = 0
  79. rtime = 0
  80. qa_first_blood = false
  81. qa_players = {}
  82. planes = planes or {}
  83. jumps = jupms or {}
  84. blocks = blocks or {}
  85. deadlyframe = deadlyframe or {}
  86. trains = trains or {}
  87. paths = paths or {}
  88. qa_npcsdrops = 0
  89. qa_copyright = "\xa9"
  90. qa_leader = 0
  91. qa_lasercolors = {
  92.   [0] = {
  93.     255,
  94.     255,
  95.     100
  96.   },
  97.   [1] = {
  98.     50,
  99.     50,
  100.     255
  101.   },
  102.   [2] = {
  103.     150,
  104.     150,
  105.     255
  106.   },
  107.   [3] = {
  108.     50,
  109.     255,
  110.     50
  111.   },
  112.   [4] = {
  113.     255,
  114.     255,
  115.     0
  116.   },
  117.   [5] = {
  118.     100,
  119.     100,
  120.     0
  121.   },
  122.   [6] = {
  123.     100,
  124.     100,
  125.     100
  126.   },
  127.   [7] = {
  128.     10,
  129.     10,
  130.     10
  131.   },
  132. }
  133. qa_item_types = {
  134.   [1] = {
  135.     imgpath = "gfx/qa2d/items/Machine Gun ammo.png",
  136.   },
  137.   [2] = {
  138.     imgpath = "gfx/qa2d/items/Shotgun ammo.png",
  139.   },
  140.   [3] = {
  141.     imgpath = "gfx/qa2d/items/Grenade Launcher ammo.png",
  142.   },
  143.   [4] = {
  144.     imgpath = "gfx/qa2d/items/Rocket Launcher ammo.png",
  145.   },
  146.   [5] = {
  147.     imgpath = "gfx/qa2d/items/Plasma gun ammo.png",
  148.   },
  149.   [6] = {
  150.     imgpath = "gfx/qa2d/items/Railgun ammo.png",
  151.   },
  152.   [10] = {
  153.     imgpath = "gfx/qa2d/items/shotgun.png",
  154.   },
  155.   [11] = {
  156.     imgpath = "gfx/qa2d/items/bfg.png",
  157.   },
  158.   [21] = {
  159.     imgpath = "gfx/qa2d/items/Lightning gun ammo .png",
  160.   },
  161.   [22] = {
  162.     imgpath = "gfx/qa2d/items/BFG-10K ammo.png",
  163.   },
  164.   [38] = {
  165.     imgpath = "gfx/qa2d/items/lightinggun.png",
  166.   },
  167.   [45] = {
  168.     imgpath = "gfx/qa2d/items/railgun.png",
  169.   },
  170.   [48] = {
  171.     imgpath = "gfx/qa2d/items/rocketlauncher.png",
  172.   },
  173.   [49] = {
  174.     imgpath = "gfx/qa2d/items/grenadelauncher.png",
  175.   },
  176.   [51] = {
  177.     imgpath = "gfx/qa2d/items/invisibility.png",
  178.   },
  179.   [52] = {
  180.     imgpath = "gfx/qa2d/items/medkit+100.png",
  181.   },
  182.   [53] = {
  183.     imgpath = "gfx/qa2d/items/teleport.png",
  184.   },
  185.   [57] = {
  186.     imgpath = "gfx/qa2d/items/yarmor.png",
  187.   },
  188.   [58] = {
  189.     imgpath = "gfx/qa2d/items/rarmor.png",
  190.   },
  191.   [60] = {
  192.     imgpath = "gfx/qa2d/items/regeneration.png",
  193.   },
  194.   [61] = {
  195.     imgpath = "gfx/qa2d/items/haste.png",
  196.   },
  197.   [62] = {
  198.     imgpath = "gfx/qa2d/items/quad.png",
  199.   },
  200.   [64] = {
  201.     imgpath = "gfx/qa2d/items/medkit+50.png",
  202.   },
  203.   [65] = {
  204.     imgpath = "gfx/qa2d/items/medkit+25.png",
  205.   },
  206.   [66] = {
  207.     imgpath = "gfx/qa2d/items/medkit+5.png",
  208.   },
  209.   [67] = {
  210.     imgpath = "gfx/qa2d/items/shard.png",
  211.   },
  212.   [68] = {
  213.     imgpath = "gfx/qa2d/items/megahealth.png",
  214.   },
  215.   [70] = {
  216.     imgpath = "gfx/qa2d/items/redflag.png",
  217.   },
  218.   [71] = {
  219.     imgpath = "gfx/qa2d/items/blueflag.png",
  220.   },
  221.   [82] = {
  222.     imgpath = "gfx/qa2d/items/regen.png",
  223.   },
  224.   [84] = {
  225.     imgpath = "gfx/qa2d/items/invis.png",
  226.   },
  227.   [85] = {
  228.     imgpath = "gfx/qa2d/items/plazmagun.png",
  229.   },
  230. }
  231. qa_weapon_types = {
  232.   [21] = {
  233.     name = "Mashinegun",
  234.     attack = "lighte",
  235.     distance = 1024,
  236.     damage = 5,
  237.     count = 1,
  238.     range = 4,
  239.     speed = 2000,
  240.     time = 8,
  241.     updates = 800,
  242.     alpha = 100,
  243.     imglength = 6,
  244.     imgflipping = true,
  245.     exp_size = 1,
  246.     offset = 30,
  247.     speedrot = 0,
  248.     hitflash = false,
  249.     hitsound = "weapons/bullethit.wav",
  250.     imgpath = "gfx/weapons/bullet.png",
  251.     txthit = "was machinegunned by %s",
  252.   },
  253.   [85] = {
  254.     name = "Plasmagun",
  255.     attack = "bullet",
  256.     damage = 20,
  257.     count = 1,
  258.     range = 4,
  259.     imglength = 32,
  260.     speed = 640,
  261.     time = 8,
  262.     updates = 100,
  263.     exp_size = 34,
  264.     offset = 20,
  265.     speedrot = 64,
  266.     hitflash = true,
  267.     hitsound = "weapons/plasma_exp.wav",
  268.     imgpath = "gfx/weapons/plasma.bmp",
  269.     txtSuicide = "melted itself",
  270.     txthit = "was melted by %s\'s plasmagun",
  271.     txtradiushit = "was melted by %s\'s plasmagun",
  272.   },
  273.   [11] = {
  274.     name = "BFG10K",
  275.     attack = "bullet",
  276.     imglength = 72,
  277.     damage = 100,
  278.     count = 1,
  279.     range = 2,
  280.     exp_size = 40,
  281.     speed = 400,
  282.     time = 8,
  283.     updates = 40,
  284.     offset = 15,
  285.     speedrot = 0,
  286.     hitflash = true,
  287.     hitsound = "weapons/explode6.wav",
  288.     imgpath = "gfx/weapons/bfg.png",
  289.     txtSuicide = "should have used a smaller gun",
  290.     txthit = "was blasted by %s\'s BFG",
  291.     txtradiushit = "was blasted by %s\'s BFG",
  292.   },
  293.   [38] = {
  294.     name = "Lighting",
  295.     attack = "lighte",
  296.     distance = 320,
  297.     count = 1,
  298.     damage = 8,
  299.     offset = 23,
  300.     range = 0,
  301.     imgflipping = true,
  302.     imglength = 300,
  303.     alpha = 75,
  304.     hitflash = true,
  305.     imgpath = "gfx/weapons/lighting.png",
  306.     sound = "weapons/lightninggun.wav",
  307.     txthit = "was burned by %s",
  308.   },
  309.   [87] = {
  310.     name = "Railgun",
  311.     attack = "lighte",
  312.     distance = 1024,
  313.     count = 1,
  314.     damage = 100,
  315.     offset = 23,
  316.     range = 1,
  317.     imgflipping = true,
  318.     imglength = 24,
  319.     alpha = 150,
  320.     hitflash = true,
  321.     imgpath = "gfx/weapons/rail1.png",
  322.     imgpath2 = "gfx/weapons/rail2.png",
  323.     hitsound = "weapons/plasma_exp.wav",
  324.     txthit = "was railed by %s",
  325.   },
  326.   [10] = {
  327.     name = "Shotgun",
  328.     attack = "lighte",
  329.     distance = 1024,
  330.     damage = 10,
  331.     count = 11,
  332.     range = 24,
  333.     speed = 2000,
  334.     time = 8,
  335.     updates = 600,
  336.     alpha = 100,
  337.     imglength = 6,
  338.     imgflipping = true,
  339.     exp_size = 1,
  340.     offset = 30,
  341.     speedrot = 0,
  342.     hitflash = true,
  343.     hitsound = "weapons/bullethit.wav",
  344.     imgpath = "gfx/weapons/bullet.png",
  345.     txthit = "was gunned down by %s",
  346.   },
  347.   [77] = {
  348.     name = "RocketLauncher",
  349.     attack = "bullet",
  350.     damage = 100,
  351.     count = 1,
  352.     range = 1,
  353.     speed = 512,
  354.     time = 8,
  355.     updates = 100,
  356.     alpha = 255,
  357.     imglength = 32,
  358.     imgflipping = false,
  359.     exp_size = 40,
  360.     offset = 18,
  361.     speedrot = 0,
  362.     hitflash = true,
  363.     hitsound = "weapons/explode6.wav",
  364.     imgpath = "gfx/weapons/rocket.png",
  365.     txtSuicide = "blew itself up",
  366.     txthit = "ate %s\'s rocket",
  367.     txtradiushit = "almost dodged %s\'s rocket",
  368.   },
  369.   [69] = {
  370.     name = "Gauntlet",
  371.     attack = "none",
  372.     damage = 50,
  373.     txthit = "was pummeled by %s\'s gauntlet",
  374.   },
  375.   [49] = {
  376.     name = "GranadeLauncher",
  377.     attack = "none",
  378.     damage = 50,
  379.     txtSuicide = "tripped on its own grenade",
  380.     txthit = "was pummeled by %s",
  381.   },
  382. }
  383. qa_bullets = {}
  384. addhook("buildattempt", "qa_buildattempt")
  385. function qa_buildattempt(r0_1, r1_1, r2_1, r3_1)
  386.   -- line: [281, 299] id: 1
  387.   if r1_1 == 20 then
  388.     if qa_players[r0_1].rocketreloaded == 1 then
  389.       parse("sv_sound \"weapons/rocketlauncher.wav\"")
  390.       qa_players[r0_1].rocketreloaded = 0
  391.       timer(800, "qa_rocketreload", r0_1)
  392.       qa_attack(r0_1)
  393.     end
  394.     return 1
  395.   elseif r1_1 == 21 then
  396.     if qa_players[r0_1].laserreloaded == 1 then
  397.       qa_players[r0_1].laserreloaded = 0
  398.       parse("sv_sound \"weapons/laser.wav\"")
  399.       timer(1500, "qa_laserreload", r0_1)
  400.       qa_attack(r0_1)
  401.     end
  402.     return 1
  403.   end
  404. end
  405. function qa_rocketreload(r0_2)
  406.   -- line: [301, 303] id: 2
  407.   qa_players[tonumber(r0_2)].rocketreloaded = 1
  408. end
  409. function qa_laserreload(r0_3)
  410.   -- line: [305, 307] id: 3
  411.   qa_players[tonumber(r0_3)].laserreloaded = 1
  412. end
  413. addhook("attack", "qa_attack")
  414. function qa_attack(r0_4)
  415.   -- line: [311, 393] id: 4
  416.   local r1_4 = qa_weapon_types[player(r0_4, "weapontype")]
  417.   if r1_4 then
  418.     local r2_4 = player(r0_4, "x")
  419.     local r3_4 = player(r0_4, "y")
  420.     local r4_4 = (player(r0_4, "rot") - 90 + math.random() - 0.5) * 3.14 / 180
  421.     local r5_4 = math.cos(r4_4)
  422.     local r6_4 = math.sin(r4_4)
  423.     if r1_4.attack == "bullet" then
  424.       for r10_4 = 1, r1_4.count, 1 do
  425.         qa_bullet_create(r2_4, r3_4, r4_4 + (math.random() - 0.5) * r1_4.range * 3.14 / 180, r1_4, r0_4)
  426.       end
  427.     elseif r1_4.attack ~= "shell" and r1_4.attack == "lighte" then
  428.       for r10_4 = 1, r1_4.count, 1 do
  429.         local r11_4 = r4_4 + (math.random() - 0.5) * r1_4.range * 3.14 / 180
  430.         local r12_4 = math.cos(r11_4)
  431.         local r13_4 = math.sin(r11_4)
  432.         local r14_4 = r2_4 + r5_4 * r1_4.offset
  433.         local r15_4 = r3_4 + r6_4 * r1_4.offset
  434.         local r16_4 = r14_4
  435.         local r17_4 = r15_4
  436.         local r18_4 = false
  437.         for r22_4 = 1, r1_4.distance, 1 do
  438.           r17_4 = r17_4 + r13_4
  439.           r16_4 = r16_4 + r12_4
  440.           local r23_4 = math.floor(r16_4 / 32)
  441.           local r24_4 = math.floor(r17_4 / 32)
  442.           local r25_4 = false
  443.           if tile(r23_4, r24_4, "wall") and not tile(r23_4, r24_4, "obstacle") then
  444.             qa_weapon_lighting_hit(r14_4, r15_4, r16_4, r17_4, r11_4, r1_4, r0_4)
  445.             if entity(r23_4, r24_4, "exists") and entity(r23_4, r24_4, "typename") == "Env_Breakable" then
  446.               parse("explosion " .. r23_4 * 32 + 16 .. " " .. r24_4 * 32 + 16 .. " 1 " .. r1_4.damage .. " " .. r0_4)
  447.             elseif r1_4.name == "Railgun" and entity(r23_4, r24_4, "exists") and entity(r23_4, r24_4, "typename") == "Trigger_Hit" then
  448.               parse("trigger " .. entity(r23_4, r24_4, "trigger"))
  449.             end
  450.             r25_4 = true
  451.           else
  452.             for r29_4, r30_4 in pairs(player(0, "tableliving")) do
  453.               local r31_4 = player(r30_4, "x") - r16_4
  454.               local r32_4 = player(r30_4, "y") - r17_4
  455.               if r31_4 * r31_4 + r32_4 * r32_4 < qa_player_radius * qa_player_radius and r25_4 == false then
  456.                 qa_weapon_lighting_hit(r14_4, r15_4, r16_4, r17_4, r11_4, r1_4, r0_4)
  457.                 qa_player_damage(r0_4, r1_4, r30_4, nil, r30_4)
  458.                 r25_4 = true
  459.                 break
  460.               end
  461.             end
  462.           end
  463.           if r25_4 then
  464.             break
  465.           end
  466.         end
  467.         if r18_4 == false then
  468.           qa_weapon_lighting_hit(r14_4, r15_4, r16_4, r17_4, r11_4, r1_4, r0_4)
  469.         end
  470.       end
  471.     end
  472.   end
  473.   local r2_4 = {
  474.     69,
  475.     21,
  476.     10,
  477.     49,
  478.     77,
  479.     85,
  480.     87,
  481.     38,
  482.     11
  483.   }
  484.   wtype = 0
  485.   for r6_4 = 2, 9, 1 do
  486.     if player(r0_4, "weapontype") == r2_4[r6_4] then
  487.       wtype = r6_4
  488.       break
  489.     end
  490.   end
  491.   if wtype > 0 then
  492.     qa_players[r0_4].ammo[wtype] = math.max(qa_players[r0_4].ammo[wtype] - 1, 0)
  493.     if qa_players[r0_4].ammo[wtype] < 1 then
  494.       if wtype == 7 then
  495.         qa_players[r0_4].lasercolor = 0
  496.       end
  497.       local r3_4 = player(r0_4, "weapontype")
  498.       for r7_4 = -9, -1, 1 do
  499.         if qa_players[r0_4].weapons[-r7_4] == 1 and 0 < qa_players[r0_4].ammo[-r7_4] then
  500.           parse("setweapon " .. r0_4 .. " " .. r2_4[-r7_4])
  501.           break
  502.         end
  503.       end
  504.       parse("strip " .. r0_4 .. " " .. r3_4)
  505.       qa_HUD(r0_4 .. " 1 1")
  506.     else
  507.       parse("equip " .. r0_4 .. " " .. player(r0_4, "weapontype"))
  508.       qa_HUD(r0_4 .. " 1")
  509.     end
  510.   end
  511. end
  512. function qa_totable(r0_5, r1_5)
  513.   -- line: [395, 402] id: 5
  514.   local r2_5 = {}
  515.   if not r1_5 then
  516.     r1_5 = "[^%s]+"
  517.   end
  518.   for r6_5 in string.gmatch(r0_5, r1_5) do
  519.     table.insert(r2_5, r6_5)
  520.   end
  521.   return r2_5
  522. end
  523. qa_ammo = {
  524.   0,
  525.   1,
  526.   2,
  527.   3,
  528.   4,
  529.   5,
  530.   6,
  531.   21,
  532.   22
  533. }
  534. function qa_HUD(r0_6)
  535.   -- line: [406, 521] id: 6
  536.   local r1_6 = qa_totable(r0_6)
  537.   local r2_6 = tonumber(r1_6[1])
  538.   local r3_6 = tonumber(r1_6[2])
  539.   local r4_6 = tonumber(r1_6[3])
  540.   local r5_6 = tonumber(r1_6[4])
  541.   local r6_6 = tonumber(r1_6[5])
  542.   local r7_6 = tonumber(r1_6[6])
  543.   local r8_6 = tonumber(r1_6[7])
  544.   local r9_6 = tonumber(r1_6[8])
  545.   local r10_6 = tonumber(r1_6[9])
  546.   if player(r2_6, "exists") and not player(r2_6, "bot") then
  547.     if qa_players[r2_6].ha == nil then
  548.       qa_players[r2_6].ha = {}
  549.     end
  550.     local r11_6 = {
  551.       69,
  552.       21,
  553.       10,
  554.       49,
  555.       77,
  556.       85,
  557.       87,
  558.       38,
  559.       11
  560.     }
  561.     wtype = 0
  562.     for r15_6 = 1, 9, 1 do
  563.       if player(r2_6, "weapontype") == r11_6[r15_6] then
  564.         wtype = r15_6
  565.         break
  566.       end
  567.     end
  568.     if wtype == 0 and 0 < player(r2_6, "health") then
  569.       parse("equip " .. r2_6 .. " 69")
  570.       parse("setweapon " .. r2_6 .. " 69")
  571.       qa_HUD(r2_6 .. " 1 1")
  572.       r3_6 = 0
  573.       r4_6 = 0
  574.     end
  575.     qa_players[r2_6].oldWeapon = player(r2_6, "weapontype")
  576.     if r3_6 or r4_6 then
  577.       if qa_players[r2_6].ha[0] ~= nil then
  578.         freeimage(qa_players[r2_6].ha[0])
  579.         qa_players[r2_6].ha[0] = nil
  580.       end
  581.       if qa_players[r2_6].ha[1] ~= nil then
  582.         freeimage(qa_players[r2_6].ha[1])
  583.         qa_players[r2_6].ha[1] = nil
  584.       end
  585.       if qa_players[r2_6].ha[2] ~= nil then
  586.         freeimage(qa_players[r2_6].ha[2])
  587.         qa_players[r2_6].ha[2] = nil
  588.       end
  589.     end
  590.     if qa_players[r2_6].ha[3] ~= nil and r4_6 then
  591.       freeimage(qa_players[r2_6].ha[3])
  592.       qa_players[r2_6].ha[3] = nil
  593.     end
  594.     if qa_players[r2_6].ha[4] ~= nil and r4_6 then
  595.       freeimage(qa_players[r2_6].ha[4])
  596.       qa_players[r2_6].ha[4] = nil
  597.     end
  598.     if qa_players[r2_6].ha[5] ~= nil and r7_6 then
  599.       freeimage(qa_players[r2_6].ha[5])
  600.       qa_players[r2_6].ha[5] = nil
  601.     end
  602.     if r8_6 then
  603.       if qa_players[r2_6].ha[6] ~= nil and (qa_players[r2_6].armor < 1 or 0 < player(r2_6, "health")) then
  604.         freeimage(qa_players[r2_6].ha[6])
  605.         qa_players[r2_6].ha[6] = nil
  606.       end
  607.       if qa_players[r2_6].ha[7] ~= nil then
  608.         freeimage(qa_players[r2_6].ha[7])
  609.         qa_players[r2_6].ha[7] = nil
  610.       end
  611.       if qa_players[r2_6].ha[8] ~= nil then
  612.         freeimage(qa_players[r2_6].ha[8])
  613.         qa_players[r2_6].ha[8] = nil
  614.       end
  615.       if qa_players[r2_6].ha[9] ~= nil then
  616.         freeimage(qa_players[r2_6].ha[9])
  617.         qa_players[r2_6].ha[9] = nil
  618.       end
  619.     end
  620.     if r9_6 then
  621.       if qa_players[r2_6].ha[10] ~= nil and (qa_players[r2_6].invisibility == 0 or player(r2_6, "health") < 1) then
  622.         freeimage(qa_players[r2_6].ha[10])
  623.         qa_players[r2_6].ha[10] = nil
  624.         parse("hudtxt2 " .. r2_6 .. " 36")
  625.       end
  626.       if qa_players[r2_6].ha[11] ~= nil and (qa_players[r2_6].speedtime == 0 or player(r2_6, "health") < 1) then
  627.         freeimage(qa_players[r2_6].ha[11])
  628.         qa_players[r2_6].ha[11] = nil
  629.         parse("hudtxt2 " .. r2_6 .. " 38")
  630.       end
  631.       if qa_players[r2_6].ha[12] ~= nil and (qa_players[r2_6].quadtime == 0 or player(r2_6, "health") < 1) then
  632.         freeimage(qa_players[r2_6].ha[12])
  633.         qa_players[r2_6].ha[12] = nil
  634.         parse("hudtxt2 " .. r2_6 .. " 39")
  635.       end
  636.       if qa_players[r2_6].ha[13] ~= nil and (qa_players[r2_6].regentime == 0 or player(r2_6, "health") < 1) then
  637.         freeimage(qa_players[r2_6].ha[13])
  638.         qa_players[r2_6].ha[13] = nil
  639.         parse("hudtxt2 " .. r2_6 .. " 37")
  640.       end
  641.     end
  642.     if r10_6 and qa_players[r2_6].ha[14] ~= nil and qa_players[r2_6].bonus == 0 then
  643.       freeimage(qa_players[r2_6].ha[14])
  644.       qa_players[r2_6].ha[14] = nil
  645.     end
  646.     if player(r2_6, "health") > 0 then
  647.       if 1 < wtype and wtype < 10 then
  648.         if r3_6 then
  649.           if string.len(tostring(qa_players[r2_6].ammo[wtype])) >= 3 then
  650.             qa_players[r2_6].ha[0] = image("gfx/qa2d/hud/" .. string.sub(tostring(qa_players[r2_6].ammo[wtype]), string.len(tostring(qa_players[r2_6].ammo[wtype])) - 2, string.len(tostring(qa_players[r2_6].ammo[wtype])) - 2) .. ".png", 540, 460, 2, r2_6)
  651.             imageblend(qa_players[r2_6].ha[0], 1)
  652.             imagecolor(qa_players[r2_6].ha[0], 255, 255, 0)
  653.           end
  654.           if string.len(tostring(qa_players[r2_6].ammo[wtype])) >= 2 then
  655.             qa_players[r2_6].ha[1] = image("gfx/qa2d/hud/" .. string.sub(tostring(qa_players[r2_6].ammo[wtype]), string.len(tostring(qa_players[r2_6].ammo[wtype])) - 1, string.len(tostring(qa_players[r2_6].ammo[wtype])) - 1) .. ".png", 565, 460, 2, r2_6)
  656.             imageblend(qa_players[r2_6].ha[1], 1)
  657.             imagecolor(qa_players[r2_6].ha[1], 255, 255, 0)
  658.           end
  659.           qa_players[r2_6].ha[2] = image("gfx/qa2d/hud/" .. string.sub(tostring(qa_players[r2_6].ammo[wtype]), string.len(tostring(qa_players[r2_6].ammo[wtype])), string.len(tostring(qa_players[r2_6].ammo[wtype]))) .. ".png", 590, 460, 2, r2_6)
  660.           imageblend(qa_players[r2_6].ha[2], 1)
  661.           imagecolor(qa_players[r2_6].ha[2], 255, 255, 0)
  662.         end
  663.         if r4_6 then
  664.           qa_players[r2_6].ha[3] = image(qa_item_types[qa_ammo[wtype]].imgpath, 620, 460, 2, r2_6)
  665.           imagescale(qa_players[r2_6].ha[3], 1.5, 1.5)
  666.           if wtype == 7 and qa_players[r2_6].ha[4] == nil then
  667.             qa_players[r2_6].ha[4] = image("gfx/qa2d/items/railgun_light.png", 1, 0, 200 + r2_6, 0)
  668.             imagealpha(qa_players[r2_6].ha[4], 0.5)
  669.             if qa_players[r2_6].invisibility > 0 then
  670.               imagealpha(qa_players[r2_6].ha[4], 0.25)
  671.             end
  672.           end
  673.         end
  674.         if (r4_6 or r6_6) and wtype == 7 then
  675.           qa_players[r2_6].lasercolor = player(r2_6, "spraycolor")
  676.           imagecolor(qa_players[r2_6].ha[4], qa_lasercolors[qa_players[r2_6].lasercolor][1], qa_lasercolors[qa_players[r2_6].lasercolor][2], qa_lasercolors[qa_players[r2_6].lasercolor][3])
  677.         end
  678.       end
  679.       if (r4_6 or r5_6) and 0 < wtype and wtype < 10 then
  680.         parse("speedmod " .. r2_6 .. " " .. qa_weaponsspeed[wtype] + 7 + math.min(qa_players[r2_6].speedtime, 1) * 9)
  681.       end
  682.       if r7_6 then
  683.         qa_players[r2_6].ha[5] = image("gfx/player/head/" .. player(r2_6, "team") .. "-" .. player(r2_6, "look") .. ".png", 110, 460, 2, r2_6)
  684.       end
  685.       if r8_6 and 1 <= qa_players[r2_6].armor then
  686.         if qa_players[r2_6].ha[6] == nil then
  687.           qa_players[r2_6].ha[6] = image("gfx/player/head/armor.png", 220, 460, 2, r2_6)
  688.         end
  689.         qa_players[r2_6].ha[7] = image("gfx/qa2d/hud/" .. string.sub(math.floor(qa_players[r2_6].armor), string.len(math.floor(qa_players[r2_6].armor)), string.len(math.floor(qa_players[r2_6].armor))) .. ".png", 190, 460, 2, r2_6)
  690.         imageblend(qa_players[r2_6].ha[7], 1)
  691.         imagecolor(qa_players[r2_6].ha[7], 255, 255, 0)
  692.         if qa_players[r2_6].armor >= 10 then
  693.           qa_players[r2_6].ha[8] = image("gfx/qa2d/hud/" .. string.sub(math.floor(qa_players[r2_6].armor), string.len(math.floor(qa_players[r2_6].armor)) - 1, string.len(math.floor(qa_players[r2_6].armor)) - 1) .. ".png", 165, 460, 2, r2_6)
  694.           imageblend(qa_players[r2_6].ha[8], 1)
  695.           imagecolor(qa_players[r2_6].ha[8], 255, 255, 0)
  696.         end
  697.         if qa_players[r2_6].armor >= 100 then
  698.           qa_players[r2_6].ha[9] = image("gfx/qa2d/hud/" .. string.sub(math.floor(qa_players[r2_6].armor), 1, 1) .. ".png", 140, 460, 2, r2_6)
  699.           imageblend(qa_players[r2_6].ha[9], 1)
  700.           imagecolor(qa_players[r2_6].ha[9], 255, 255, 0)
  701.         end
  702.       end
  703.       if r9_6 then
  704.         if 0 < qa_players[r2_6].invisibility and qa_players[r2_6].ha[10] == nil then
  705.           qa_players[r2_6].ha[10] = image("gfx/qa2d/hud/iconpowerup_invis.png", 20, 300, 2, r2_6)
  706.           imagescale(qa_players[r2_6].ha[10], 0.5, 0.5)
  707.         end
  708.         if 0 < qa_players[r2_6].speedtime and qa_players[r2_6].ha[11] == nil then
  709.           qa_players[r2_6].ha[11] = image("gfx/qa2d/hud/iconpowerup_haste.png", 20, 340, 2, r2_6)
  710.           imagescale(qa_players[r2_6].ha[11], 0.5, 0.5)
  711.         end
  712.         if 0 < qa_players[r2_6].quadtime and qa_players[r2_6].ha[12] == nil then
  713.           qa_players[r2_6].ha[12] = image("gfx/qa2d/hud/iconpowerup_quad.png", 20, 380, 2, r2_6)
  714.           imagescale(qa_players[r2_6].ha[12], 0.5, 0.5)
  715.         end
  716.         if 0 < qa_players[r2_6].regentime and qa_players[r2_6].ha[13] == nil then
  717.           qa_players[r2_6].ha[13] = image("gfx/qa2d/hud/iconpowerup_regen.png", 20, 420, 2, r2_6)
  718.           imagescale(qa_players[r2_6].ha[13], 0.5, 0.5)
  719.         end
  720.       end
  721.       if r10_6 and 0 < qa_players[r2_6].bonus and qa_players[r2_6].ha[14] == nil then
  722.         qa_players[r2_6].ha[14] = image("gfx/qa2d/hud/" .. ({
  723.           "iconholdable_medkit.png",
  724.           "iconpowerup_teleporter.png",
  725.           "iconholdable_kamikaze.png"
  726.         })[qa_players[r2_6].bonus], 20, 260, 2, r2_6)
  727.         imagescale(qa_players[r2_6].ha[14], 0.5, 0.5)
  728.       end
  729.     end
  730.   end
  731. end
  732. function qa_ScoreTable(r0_7)
  733.   -- line: [523, 711] id: 7
  734.   r0_7 = qa_totable(r0_7)
  735.   id = tonumber(r0_7[1]) or 0
  736.   mode = tonumber(r0_7[2])
  737.   if 0 < id and not player(id, "bot") then
  738.     if game("sv_gamemode") == "1" then
  739.       if qa_players[id].scoretableimg == nil and mode == nil then
  740.         qa_players[id].scoretableimg = image("gfx/qa2d/scoretable1.png", 320, 240, 2, id)
  741.         for r4_7 = 1, 16, 1 do
  742.           if qa_tableofplayers[r4_7] ~= nil then
  743.             parse("hudtxt2 " .. id .. " " .. r4_7 - 1 .. " \xa9255255255" .. player(qa_tableofplayers[r4_7][1], "name") .. "; " .. 35 + 310 * math.floor(r4_7 / 9) .. " " .. 65 + 35 * r4_7 - 280 * math.floor(r4_7 / 9))
  744.             parse("hudtxt2 " .. id .. " " .. r4_7 + 15 .. " \xa9255255255" .. qa_tableofplayers[r4_7][2] .. " " .. string.sub("   " .. player(qa_tableofplayers[r4_7][1], "deaths"), string.len(("   " .. player(qa_tableofplayers[r4_7][1], "deaths"))) - 4, string.len("   " .. player(qa_tableofplayers[r4_7][1], "deaths"))) .. "; " .. 250 + 310 * math.floor(r4_7 / 9) .. " " .. 65 + 35 * r4_7 - 280 * math.floor(r4_7 / 9) .. "; -1")
  745.           else
  746.             parse("hudtxt2 " .. id .. " " .. r4_7 - 1)
  747.             parse("hudtxt2 " .. id .. " " .. r4_7 + 15)
  748.           end
  749.         end
  750.       elseif qa_players[id].scoretableimg ~= nil then
  751.         freeimage(qa_players[id].scoretableimg)
  752.         for r4_7 = 0, 32, 1 do
  753.           parse("hudtxt2 " .. id .. " " .. r4_7)
  754.         end
  755.         qa_players[id].scoretableimg = nil
  756.       end
  757.     elseif qa_players[id].scoretableimg == nil and mode == nil then
  758.       qa_players[id].scoretableimg = image("gfx/qa2d/scoretable2.png", 320, 240, 2, id)
  759.       for r4_7, r5_7 in pairs(player(0, "table")) do
  760.         if not player(r5_7, "bot") and qa_players[r5_7].scoretableimg ~= nil then
  761.           for r9_7 = 1, 8, 1 do
  762.             if qa_tableofplayers_t[r9_7] ~= nil then
  763.               parse("hudtxt2 " .. r5_7 .. " " .. r9_7 + 7 .. " \xa9255255255" .. player(qa_tableofplayers_t[r9_7][1], "name") .. "; 35 " .. 65 + 35 * r9_7)
  764.               parse("hudtxt2 " .. r5_7 .. " " .. r9_7 + 24 .. " \xa9255255255" .. qa_tableofplayers_t[r9_7][2] .. " " .. string.sub("   " .. player(qa_tableofplayers_t[r9_7][1], "deaths"), string.len(("   " .. player(qa_tableofplayers_t[r9_7][1], "deaths"))) - 4, string.len("   " .. player(qa_tableofplayers_t[r9_7][1], "deaths"))) .. "; 250 " .. 65 + 35 * r9_7 .. " 1")
  765.             else
  766.               parse("hudtxt2 " .. r5_7 .. " " .. r9_7 + 7)
  767.               parse("hudtxt2 " .. r5_7 .. " " .. r9_7 + 24)
  768.             end
  769.             if qa_tableofplayers_ct[r9_7] ~= nil then
  770.               parse("hudtxt2 " .. r5_7 .. " " .. r9_7 - 1 .. " \xa9255255255" .. player(qa_tableofplayers_ct[r9_7][1], "name") .. "; 345 " .. 65 + 35 * r9_7)
  771.               parse("hudtxt2 " .. r5_7 .. " " .. r9_7 + 15 .. " \xa9255255255" .. qa_tableofplayers_ct[r9_7][2] .. " " .. string.sub("   " .. player(qa_tableofplayers_ct[r9_7][1], "deaths"), string.len(("   " .. player(qa_tableofplayers_ct[r9_7][1], "deaths"))) - 4, string.len("   " .. player(qa_tableofplayers_ct[r9_7][1], "deaths"))) .. "; 560 " .. 65 + 35 * r9_7 .. " 1")
  772.             else
  773.               parse("hudtxt2 " .. r5_7 .. " " .. r9_7 - 1)
  774.               parse("hudtxt2 " .. r5_7 .. " " .. r9_7 + 15)
  775.             end
  776.             parse("hudtxt2 " .. r5_7 .. " 33 " .. qa_copyright .. "255255255" .. game("mp_winlimit") .. "/" .. qa_tableofplayers_t_score .. "/" .. qa_tableofplayers_ct_score .. "/" .. qa_players[r5_7].kills .. ";600 430; 1")
  777.           end
  778.         end
  779.       end
  780.     elseif qa_players[id].scoretableimg ~= nil then
  781.       freeimage(qa_players[id].scoretableimg)
  782.       for r4_7 = 0, 32, 1 do
  783.         parse("hudtxt2 " .. id .. " " .. r4_7)
  784.       end
  785.       qa_players[id].scoretableimg = nil
  786.     end
  787.   elseif id == 0 and mode == nil then
  788.     for r4_7, r5_7 in pairs(player(0, "table")) do
  789.       if not player(r5_7, "bot") then
  790.         if qa_players[r5_7].scoretableimg then
  791.           freeimage(qa_players[r5_7].scoretableimg)
  792.         end
  793.         for r9_7 = 0, 32, 1 do
  794.           parse("hudtxt2 " .. r5_7 .. " " .. r9_7)
  795.         end
  796.         qa_players[r5_7].scoretableimg = nil
  797.       end
  798.     end
  799.     if game("sv_gamemode") == "1" then
  800.       image("gfx/qa2d/scoretable1.png", 320, 240, 2, 0)
  801.       for r4_7 = 1, 16, 1 do
  802.         if qa_tableofplayers[r4_7] ~= nil then
  803.           parse("hudtxt " .. r4_7 - 1 .. " \xa9255255255" .. player(qa_tableofplayers[r4_7][1], "name") .. "; " .. 35 + 310 * math.floor(r4_7 / 9) .. " " .. 65 + 35 * r4_7 - 280 * math.floor(r4_7 / 9))
  804.           parse("hudtxt " .. r4_7 + 15 .. " \xa9255255255" .. qa_tableofplayers[r4_7][2] .. " " .. string.sub("   " .. player(qa_tableofplayers[r4_7][1], "deaths"), string.len(("   " .. player(qa_tableofplayers[r4_7][1], "deaths"))) - 4, string.len("   " .. player(qa_tableofplayers[r4_7][1], "deaths"))) .. "; " .. 250 + 310 * math.floor(r4_7 / 9) .. " " .. 65 + 35 * r4_7 - 280 * math.floor(r4_7 / 9) .. "; -1")
  805.         else
  806.           parse("hudtxt " .. r4_7 - 1)
  807.           parse("hudtxt " .. r4_7 + 15)
  808.         end
  809.       end
  810.     else
  811.       image("gfx/qa2d/scoretable2.png", 320, 240, 2, 0)
  812.       for r4_7 = 1, 8, 1 do
  813.         if qa_tableofplayers_t[r4_7] ~= nil then
  814.           parse("hudtxt " .. r4_7 + 7 .. " \xa9255255255" .. player(qa_tableofplayers_t[r4_7][1], "name") .. "; 35 " .. 65 + 35 * r4_7)
  815.           parse("hudtxt " .. r4_7 + 24 .. " \xa9255255255" .. qa_tableofplayers_t[r4_7][2] .. " " .. string.sub("   " .. player(qa_tableofplayers_t[r4_7][1], "deaths"), string.len(("   " .. player(qa_tableofplayers_t[r4_7][1], "deaths"))) - 4, string.len("   " .. player(qa_tableofplayers_t[r4_7][1], "deaths"))) .. "; 250 " .. 65 + 35 * r4_7 .. " 1")
  816.         else
  817.           parse("hudtxt " .. r4_7 + 7)
  818.           parse("hudtxt " .. r4_7 + 24)
  819.         end
  820.         if qa_tableofplayers_ct[r4_7] ~= nil then
  821.           parse("hudtxt " .. r4_7 - 1 .. " \xa9255255255" .. player(qa_tableofplayers_ct[r4_7][1], "name") .. "; 345 " .. 65 + 35 * r4_7)
  822.           parse("hudtxt " .. r4_7 + 15 .. " \xa9255255255" .. qa_tableofplayers_ct[r4_7][2] .. " " .. string.sub("   " .. player(qa_tableofplayers_ct[r4_7][1], "deaths"), string.len(("   " .. player(qa_tableofplayers_ct[r4_7][1], "deaths"))) - 4, string.len("   " .. player(qa_tableofplayers_ct[r4_7][1], "deaths"))) .. "; 560 " .. 65 + 35 * r4_7 .. " 1")
  823.         else
  824.           parse("hudtxt " .. r4_7 - 1)
  825.           parse("hudtxt " .. r4_7 + 15)
  826.         end
  827.       end
  828.     end
  829.   elseif id == 0 and mode == 1 then
  830.     if game("sv_gamemode") == "1" then
  831.       qa_tableofplayers = {}
  832.       for r4_7, r5_7 in pairs(player(0, "table")) do
  833.         qa_tableofplayers[r4_7] = {
  834.           r5_7,
  835.           qa_players[r5_7].kills
  836.         }
  837.       end
  838.       for r4_7 = 1, #qa_tableofplayers - 1, 1 do
  839.         for r8_7 = 1, #qa_tableofplayers, 1 do
  840.           if r4_7 < r8_7 and qa_tableofplayers[r4_7][2] < qa_tableofplayers[r8_7][2] or r8_7 < r4_7 and qa_tableofplayers[r8_7][2] < qa_tableofplayers[r4_7][2] then
  841.             qa_tableofplayers[r4_7] = qa_tableofplayers[r8_7]
  842.             qa_tableofplayers[r8_7] = qa_tableofplayers[r4_7]
  843.           end
  844.         end
  845.       end
  846.       for r4_7, r5_7 in pairs(player(0, "table")) do
  847.         if not player(r5_7, "bot") then
  848.           if qa_players[r5_7].scoretableimg ~= nil then
  849.             for r9_7 = 1, 16, 1 do
  850.               if qa_tableofplayers[r9_7] ~= nil then
  851.                 parse("hudtxt2 " .. r5_7 .. " " .. r9_7 - 1 .. " \xa9255255255" .. player(qa_tableofplayers[r9_7][1], "name") .. "; " .. 35 + 310 * math.floor(r9_7 / 9) .. " " .. 65 + 35 * r9_7 - 280 * math.floor(r9_7 / 9))
  852.                 parse("hudtxt2 " .. r5_7 .. " " .. r9_7 + 15 .. " \xa9255255255" .. qa_tableofplayers[r9_7][2] .. " " .. string.sub("   " .. player(qa_tableofplayers[r9_7][1], "deaths"), string.len(("   " .. player(qa_tableofplayers[r9_7][1], "deaths"))) - 4, string.len("   " .. player(qa_tableofplayers[r9_7][1], "deaths"))) .. "; " .. 250 + 310 * math.floor(r9_7 / 9) .. " " .. 65 + 35 * r9_7 - 280 * math.floor(r9_7 / 9) .. "; -1")
  853.               else
  854.                 parse("hudtxt2 " .. r5_7 .. " " .. r9_7 - 1)
  855.                 parse("hudtxt2 " .. r5_7 .. " " .. r9_7 + 15)
  856.               end
  857.             end
  858.           end
  859.           parse("hudtxt2 " .. r5_7 .. " 33 " .. qa_copyright .. "255255255" .. game("mp_winlimit") .. "/" .. qa_players[math.max(qa_leader, 1)].kills .. "/" .. qa_players[r5_7].kills .. ";600 430; 1")
  860.         end
  861.       end
  862.     else
  863.       qa_tableofplayers_t = {}
  864.       qa_tableofplayers_ct = {}
  865.       qa_tableofplayers_t_score = 0
  866.       qa_tableofplayers_ct_score = 0
  867.       for r4_7, r5_7 in pairs(player(0, "team1")) do
  868.         qa_tableofplayers_t_score = qa_tableofplayers_t_score + qa_players[r5_7].kills
  869.         qa_tableofplayers_t[r4_7] = {
  870.           r5_7,
  871.           qa_players[r5_7].kills
  872.         }
  873.       end
  874.       for r4_7, r5_7 in pairs(player(0, "team2")) do
  875.         qa_tableofplayers_ct_score = qa_tableofplayers_ct_score + qa_players[r5_7].kills
  876.         qa_tableofplayers_ct[r4_7] = {
  877.           r5_7,
  878.           qa_players[r5_7].kills
  879.         }
  880.       end
  881.       for r4_7 = 1, #qa_tableofplayers_t - 1, 1 do
  882.         for r8_7 = 1, #qa_tableofplayers_t, 1 do
  883.           if r4_7 < r8_7 and qa_tableofplayers_t[r4_7][2] < qa_tableofplayers_t[r8_7][2] or r8_7 < r4_7 and qa_tableofplayers_t[r8_7][2] < qa_tableofplayers_t[r4_7][2] then
  884.             qa_tableofplayers_t[r4_7] = qa_tableofplayers_t[r8_7]
  885.             qa_tableofplayers_t[r8_7] = qa_tableofplayers_t[r4_7]
  886.           end
  887.         end
  888.       end
  889.       for r4_7 = 1, #qa_tableofplayers_ct - 1, 1 do
  890.         for r8_7 = 1, #qa_tableofplayers_ct, 1 do
  891.           if r4_7 < r8_7 and qa_tableofplayers_ct[r4_7][2] < qa_tableofplayers_ct[r8_7][2] or r8_7 < r4_7 and qa_tableofplayers_ct[r8_7][2] < qa_tableofplayers_ct[r4_7][2] then
  892.             qa_tableofplayers_ct[r4_7] = qa_tableofplayers_ct[r8_7]
  893.             qa_tableofplayers_ct[r8_7] = qa_tableofplayers_ct[r4_7]
  894.           end
  895.         end
  896.       end
  897.       for r4_7, r5_7 in pairs(player(0, "table")) do
  898.         if not player(r5_7, "bot") then
  899.           if qa_players[r5_7].scoretableimg ~= nil then
  900.             for r9_7 = 1, 8, 1 do
  901.               if qa_tableofplayers_t[r9_7] ~= nil then
  902.                 parse("hudtxt2 " .. r5_7 .. " " .. r9_7 + 7 .. " \xa9255255255" .. player(qa_tableofplayers_t[r9_7][1], "name") .. "; 35 " .. 65 + 35 * r9_7)
  903.                 parse("hudtxt2 " .. r5_7 .. " " .. r9_7 + 24 .. " \xa9255255255" .. qa_tableofplayers_t[r9_7][2] .. " " .. string.sub("   " .. player(qa_tableofplayers_t[r9_7][1], "deaths"), string.len(("   " .. player(qa_tableofplayers_t[r9_7][1], "deaths"))) - 4, string.len("   " .. player(qa_tableofplayers_t[r9_7][1], "deaths"))) .. "; 250 " .. 65 + 35 * r9_7 .. " 1")
  904.               else
  905.                 parse("hudtxt2 " .. r5_7 .. " " .. r9_7 + 7)
  906.                 parse("hudtxt2 " .. r5_7 .. " " .. r9_7 + 24)
  907.               end
  908.               if qa_tableofplayers_ct[r9_7] ~= nil then
  909.                 parse("hudtxt2 " .. r5_7 .. " " .. r9_7 - 1 .. " \xa9255255255" .. player(qa_tableofplayers_ct[r9_7][1], "name") .. "; 345 " .. 65 + 35 * r9_7)
  910.                 parse("hudtxt2 " .. r5_7 .. " " .. r9_7 + 15 .. " \xa9255255255" .. qa_tableofplayers_ct[r9_7][2] .. " " .. string.sub("   " .. player(qa_tableofplayers_ct[r9_7][1], "deaths"), string.len(("   " .. player(qa_tableofplayers_ct[r9_7][1], "deaths"))) - 4, string.len("   " .. player(qa_tableofplayers_ct[r9_7][1], "deaths"))) .. "; 560 " .. 65 + 35 * r9_7 .. " 1")
  911.               else
  912.                 parse("hudtxt2 " .. r5_7 .. " " .. r9_7 - 1)
  913.                 parse("hudtxt2 " .. r5_7 .. " " .. r9_7 + 15)
  914.               end
  915.             end
  916.           end
  917.           parse("hudtxt2 " .. r5_7 .. " 33 " .. qa_copyright .. "255255255" .. game("mp_winlimit") .. "/" .. qa_tableofplayers_t_score .. "/" .. qa_tableofplayers_ct_score .. "/" .. qa_players[r5_7].kills .. ";600 430; 1")
  918.         end
  919.       end
  920.     end
  921.   end
  922. end
  923. function qa_weapon_lighting_hit(r0_8, r1_8, r2_8, r3_8, r4_8, r5_8, r6_8)
  924.   -- line: [713, 749] id: 8
  925.   local r7_8 = r2_8 - r0_8
  926.   local r8_8 = r3_8 - r1_8
  927.   local r9_8 = math.sqrt(r7_8 * r7_8 + r8_8 * r8_8)
  928.   local r10_8 = nil
  929.   r10_8 = image(r5_8.imgpath, 0, 0, 1)
  930.   if r5_8.name == "Railgun" then
  931.     imagecolor(r10_8, qa_lasercolors[qa_players[r6_8].lasercolor][1], qa_lasercolors[qa_players[r6_8].lasercolor][2], qa_lasercolors[qa_players[r6_8].lasercolor][3])
  932.   else
  933.     imageblend(r10_8, 1)
  934.   end
  935.   imagepos(r10_8, r0_8 + r7_8 / 2, r1_8 + r8_8 / 2, r4_8 * 180 / 3.14 + 90)
  936.   tween_alpha(r10_8, r5_8.alpha, 0)
  937.   if r5_8.imgflipping then
  938.     local r11_8 = imagescale
  939.     local r12_8 = r10_8
  940.     local r13_8 = math.random()
  941.     if r13_8 > 0.5 then
  942.       r13_8 = 1 or -1
  943.     else
  944.       goto label_73 -- block#6 is visited secondly
  945.     end
  946.     local r14_8 = r9_8 / r5_8.imglength
  947.     local r15_8 = math.random()
  948.     if r15_8 > 0.5 then
  949.       r15_8 = 1 or -1
  950.     else
  951.       goto label_84 -- block#9 is visited secondly
  952.     end
  953.     r11_8(r12_8, r13_8, r14_8 * r15_8)
  954.   else
  955.     imagescale(r10_8, 1, r9_8 / r5_8.imglength)
  956.   end
  957.   timer(r5_8.alpha, "freeimage", r10_8)
  958.   if r5_8.name == "Lighting" or r5_8.name == "Railgun" then
  959.     if r5_8.name == "Railgun" then
  960.       r10_8 = image(r5_8.imgpath2, 0, 0, 1)
  961.       imagepos(r10_8, r0_8 + r7_8 / 2, r1_8 + r8_8 / 2, r4_8 * 180 / 3.14 + 90)
  962.       local r11_8 = imagescale
  963.       local r12_8 = r10_8
  964.       local r13_8 = math.random()
  965.       if r13_8 > 0.5 then
  966.         r13_8 = 1 or -1
  967.       else
  968.         goto label_135  -- block#17 is visited secondly
  969.       end
  970.       local r14_8 = r9_8 / r5_8.imglength
  971.       local r15_8 = math.random()
  972.       if r15_8 > 0.5 then
  973.         r15_8 = 1 or -1
  974.       else
  975.         goto label_146  -- block#20 is visited secondly
  976.       end
  977.       r11_8(r12_8, r13_8, r14_8 * r15_8)
  978.       imagecolor(r10_8, -qa_lasercolors[qa_players[r6_8].lasercolor][1], -qa_lasercolors[qa_players[r6_8].lasercolor][2], -qa_lasercolors[qa_players[r6_8].lasercolor][3])
  979.       tween_alpha(r10_8, r5_8.alpha, 0)
  980.       timer(r5_8.alpha, "freeimage", r10_8)
  981.       r10_8 = image("gfx/sprites/railexp.png", r2_8, r3_8, 1)
  982.       imagecolor(r10_8, qa_lasercolors[qa_players[r6_8].lasercolor][1], qa_lasercolors[qa_players[r6_8].lasercolor][2], qa_lasercolors[qa_players[r6_8].lasercolor][3])
  983.     else
  984.       r10_8 = image("gfx/sprites/railexp.png", r2_8, r3_8, 1)
  985.       imageblend(r10_8, 1)
  986.       imagecolor(r10_8, 75, 75, 255)
  987.     end
  988.     tween_rotateconstantly(r10_8, 875)
  989.     timer(100, "freeimage", r10_8)
  990.   end
  991. end
  992. GAME_NEW = true
  993. addhook("startround", "qa_startround")
  994. function qa_startround(r0_9)
  995.   -- line: [756, 832] id: 9
  996.   if GAME_NEW then
  997.     freetimer()
  998.     qa_players = {}
  999.     for r4_9 = 1, 32, 1 do
  1000.       qa_players[r4_9] = {}
  1001.       qa_players[r4_9].total_combo = 0
  1002.       qa_players[r4_9].total_impressive = 0
  1003.       qa_players[r4_9].total_humilation = 0
  1004.       qa_players[r4_9].lhit = 0
  1005.       qa_players[r4_9].kills = 0
  1006.     end
  1007.     qa_first_blood = false
  1008.     qa_leader = 0
  1009.   end
  1010.   qa_itemsimg = {}
  1011.   qa_mapitems = {}
  1012.   for r4_9 = 0, map("xsize"), 1 do
  1013.     for r8_9 = 0, map("ysize"), 1 do
  1014.       if entity(r4_9, r8_9, "exists") and entity(r4_9, r8_9, "typename") == "Env_Item" and entity(r4_9, r8_9, "int1") == 3 then
  1015.         qa_mapitems[#qa_mapitems + 1] = {}
  1016.         qa_mapitems[#qa_mapitems].itype = entity(r4_9, r8_9, "int0")
  1017.         qa_mapitems[#qa_mapitems].delay = entity(r4_9, r8_9, "int2")
  1018.         qa_mapitems[#qa_mapitems].x = r4_9
  1019.         qa_mapitems[#qa_mapitems].y = r8_9
  1020.         qa_mapitems[#qa_mapitems].TTS = 0
  1021.         additem(#qa_mapitems)
  1022.       end
  1023.     end
  1024.   end
  1025.   for r4_9, r5_9 in pairs(blocks) do
  1026.     r5_9.imgid = image(r5_9.imgfile, (r5_9.sx * 32 + r5_9.ex * 32 + 32) / 2, (r5_9.sy * 32 + r5_9.ey * 32 + 32) / 2, 3)
  1027.     imagescale(r5_9.imgid, 1 / r5_9.imgsize[1] * (r5_9.ex + 1 - r5_9.sx) * 32, 1 / r5_9.imgsize[2] * (r5_9.ey + 1 - r5_9.sy) * 32)
  1028.     imagealpha(r5_9.imgid, 0)
  1029.     imageblend(r5_9.imgid, 0)
  1030.   end
  1031.   for r4_9, r5_9 in pairs(trains) do
  1032.     r5_9.imgid = image(r5_9.imgfile, paths[r5_9.nextpath].x, paths[r5_9.nextpath].y, 0)
  1033.     imagescale(r5_9.imgid, 1 / r5_9.imgsize[1] * r5_9.sizex, 1 / r5_9.imgsize[2] * r5_9.sizey)
  1034.     r5_9.x = paths[r5_9.nextpath].x
  1035.     r5_9.y = paths[r5_9.nextpath].y
  1036.     r5_9.dx = 0
  1037.     r5_9.dy = 0
  1038.     qa_train_nextpath(id)
  1039.   end
  1040.   for r4_9 = 1, 32, 1 do
  1041.     qa_players[r4_9].last_shot = -10
  1042.     qa_players[r4_9].combo_shots = 0
  1043.     qa_players[r4_9].fly_controleble = 0
  1044.     qa_players[r4_9].fly_steps = 0
  1045.     qa_players[r4_9].fly_x = 0
  1046.     qa_players[r4_9].fly_y = 0
  1047.     qa_players[r4_9].fly_dx = 0
  1048.     qa_players[r4_9].fly_dy = 0
  1049.     qa_players[r4_9].strike_timer = -1
  1050.     qa_players[r4_9].strikes = {}
  1051.     qa_players[r4_9].ammo = {}
  1052.     qa_players[r4_9].weapons = {}
  1053.   end
  1054.   for r4_9, r5_9 in ipairs(player(0, "table")) do
  1055.     if player(r5_9, "team") > 0 then
  1056.       parse("spawnplayer " .. r5_9 .. " " .. player(r5_9, "x") .. " " .. player(r5_9, "y"))
  1057.     end
  1058.   end
  1059.   qa_ScoreTable("0 1")
  1060.   GAME_NEW = false
  1061. end
  1062. addhook("second", "qa_spawnitems")
  1063. function qa_spawnitems()
  1064.   -- line: [835, 856] id: 10
  1065.   for r3_10 = 1, #qa_mapitems, 1 do
  1066.     if qa_mapitems[r3_10].TTS > 0 then
  1067.       qa_mapitems[r3_10].TTS = qa_mapitems[r3_10].TTS - 1
  1068.       if qa_mapitems[r3_10].TTS == 0 then
  1069.         additem(r3_10)
  1070.       end
  1071.     end
  1072.   end
  1073.   for r3_10 = 1, #qa_itemsimg, 1 do
  1074.     if qa_itemsimg[r3_10] ~= nil and qa_itemsimg[r3_10].fadeout ~= nil and 0 < qa_itemsimg[r3_10].fadeout then
  1075.       qa_itemsimg[r3_10].fadeout = qa_itemsimg[r3_10].fadeout - 1
  1076.       if qa_itemsimg[r3_10].fadeout == 0 then
  1077.         removeitem(r3_10)
  1078.       end
  1079.     end
  1080.   end
  1081. end
  1082. function additem(r0_11, r1_11, r2_11, r3_11, r4_11, r5_11)
  1083.   -- line: [858, 878] id: 11
  1084.   if r1_11 == 60 or r1_11 == 61 or r1_11 == 62 or r1_11 == 51 then
  1085.     parse("sv_sound \"items/poweruprespawn.wav\"")
  1086.   end
  1087.   if r0_11 > 0 then
  1088.     r1_11 = qa_mapitems[r0_11].itype
  1089.     r2_11 = qa_mapitems[r0_11].x
  1090.     r3_11 = qa_mapitems[r0_11].y
  1091.     r4_11 = 0
  1092.     dontremoveble = qa_mapitems[r0_11].dontremoveble
  1093.   else
  1094.     r4_11 = tonumber(game("mp_weaponfadeout"))
  1095.   end
  1096.   parse("spawnitem " .. r1_11 .. " " .. r2_11 .. " " .. r3_11)
  1097.   qa_itemsimg[item(0, "table")[#item(0, "table")]] = {}
  1098.   qa_itemsimg[item(0, "table")[#item(0, "table")]].mapitem = r0_11
  1099.   qa_itemsimg[item(0, "table")[#item(0, "table")]].fadeout = r4_11
  1100.   qa_itemsimg[item(0, "table")[#item(0, "table")]].img = image(qa_item_types[r1_11].imgpath, r2_11 * 32 + 16, r3_11 * 32 + 16, 0)
  1101.   qa_itemsimg[item(0, "table")[#item(0, "table")]].bonustime = r5_11 or 30
  1102.   tween_rotateconstantly(qa_itemsimg[item(0, "table")[#item(0, "table")]].img, qa_item_types[r1_11].speedrot or 2)
  1103. end
  1104. function removeitem(r0_12)
  1105.   -- line: [880, 893] id: 12
  1106.   if qa_itemsimg[r0_12].mapitem == 0 or 0 < qa_itemsimg[r0_12].mapitem and 0 < qa_mapitems[qa_itemsimg[r0_12].mapitem].delay then
  1107.     parse("removeitem " .. r0_12)
  1108.     if qa_itemsimg[r0_12] ~= nil and qa_itemsimg[r0_12].img ~= nil then
  1109.       freeimage(qa_itemsimg[r0_12].img)
  1110.       if qa_itemsimg[r0_12].mapitem > 0 then
  1111.         qa_mapitems[qa_itemsimg[r0_12].mapitem].TTS = qa_mapitems[qa_itemsimg[r0_12].mapitem].delay
  1112.       end
  1113.     end
  1114.     qa_itemsimg[r0_12] = nil
  1115.   end
  1116. end
  1117. function qa_bullet_create(r0_13, r1_13, r2_13, r3_13, r4_13)
  1118.   -- line: [896, 930] id: 13
  1119.   local r5_13 = #qa_bullets + 1
  1120.   local r6_13 = math.cos(r2_13)
  1121.   oy = math.sin(r2_13)
  1122.   ox = r6_13
  1123.   r6_13 = {
  1124.     type = r3_13,
  1125.     player = r4_13,
  1126.     y = r1_13 + oy * r3_13.offset,
  1127.     x = r0_13 + ox * r3_13.offset,
  1128.   }
  1129.   if 0 < ox and ox < qa_players[r4_13].fly_dx or ox < 0 and qa_players[r4_13].fly_dx < ox then
  1130.     r6_13.dx = ox * r3_13.speed / r3_13.updates + qa_players[r4_13].fly_dx / r3_13.updates / 50 * math.abs(ox)
  1131.   else
  1132.     r6_13.dx = ox * r3_13.speed / r3_13.updates
  1133.   end
  1134.   if 0 < oy and oy < qa_players[r4_13].fly_dy or oy < 0 and qa_players[r4_13].fly_dy < oy then
  1135.     r6_13.dy = oy * r3_13.speed / r3_13.updates + qa_players[r4_13].fly_dy / r3_13.updates / 50 * math.abs(oy)
  1136.   else
  1137.     r6_13.dy = oy * r3_13.speed / r3_13.updates
  1138.   end
  1139.   r6_13.updates = r3_13.time * r3_13.updates
  1140.   r6_13.update = 0
  1141.   r6_13.update_speed = r3_13.updates / 50
  1142.   r6_13.imgid = image(r3_13.imgpath, 0, 0, 1)
  1143.   imagepos(r6_13.imgid, r6_13.x, r6_13.y, r2_13 * 180 / 3.14 + 90)
  1144.   imageblend(r6_13.imgid, 1)
  1145.   tween_rotateconstantly(r6_13.imgid, r3_13.speedrot)
  1146.   tween_move(r6_13.imgid, 1000 * r3_13.time, r6_13.x + r6_13.updates * r6_13.dx, r6_13.y + r6_13.updates * r6_13.dy)
  1147.   qa_bullets[r5_13] = r6_13
  1148. end
  1149. function qa_bullet_delete(r0_14, r1_14)
  1150.   -- line: [933, 940] id: 14
  1151.   if r1_14 then
  1152.     timer(r1_14, "freeimage", qa_bullets[r0_14].imgid)
  1153.   else
  1154.     freeimage(qa_bullets[r0_14].imgid)
  1155.   end
  1156.   table.remove(qa_bullets, r0_14)
  1157. end
  1158. addhook("always", "qa_always_bullets")
  1159. function qa_always_bullets()
  1160.   -- line: [944, 965] id: 15
  1161.   local r0_15 = 1
  1162.   local r1_15 = 0
  1163.   while qa_bullets[r0_15] do
  1164.     r1_15 = 0
  1165.     local r2_15 = qa_bullets[r0_15]
  1166.     r2_15.update = qa_bullets[r0_15].update + qa_bullets[r0_15].update_speed
  1167.     while true do
  1168.       r2_15 = qa_bullets[r0_15]
  1169.       if r2_15 then
  1170.         r2_15 = qa_bullets[r0_15].update
  1171.         if 1 <= r2_15 and r1_15 == 0 then
  1172.           qa_bullets[r0_15].update = qa_bullets[r0_15].update - 1
  1173.           local r3_15 = qa_bullets[r0_15].updates - 1
  1174.           qa_bullets[r0_15].updates = r3_15
  1175.           r2_15 = qa_bullets[r0_15].updates
  1176.           if r2_15 > 0 then
  1177.             r2_15 = qa_bullet_step(r0_15)
  1178.             r1_15 = r2_15
  1179.           else
  1180.             qa_bullet_delete(r0_15)
  1181.             r1_15 = 1
  1182.           end
  1183.         else
  1184.           break
  1185.         end
  1186.       else
  1187.         break
  1188.       end
  1189.     end
  1190.     r2_15 = r0_15 + 1
  1191.     r0_15 = r2_15 - r1_15
  1192.   end
  1193. end
  1194. function qa_bullet_step(r0_16)
  1195.   -- line: [968, 1006] id: 16
  1196.   qa_bullets[r0_16].x = qa_bullets[r0_16].x + qa_bullets[r0_16].dx
  1197.   qa_bullets[r0_16].y = qa_bullets[r0_16].y + qa_bullets[r0_16].dy
  1198.   local r1_16 = math.floor(qa_bullets[r0_16].x / 32)
  1199.   local r2_16 = math.floor(qa_bullets[r0_16].y / 32)
  1200.   if tile(r1_16, r2_16, "wall") and not tile(r1_16, r2_16, "obstacle") then
  1201.     if entity(r1_16, r2_16, "exists") and entity(r1_16, r2_16, "typename") == "Trigger_Hit" and entity(r1_16, r2_16, "state") == false then
  1202.       parse("trigger " .. entity(r1_16, r2_16, "trigger"))
  1203.     elseif entity(r1_16, r2_16, "exists") and entity(r1_16, r2_16, "typename") == "Env_Breakable" then
  1204.       parse("explosion " .. r1_16 * 32 + 16 .. " " .. r2_16 * 32 + 16 .. " 1 " .. qa_bullets[r0_16].type.damage .. " " .. id)
  1205.     end
  1206.     qa_bullets_exposion(r0_16, 0)
  1207.     return 1
  1208.   end
  1209.   for r6_16, r7_16 in pairs(player(0, "tableliving")) do
  1210.     local r8_16 = player(r7_16, "x")
  1211.     local r9_16 = player(r7_16, "y")
  1212.     local r10_16 = r8_16 - qa_bullets[r0_16].x
  1213.     local r11_16 = r9_16 - qa_bullets[r0_16].y
  1214.     if r10_16 * r10_16 + r11_16 * r11_16 < 196 then
  1215.       parse("sv_sound \"player/hit1.wav\"")
  1216.       qa_bullets_exposion(r0_16, r7_16)
  1217.       return 1
  1218.     end
  1219.   end
  1220.   for r6_16, r7_16 in pairs(object(0, "table")) do
  1221.     if object(r7_16, "type") == 30 then
  1222.       local r8_16 = object(r7_16, "x")
  1223.       local r9_16 = object(r7_16, "y")
  1224.       local r10_16 = r8_16 - qa_bullets[r0_16].x
  1225.       local r11_16 = r9_16 - qa_bullets[r0_16].y
  1226.       if r10_16 * r10_16 + r11_16 * r11_16 < 196 then
  1227.         qa_bullets_exposion(r0_16, 0)
  1228.         return 1
  1229.       end
  1230.     end
  1231.   end
  1232.   return 0
  1233. end
  1234. function qa_bullets_exposion(r0_17, r1_17)
  1235.   -- line: [1009, 1060] id: 17
  1236.   local r2_17 = qa_bullets[r0_17]
  1237.   local r3_17 = qa_bullets[r0_17].type
  1238.   parse("sv_sound \"" .. r3_17.hitsound .. "\"")
  1239.   if r3_17.hitflash then
  1240.     if r3_17.name == "BFG10K" then
  1241.       freeimage(qa_bullets[r0_17].imgid)
  1242.       qa_bullets[r0_17].imgid = image("gfx/weapons/bfgs.png", qa_bullets[r0_17].x, qa_bullets[r0_17].y, 1, 0)
  1243.       tween_rotateconstantly(qa_bullets[r0_17].imgid, 666)
  1244.       qa_bullet_delete(r0_17, 96)
  1245.     elseif r3_17.name == "Plasmagun" then
  1246.       freeimage(qa_bullets[r0_17].imgid)
  1247.       qa_bullets[r0_17].imgid = image("gfx/weapons/plasmas.bmp", qa_bullets[r0_17].x, qa_bullets[r0_17].y, 1, 0)
  1248.       imageblend(qa_bullets[r0_17].imgid, 1)
  1249.       imagescale(qa_bullets[r0_17].imgid, 1.5, 1.5)
  1250.       tween_rotateconstantly(qa_bullets[r0_17].imgid, 511)
  1251.       qa_bullet_delete(r0_17, 96)
  1252.     elseif r3_17.name == "RocketLauncher" then
  1253.       parse("explosion " .. r2_17.x .. " " .. r2_17.y .. " 40 0 0")
  1254.       parse("effect \"flare\" " .. r2_17.x .. " " .. r2_17.y .. " 99999 1 96 96 96")
  1255.       parse("effect \"fire\" " .. r2_17.x .. " " .. r2_17.y .. " 99999 8 255 255 255")
  1256.       qa_bullet_delete(r0_17, 0)
  1257.     else
  1258.       imagescale(qa_bullets[r0_17].imgid, 2, 2)
  1259.       tween_move(qa_bullets[r0_17].imgid, 50, qa_bullets[r0_17].x - qa_bullets[r0_17].dx * 0, qa_bullets[r0_17].y - qa_bullets[r0_17].dy * 0)
  1260.       qa_bullet_delete(r0_17, 50)
  1261.     end
  1262.   else
  1263.     qa_bullet_delete(r0_17)
  1264.   end
  1265.   for r7_17, r8_17 in pairs(player(0, "tableliving")) do
  1266.     local r9_17 = math.min(r3_17.exp_size + 14 - math.sqrt((player(r8_17, "x") - r2_17.x) ^ 2 + (player(r8_17, "y") - r2_17.y) ^ 2), r3_17.exp_size)
  1267.     if 0 < r9_17 and (r8_17 == r2_17.player or game("sv_friendlyfire") == "1" or game("sv_friendlyfire") == "0" and player(r2_17.player, "team") ~= player(r8_17, "team")) then
  1268.       qa_player_damage(r2_17.player, r3_17, r8_17, r3_17.damage / r3_17.exp_size * r9_17, r1_17)
  1269.     end
  1270.   end
  1271.   for r7_17, r8_17 in pairs(object(0, "table")) do
  1272.     if object(r8_17, "type") == 30 and 0 < math.min(r3_17.exp_size + 14 - math.sqrt((object(r8_17, "x") - r2_17.x) ^ 2 + (object(r8_17, "y") - r2_17.y) ^ 2), r3_17.exp_size) then
  1273.       parse("killobject " .. r8_17)
  1274.     end
  1275.   end
  1276. end
  1277. function qa_player_damage(r0_18, r1_18, r2_18, r3_18, r4_18)
  1278.   -- line: [1063, 1107] id: 18
  1279.   qa_players[r2_18].regeneration_dubl = 1
  1280.   if r3_18 == nil then
  1281.     r3_18 = r1_18.damage * math.max(math.min(qa_players[r0_18].quadtime, 1) * 4, 1)
  1282.   end
  1283.   local r5_18 = qa_players[r2_18].armor - r3_18 * 0.67
  1284.   local r6_18 = player(r2_18, "health") - r3_18 * 0.33
  1285.   if r5_18 < 0 then
  1286.     r6_18 = r6_18 + r5_18
  1287.     r5_18 = 0
  1288.   end
  1289.   if r6_18 > 0 then
  1290.     parse("sethealth " .. r2_18 .. " " .. r6_18)
  1291.     qa_players[r2_18].armor = r5_18
  1292.     qa_HUD(r2_18 .. " 0 0 0 0 0 1")
  1293.   else
  1294.     parse("customkill " .. r0_18 .. " \"killed\" " .. r2_18)
  1295.     if game("sv_gamemode") == "4" then
  1296.       if player(r0_18, "team") == 1 then
  1297.         if player(r2_18, "team") == 2 then
  1298.           parse("maket " .. r2_18)
  1299.         else
  1300.           parse("makect " .. r0_18)
  1301.         end
  1302.       elseif player(r0_18, "team") == 2 then
  1303.         if player(r2_18, "team") == 1 then
  1304.           parse("makect " .. r2_18)
  1305.         else
  1306.           parse("maket " .. r0_18)
  1307.         end
  1308.       end
  1309.     end
  1310.     kn = player(r0_18, "name")
  1311.     vn = player(r2_18, "name")
  1312.     if r0_18 == r2_18 then
  1313.       reason = vn .. " " .. r1_18.txtSuicide
  1314.     elseif r2_18 == r4_18 then
  1315.       reason = vn .. " " .. string.format(r1_18.txthit, kn)
  1316.     else
  1317.       reason = vn .. " " .. string.format(r1_18.txtradiushit, kn)
  1318.     end
  1319.     qa_customkill(reason)
  1320.   end
  1321. end
  1322. addhook("join", "qa_player_join")
  1323. function qa_player_join(r0_19)
  1324.   -- line: [1111, 1121] id: 19
  1325.   qa_players[r0_19].fly_steps = 0
  1326.   qa_players[r0_19].fly_x = 0
  1327.   qa_players[r0_19].fly_y = 0
  1328.   qa_players[r0_19].fly_dx = 0
  1329.   qa_players[r0_19].fly_dy = 0
  1330.   qa_players[r0_19].kills = 0
  1331.   timer(1000, "qa_starts", r0_19)
  1332.   timer(1000, "qa_itemsreload")
  1333. end
  1334. function qa_itemsreload()
  1335.   -- line: [1123, 1129] id: 20
  1336.   for r3_20, r4_20 in pairs(item(0, "table")) do
  1337.     if qa_itemsimg[r4_20] ~= nil then
  1338.       tween_rotateconstantly(qa_itemsimg[r4_20].img, qa_item_types[item(r4_20, "type")].speedrot or 2)
  1339.     end
  1340.   end
  1341. end
  1342. addhook("move", "qa_move")
  1343. function qa_move(r0_21, r1_21, r2_21, r3_21)
  1344.   -- line: [1133, 1163] id: 21
  1345.   if qa_players[r0_21].fly_steps == 0 and qa_players[r0_21].ontrain == 0 then
  1346.     for r7_21, r8_21 in pairs(jumps) do
  1347.       if r8_21[1] <= r1_21 and r8_21[2] <= r2_21 and r1_21 < r8_21[3] and r2_21 < r8_21[4] then
  1348.         qa_player_fly_start(r0_21, r8_21[5], r8_21[6], r8_21.steps, r8_21.cont)
  1349.         parse("sv_sound \"env/jumppad.wav\"")
  1350.         break
  1351.       end
  1352.     end
  1353.     for r7_21, r8_21 in pairs(planes) do
  1354.       if r8_21[1] <= r1_21 and r8_21[2] <= r2_21 and r1_21 < r8_21[3] and r2_21 < r8_21[4] then
  1355.         local r9_21 = qa_player_fly_start
  1356.         local r10_21 = r0_21
  1357.         local r11_21 = r8_21[5]
  1358.         local r12_21 = r8_21[6]
  1359.         local r13_21 = r8_21.steps or 1
  1360.         r9_21(r10_21, r11_21, r12_21, r13_21, r8_21.cont or 1)
  1361.         break
  1362.       end
  1363.     end
  1364.     for r7_21, r8_21 in pairs(trains) do
  1365.       if object(r8_21.imgid, "x") - r8_21.sizex / 2 < r1_21 and r1_21 < object(r8_21.imgid, "x") + r8_21.sizex / 2 and object(r8_21.imgid, "y") - r8_21.sizey / 2 < r2_21 and r2_21 < object(r8_21.imgid, "y") + r8_21.sizey / 2 then
  1366.         qa_players[r0_21].ontrain = r7_21
  1367.       end
  1368.     end
  1369.   elseif qa_players[r0_21].ontrain ~= 0 then
  1370.     train = trains[qa_players[r0_21].ontrain]
  1371.     if object(train.imgid, "x") - train.sizex / 2 >= r1_21 or r1_21 >= object(train.imgid, "x") + train.sizex / 2 or object(train.imgid, "y") - train.sizey / 2 >= r2_21 or r2_21 >= object(train.imgid, "y") + train.sizey / 2 then
  1372.       qa_players[r0_21].ontrain = 0
  1373.       qa_movetile(r0_21, player(r0_21, "tilex"), player(r0_21, "tiley"))
  1374.     end
  1375.   end
  1376. end
  1377. addhook("trigger", "qa_trigger")
  1378. function qa_trigger(r0_22, r1_22)
  1379.   -- line: [1166, 1174] id: 22
  1380.   for r5_22, r6_22 in pairs(blocks) do
  1381.     if r6_22.name == r0_22 and r6_22.imgid ~= nil then
  1382.       parse("sv_sound \"env/DR1_STRT.WAV\"")
  1383.       tween_alpha(r6_22.imgid, r6_22.timetodowned, 1)
  1384.       timer(r6_22.timetodowned, "blockactivate", r5_22)
  1385.     end
  1386.   end
  1387. end
  1388. function blockactivate(r0_23)
  1389.   -- line: [1176, 1188] id: 23
  1390.   r0_23 = blocks[tonumber(r0_23)]
  1391.   tween_alpha(r0_23.imgid, r0_23.timetouped, 0)
  1392.   parse("sv_sound \"env/DR1_END.WAV\"")
  1393.   for r4_23, r5_23 in pairs(player(0, "tableliving")) do
  1394.     x = player(r5_23, "tilex")
  1395.     y = player(r5_23, "tiley")
  1396.     if r0_23.sx <= x and r0_23.sy <= y and x <= r0_23.ex and y <= r0_23.ey then
  1397.       parse("customkill 0 \"was squished\" " .. r5_23)
  1398.       qa_customkill(player(r5_23, "name") .. " was squished")
  1399.     end
  1400.   end
  1401. end
  1402. addhook("movetile", "qa_movetile")
  1403. function qa_movetile(r0_24, r1_24, r2_24)
  1404.   -- line: [1191, 1207] id: 24
  1405.   local r3_24 = tile(r1_24, r2_24, "frame")
  1406.   if qa_players[r0_24].fly_steps == 0 and qa_players[r0_24].ontrain == 0 and deadlyframe[r3_24] ~= nil then
  1407.     if deadlyframe[r3_24].type == "hole" then
  1408.       parse("customkill 0 \"was in the wrong place\" " .. r0_24)
  1409.       parse("sv_sound \"player/die_abyss.wav\"")
  1410.     elseif deadlyframe[r3_24].type == "lava" then
  1411.       parse("customkill 0 \"does a back flip into the lava\" " .. r0_24)
  1412.       parse("sv_sound \"player/die_toxic.ogg\"")
  1413.     else
  1414.       parse("customkill 0 \"" .. deadlyframe[r3_24].type .. "\" " .. r0_24)
  1415.       if deadlyframe[r3_24].sound ~= nil then
  1416.         parse("sv_sound \"" .. deadlyframe[r3_24].sound .. "\"")
  1417.       end
  1418.     end
  1419.   end
  1420. end
  1421. function qa_player_fly_start(r0_25, r1_25, r2_25, r3_25, r4_25)
  1422.   -- line: [1210, 1215] id: 25
  1423.   qa_players[r0_25].fly_steps = r3_25 or 1
  1424.   local r7_25 = player(r0_25, "x")
  1425.   qa_players[r0_25].fly_y = player(r0_25, "y")
  1426.   qa_players[r0_25].fly_x = r7_25
  1427.   qa_players[r0_25].fly_dy = r2_25 / qa_players[r0_25].fly_steps
  1428.   qa_players[r0_25].fly_dx = r1_25 / qa_players[r0_25].fly_steps
  1429.   qa_players[r0_25].fly_controleble = r4_25 or 0
  1430. end
  1431. function qa_player_fly_update(r0_26)
  1432.   -- line: [1218, 1243] id: 26
  1433.   if qa_players[r0_26].fly_steps >= 1 then
  1434.     qa_players[r0_26].fly_steps = qa_players[r0_26].fly_steps - 1
  1435.     if qa_players[r0_26].fly_controleble ~= 0 then
  1436.       qa_players[r0_26].fly_x = (-qa_players[r0_26].fly_x + player(r0_26, "x")) / qa_players[r0_26].fly_controleble + qa_players[r0_26].fly_x + qa_players[r0_26].fly_dx
  1437.       qa_players[r0_26].fly_y = (-qa_players[r0_26].fly_y + player(r0_26, "y")) / qa_players[r0_26].fly_controleble + qa_players[r0_26].fly_y + qa_players[r0_26].fly_dy
  1438.     else
  1439.       qa_players[r0_26].fly_x = qa_players[r0_26].fly_x + qa_players[r0_26].fly_dx
  1440.       qa_players[r0_26].fly_y = qa_players[r0_26].fly_y + qa_players[r0_26].fly_dy
  1441.     end
  1442.     if 0 < qa_players[r0_26].fly_x - 16 and 0 < qa_players[r0_26].fly_y - 16 and qa_players[r0_26].fly_x + 16 < map("xsize") * 32 and qa_players[r0_26].fly_y + 16 < map("ysize") * 32 then
  1443.       parse("setpos " .. r0_26 .. " " .. qa_players[r0_26].fly_x .. " " .. qa_players[r0_26].fly_y)
  1444.     end
  1445.     if qa_players[r0_26].fly_steps == 0 then
  1446.       qa_players[r0_26].fly_dx = 0
  1447.       qa_players[r0_26].fly_dy = 0
  1448.       qa_move(r0_26, player(r0_26, "x"), player(r0_26, "y"))
  1449.       qa_movetile(r0_26, player(r0_26, "tilex"), player(r0_26, "tiley"))
  1450.     end
  1451.     if qa_players[r0_26].fly_steps == 0 then
  1452.       qa_player_fly_end(r0_26)
  1453.     end
  1454.   end
  1455. end
  1456. function qa_player_fly_end(r0_27)
  1457.   -- line: [1246, 1248] id: 27
  1458.   parse("sv_sound2 " .. r0_27 .. " \"player/fall1.wav\"")
  1459. end
  1460. addhook("always", "qa_always")
  1461. function qa_always()
  1462.   -- line: [1252, 1257] id: 28
  1463.   for r3_28, r4_28 in pairs(player(0, "tableliving")) do
  1464.     qa_player_fly_update(r4_28)
  1465.   end
  1466. end
  1467. addhook("join", "qa_combo_join", -1)
  1468. function qa_combo_join(r0_29)
  1469.   -- line: [1261, 1271] id: 29
  1470.   qa_players[r0_29].total_combo = 0
  1471.   qa_players[r0_29].total_impressive = 0
  1472.   qa_players[r0_29].total_humilation = 0
  1473.   qa_players[r0_29].last_shot = -10
  1474.   qa_players[r0_29].combo_shots = 0
  1475.   qa_players[r0_29].strike_timer = -1
  1476.   qa_players[r0_29].strikes = {}
  1477. end
  1478. addhook("ms100", "qa_combo_ms100")
  1479. function qa_combo_ms100()
  1480.   -- line: [1275, 1315] id: 30
  1481.   qa_time = qa_time + 0.1
  1482.   for r3_30, r4_30 in pairs(player(0, "table")) do
  1483.     if 0 < qa_players[r4_30].combo_shots and 2 < qa_time - qa_players[r4_30].last_shot then
  1484.       if qa_players[r4_30].combo_shots >= 2 then
  1485.         qa_players[r4_30].total_combo = qa_players[r4_30].total_combo + 1
  1486.       end
  1487.       qa_players[r4_30].combo_shots = 0
  1488.     end
  1489.   end
  1490.   for r3_30, r4_30 in ipairs(player(0, "tableliving")) do
  1491.     if qa_players[r4_30].oldWeapon ~= player(r4_30, "weapontype") then
  1492.       qa_HUD(r4_30 .. " 1 1")
  1493.     end
  1494.   end
  1495.   for r3_30, r4_30 in pairs(player(0, "table")) do
  1496.     local r5_30 = player(r4_30, "money")
  1497.     if r5_30 > 1 then
  1498.       parse("setmoney " .. r4_30 .. " " .. r5_30 - r5_30)
  1499.     end
  1500.     local r6_30 = qa_players[r4_30]
  1501.     if r6_30.strike_timer >= 0 then
  1502.       r6_30.strike_timer = r6_30.strike_timer - 1
  1503.     end
  1504.     if r6_30.strike_timer == 0 then
  1505.       for r10_30, r11_30 in ipairs(r6_30.strikes) do
  1506.         freeimage(r11_30)
  1507.       end
  1508.       r6_30.strikes = {}
  1509.     end
  1510.   end
  1511.   for r3_30, r4_30 in pairs(player(0, "tableliving")) do
  1512.     if qa_players[r4_30].speedtime > 1 then
  1513.       parse("effect \"colorsmoke\" " .. player(r4_30, "x") .. " " .. player(r4_30, "y") .. " 1 1 96 96 96")
  1514.     end
  1515.   end
  1516. end
  1517. qa_strikes = {}
  1518. function qa_strike_show(r0_31, r1_31)
  1519.   -- line: [1320, 1331] id: 31
  1520.   local r2_31 = qa_players[r0_31]
  1521.   r2_31.strike_timer = qa_strike_delay
  1522.   local r3_31 = r2_31.strikes
  1523.   if #r3_31 > 0 then
  1524.     for r7_31, r8_31 in ipairs(r3_31) do
  1525.       imagepos(r8_31, r7_31 * 20 - (#r3_31 + 1) * 10 - 10 + 320, 210, 0)
  1526.     end
  1527.   end
  1528.   local r4_31 = #r3_31 + 1
  1529.   r3_31[r4_31] = image(r1_31, r4_31 * 10 - 10 + 320, 210, 2, r0_31)
  1530. end
  1531. addhook("kill", "qa_kill")
  1532. function qa_kill(r0_32, r1_32, r2_32)
  1533.   -- line: [1335, 1414] id: 32
  1534.   if r1_32 ~= r0_32 then
  1535.     local r3_32 = qa_players[r0_32]
  1536.     r3_32.combo_shots = r3_32.combo_shots + 1
  1537.     r3_32.last_shot = qa_time
  1538.     if r3_32.combo_shots >= 2 then
  1539.       parse("sv_sound2 \"..killer..\" \"fun/excellent.wav\"")
  1540.       qa_strike_show(r0_32, "gfx/qa2d/excellent.png")
  1541.     end
  1542.     if r2_32 == 69 then
  1543.       qa_strike_show(r0_32, "gfx/qa2d/humiliation.png")
  1544.       parse("sv_sound2 " .. r0_32 .. " \"fun/humiliation.wav\"")
  1545.       r3_32.total_humilation = r3_32.total_humilation + 1
  1546.     end
  1547.     if r3_32.combo_shots == 1 and qa_first_blood == false then
  1548.       qa_first_blood = true
  1549.       parse("sv_sound \"fun/firstblood.wav\"")
  1550.     elseif r3_32.combo_shots == 2 then
  1551.       parse("sv_sound \"fun/doublekill.wav\"")
  1552.     elseif r3_32.combo_shots == 3 then
  1553.       parse("sv_sound \"fun/triplekill.wav\"")
  1554.     elseif r3_32.combo_shots == 4 then
  1555.       parse("sv_sound \"fun/killingspree.wav\"")
  1556.     elseif r3_32.combo_shots == 5 then
  1557.       parse("sv_sound \"fun/rampage.wav\"")
  1558.     elseif r3_32.combo_shots == 6 then
  1559.       parse("sv_sound \"fun/multikill.wav\"")
  1560.     elseif r3_32.combo_shots == 7 then
  1561.       parse("sv_sound \"fun/ultrakill.wav\"")
  1562.     elseif r3_32.combo_shots == 8 then
  1563.       parse("sv_sound \"fun/monsterkill.wav\"")
  1564.     elseif r3_32.combo_shots == 9 then
  1565.       parse("sv_sound \"fun/unstoppable.wav\"")
  1566.     elseif r3_32.combo_shots >= 10 then
  1567.       parse("sv_sound \"fun/godlike.wav\"")
  1568.     end
  1569.     qa_players[r1_32].armor = 0
  1570.     if game("sv_gamemode") == "1" or player(r0_32, "team") ~= player(r1_32, "team") then
  1571.       r3_32.kills = r3_32.kills + 1
  1572.     else
  1573.       r3_32.kills = r3_32.kills - 1
  1574.     end
  1575.     if game("sv_gamemode") == "1" then
  1576.       if qa_leader == 0 then
  1577.         qa_leader = r0_32
  1578.         parse("sv_sound2 " .. r0_32 .. " \"fun/tiedlead.wav\"")
  1579.       elseif r0_32 ~= qa_leader and qa_players[qa_leader].kills < r3_32.kills then
  1580.         parse("sv_sound2 " .. qa_leader .. " \"fun/lostlead.wav\"")
  1581.         parse("sv_sound2 " .. r0_32 .. " \"fun/tiedlead.wav\"")
  1582.         qa_leader = r0_32
  1583.       end
  1584.       if 0 < tonumber(game("mp_winlimit")) and r0_32 == qa_leader then
  1585.         if tonumber(game("mp_winlimit")) <= r3_32.kills then
  1586.           parse("sv_sound \"fun/gameend.wav\"")
  1587.           timer(0, "qa_endround")
  1588.         elseif r3_32.kills + 1 == tonumber(game("mp_winlimit")) then
  1589.           parse("sv_sound \"fun/1_frag.wav\"")
  1590.         elseif r3_32.kills + 2 == tonumber(game("mp_winlimit")) then
  1591.           parse("sv_sound \"fun/2_frags.wav\"")
  1592.         elseif r3_32.kills + 3 == tonumber(game("mp_winlimit")) then
  1593.           parse("sv_sound \"fun/3_frags.wav\"")
  1594.         end
  1595.       end
  1596.     else
  1597.       qa_ScoreTable("0 1")
  1598.       if 0 < tonumber(game("mp_winlimit")) and (tonumber(game("mp_winlimit")) <= qa_tableofplayers_t_score or tonumber(game("mp_winlimit")) <= qa_tableofplayers_ct_score) then
  1599.         parse("sv_sound \"fun/gameend.wav\"")
  1600.         timer(0, "qa_endround")
  1601.       end
  1602.     end
  1603.   end
  1604. end
  1605. function qa_endround()
  1606.   -- line: [1416, 1474] id: 33
  1607.   freetimer()
  1608.   qa_end = true
  1609.   if #qa_bullets > 0 then
  1610.     for r3_33 = 1, #qa_bullets, 1 do
  1611.       qa_bullet_delete(1)
  1612.     end
  1613.   end
  1614.   for r3_33, r4_33 in pairs(object(0, "table")) do
  1615.     if object(r4_33, "type") == 40 then
  1616.       freeimage(r4_33)
  1617.     end
  1618.   end
  1619.   qa_ScoreTable(0)
  1620.   function qa_spawnitems()
  1621.     -- line: [1430, 1430] id: 34
  1622.   end
  1623.   freehook("join", "qa_player_join")
  1624.   freehook("die", "qa_die")
  1625.   function qa_startplay(r0_35)
  1626.     -- line: [1433, 1462] id: 35
  1627.     if game("sv_gamemode") == "1" then
  1628.       for r4_35 = 1, #16, 1 do
  1629.         if qa_tableofplayers[r4_35] ~= nil then
  1630.           timer(0, "parse", "hudtxt " .. r4_35 - 1 .. " \xa9255255255" .. string.sub(player(qa_tableofplayers[r4_35][1], "name"), 1, 15) .. "; " .. 70 + 310 * math.floor(r4_35 / 9) .. " " .. 65 + 35 * r4_35 - 280 * math.floor(r4_35 / 9))
  1631.           timer(0, "parse", "hudtxt " .. r4_35 + 15 .. " \xa9255255255" .. qa_tableofplayers[r4_35][2] .. " " .. string.sub("   " .. player(qa_tableofplayers[r4_35][1], "deaths"), string.len(("   " .. player(qa_tableofplayers[r4_35][1], "deaths"))) - 4, string.len("   " .. player(qa_tableofplayers[r4_35][1], "deaths"))) .. "; " .. 250 + 310 * math.floor(r4_35 / 9) .. " " .. 65 + 35 * r4_35 - 280 * math.floor(r4_35 / 9) .. " -1")
  1632.         else
  1633.           timer(0, "parse", "hudtxt " .. r4_35 - 1)
  1634.           timer(0, "parse", "hudtxt " .. r4_35 + 15)
  1635.         end
  1636.       end
  1637.     else
  1638.       for r4_35 = 1, 8, 1 do
  1639.         if qa_tableofplayers_t[r4_35] ~= nil then
  1640.           timer(0, "parse", "hudtxt " .. r0_35 .. " " .. r4_35 + 7 .. " \xa9255255255" .. player(qa_tableofplayers_t[r4_35][1], "name") .. "; 35 " .. 65 + 35 * r4_35)
  1641.           timer(0, "parse", "hudtxt " .. r0_35 .. " " .. r4_35 + 24 .. " \xa9255255255" .. qa_tableofplayers_t[r4_35][2] .. " " .. string.sub("   " .. player(qa_tableofplayers_t[r4_35][1], "deaths"), string.len(("   " .. player(qa_tableofplayers_t[r4_35][1], "deaths"))) - 4, string.len("   " .. player(qa_tableofplayers_t[r4_35][1], "deaths"))) .. "; 250 " .. 65 + 35 * r4_35 .. " 1")
  1642.         else
  1643.           timer(0, "parse", "hudtxt " .. r0_35 .. " " .. r4_35 + 7)
  1644.           timer(0, "parse", "hudtxt " .. r0_35 .. " " .. r4_35 + 24)
  1645.         end
  1646.         if qa_tableofplayers_ct[r4_35] ~= nil then
  1647.           timer(0, "parse", "hudtxt " .. r0_35 .. " " .. r4_35 - 1 .. " \xa9255255255" .. player(qa_tableofplayers_ct[r4_35][1], "name") .. "; 345 " .. 65 + 35 * r4_35)
  1648.           timer(0, "parse", "hudtxt " .. r0_35 .. " " .. r4_35 + 15 .. " \xa9255255255" .. qa_tableofplayers_ct[r4_35][2] .. " " .. string.sub("   " .. player(qa_tableofplayers_ct[r4_35][1], "deaths"), string.len(("   " .. player(qa_tableofplayers_ct[r4_35][1], "deaths"))) - 4, string.len("   " .. player(qa_tableofplayers_ct[r4_35][1], "deaths"))) .. "; 560 " .. 65 + 35 * r4_35 .. " 1")
  1649.         else
  1650.           timer(0, "parse", "hudtxt " .. r0_35 .. " " .. r4_35 - 1)
  1651.           timer(0, "parse", "hudtxt " .. r0_35 .. " " .. r4_35 + 15)
  1652.         end
  1653.       end
  1654.     end
  1655.   end
  1656.   for r3_33, r4_33 in pairs(player(0, "team1")) do
  1657.     if player(r4_33, "health") > 0 then
  1658.       parse("setdeaths " .. r4_33 .. " " .. player(r4_33, "deaths") - 1)
  1659.     end
  1660.     parse("makespec " .. r4_33)
  1661.   end
  1662.   for r3_33, r4_33 in pairs(player(0, "team2")) do
  1663.     if player(r4_33, "health") > 0 then
  1664.       parse("setdeaths " .. r4_33 .. " " .. player(r4_33, "deaths") - 1)
  1665.     end
  1666.     parse("makespec " .. r4_33)
  1667.   end
  1668.   addhook("team", "qa_team")
  1669.   function qa_team(r0_36, r1_36, r2_36)
  1670.     -- line: [1472, 1472] id: 36
  1671.     return 1
  1672.   end
  1673.   timer(10000, "parse", "changemap " .. game("nextmap"))
  1674. end
  1675. addhook("attack", "qa_strike_attack")
  1676. function qa_strike_attack(r0_37)
  1677.   -- line: [1477, 1484] id: 37
  1678.   if qa_players[r0_37].last_shot == 87 then
  1679.     qa_players[r0_37].laser_shot = true
  1680.   else
  1681.     qa_players[r0_37].laser_shot = false
  1682.   end
  1683.   qa_players[r0_37].last_shot = 0
  1684. end
  1685. addhook("hit", "qa_hit_bullets")
  1686. function qa_hit_bullets(r0_38, r1_38, r2_38, r3_38, r4_38)
  1687.   -- line: [1488, 1501] id: 38
  1688.   if r1_38 > 0 then
  1689.     if qa_players[r1_38].laser_shot then
  1690.       qa_players[r1_38].total_impressive = qa_players[r1_38].total_impressive + 1
  1691.       parse("sv_sound2 " .. r1_38 .. " \"fun/impressive.wav\"")
  1692.       qa_strike_show(r1_38, "gfx/qa2d/impressive.png")
  1693.     end
  1694.     qa_players[r1_38].last_shot = r2_38
  1695.     if r2_38 == 69 or r2_38 == 49 then
  1696.       qa_player_damage(r1_38, qa_weapon_types[r2_38], r0_38, r3_38, r0_38)
  1697.       return 1
  1698.     end
  1699.   end
  1700. end
  1701. qa_players = {}
  1702. for r3_0 = 1, 32, 1 do
  1703.   qa_players[r3_0] = {}
  1704.   qa_players[r3_0].total_combo = 0
  1705.   qa_players[r3_0].total_impressive = 0
  1706.   qa_players[r3_0].total_humilation = 0
  1707.   qa_players[r3_0].last_shot = -10
  1708.   qa_players[r3_0].combo_shots = 0
  1709.   qa_players[r3_0].lhit = 0
  1710.   qa_players[r3_0].fly_controleble = 1
  1711.   qa_players[r3_0].fly_steps = 0
  1712.   qa_players[r3_0].fly_x = 0
  1713.   qa_players[r3_0].fly_y = 0
  1714.   qa_players[r3_0].fly_dx = 0
  1715.   qa_players[r3_0].fly_dy = 0
  1716.   qa_players[r3_0].strike_timer = -1
  1717.   qa_players[r3_0].strikes = {}
  1718. end
  1719. addhook("walkover", "qa_walkover")
  1720. function qa_walkover(r0_39, r1_39, r2_39, r3_39, r4_39, r5_39)
  1721.   -- line: [1528, 1705] id: 39
  1722.   if player(r0_39, "health") > 0 then
  1723.     local r6_39 = itemtype(r2_39, "name")
  1724.     local r7_39 = qa_players[r0_39].armor
  1725.     local r8_39 = player(r0_39, "health")
  1726.     local r9_39 = player(r0_39, "money")
  1727.     if r2_39 == 62 then
  1728.       parse("sv_sound \"items/quad.wav\"")
  1729.       if qa_players[r0_39].quadtime < 1 then
  1730.         qa_players[r0_39].quadimg = image("gfx/player/randomplayer.bmp", 1, 0, r0_39 + 200)
  1731.         imagecolor(qa_players[r0_39].quadimg, 0, 255, 255)
  1732.       end
  1733.       qa_players[r0_39].quadtime = qa_players[r0_39].quadtime + qa_itemsimg[r1_39].bonustime
  1734.       removeitem(r1_39)
  1735.       parse("hudtxt2 " .. r0_39 .. " 39 " .. qa_copyright .. "175175255" .. qa_players[r0_39].quadtime .. ";40 375")
  1736.       qa_HUD(r0_39 .. " 0 0 0 0 0 0 0 1")
  1737.       return 1
  1738.     elseif r2_39 == 51 then
  1739.       parse("sv_sound \"items/invisibility.wav\"")
  1740.       qa_players[r0_39].invisibility = qa_players[r0_39].invisibility + qa_itemsimg[r1_39].bonustime
  1741.       parse("setarmor " .. r0_39 .. " 206")
  1742.       removeitem(r1_39)
  1743.       parse("hudtxt2 " .. r0_39 .. " 36 " .. qa_copyright .. "050050255" .. qa_players[r0_39].invisibility .. ";40 295")
  1744.       qa_HUD(r0_39 .. " 0 0 0 0 0 0 0 1")
  1745.       return 1
  1746.     elseif r2_39 == 61 then
  1747.       parse("sv_sound \"items/haste.wav\"")
  1748.       qa_players[r0_39].speedtime = qa_players[r0_39].speedtime + qa_itemsimg[r1_39].bonustime
  1749.       qa_HUD(r0_39 .. " 0 0 1")
  1750.       removeitem(r1_39)
  1751.       parse("hudtxt2 " .. r0_39 .. " 38 " .. qa_copyright .. "255255125" .. qa_players[r0_39].speedtime .. ";40 335")
  1752.       qa_HUD(r0_39 .. " 0 0 0 0 0 0 0 1")
  1753.       return 1
  1754.     elseif r2_39 == 60 then
  1755.       parse("sv_sound \"items/regeneration.wav\"")
  1756.       if qa_players[r0_39].regentime < 1 then
  1757.         qa_players[r0_39].regenimg = image("gfx/qa2d/q_sphere.png", 0, 0, r0_39 + 200)
  1758.         imagecolor(qa_players[r0_39].regenimg, 255, 0, 0)
  1759.         tween_rotateconstantly(qa_players[r0_39].regenimg, 32)
  1760.       end
  1761.       qa_players[r0_39].regentime = qa_players[r0_39].regentime + qa_itemsimg[r1_39].bonustime
  1762.       removeitem(r1_39)
  1763.       parse("hudtxt2 " .. r0_39 .. " 37 " .. qa_copyright .. "255050050" .. qa_players[r0_39].regentime .. ";40 415")
  1764.       qa_HUD(r0_39 .. " 0 0 0 0 0 0 0 1")
  1765.       return 1
  1766.     elseif r2_39 == 57 then
  1767.       if r7_39 < 200 then
  1768.         parse("sv_sound \"items/kevlar.wav\"")
  1769.         qa_players[r0_39].armor = math.min(r7_39 + 50, 200)
  1770.         removeitem(r1_39)
  1771.         qa_HUD(r0_39 .. " 0 0 0 0 0 1")
  1772.       end
  1773.       return 1
  1774.     elseif r2_39 == 58 then
  1775.       if r7_39 < 200 then
  1776.         parse("sv_sound \"items/kevlar.wav\"")
  1777.         qa_players[r0_39].armor = math.min(r7_39 + 100, 200)
  1778.         removeitem(r1_39)
  1779.         qa_HUD(r0_39 .. " 0 0 0 0 0 1")
  1780.       end
  1781.       return 1
  1782.     elseif r2_39 == 64 then
  1783.       if r8_39 < 100 then
  1784.         parse("sv_sound \"items/health.wav\"")
  1785.         parse("sethealth " .. r0_39 .. " " .. math.min(r8_39 + 50, 100))
  1786.         removeitem(r1_39)
  1787.         return 1
  1788.       end
  1789.       return 1
  1790.     elseif r2_39 == 65 then
  1791.       if r8_39 < 100 then
  1792.         parse("sv_sound \"items/health.wav\"")
  1793.         parse("sethealth " .. r0_39 .. " " .. math.min(r8_39 + 25, 100))
  1794.         removeitem(r1_39)
  1795.       end
  1796.       return 1
  1797.     elseif r2_39 == 66 then
  1798.       parse("sv_sound \"items/health.wav\"")
  1799.       parse("sethealth " .. r0_39 .. " " .. r8_39 + 5)
  1800.       removeitem(r1_39)
  1801.       return 1
  1802.     elseif r2_39 == 68 then
  1803.       parse("sv_sound \"items/megahealth.wav\"")
  1804.       parse("sethealth " .. r0_39 .. " " .. r8_39 + 100)
  1805.       removeitem(r1_39)
  1806.       return 1
  1807.     elseif r2_39 == 67 then
  1808.       if r7_39 < 201 then
  1809.         parse("sv_sound \"items/shard.wav\"")
  1810.         qa_players[r0_39].armor = math.min(r7_39 + 5, 200)
  1811.         removeitem(r1_39)
  1812.         qa_HUD(r0_39 .. " 0 0 0 0 0 1")
  1813.       end
  1814.       return 1
  1815.     elseif 52 <= r2_39 and r2_39 <= 53 then
  1816.       if qa_players[r0_39].bonus == 0 then
  1817.         qa_players[r0_39].bonus = r2_39 - 51
  1818.         removeitem(r1_39)
  1819.         qa_HUD(r0_39 .. " 0 0 0 0 0 0 0 0 1")
  1820.       end
  1821.       return 1
  1822.     elseif r2_39 ~= 70 and r2_39 ~= 71 then
  1823.       parse("sv_sound \"items/pickup.wav\"")
  1824.       removeitem(r1_39)
  1825.       if r2_39 == 1 then
  1826.         qa_players[r0_39].ammo[2] = math.min(qa_players[r0_39].ammo[2] + qa_agap[2], qa_maiw[2])
  1827.         if qa_players[r0_39].weapons[2] == 1 then
  1828.           parse("equip " .. r0_39 .. " 21")
  1829.         end
  1830.         qa_HUD(r0_39 .. " 1")
  1831.         return 1
  1832.       elseif r2_39 == 2 then
  1833.         qa_players[r0_39].ammo[3] = math.min(qa_players[r0_39].ammo[3] + qa_agap[3], qa_maiw[3])
  1834.         if qa_players[r0_39].weapons[3] == 1 then
  1835.           parse("equip " .. r0_39 .. " 10")
  1836.         end
  1837.         qa_HUD(r0_39 .. " 1")
  1838.         return 1
  1839.       elseif r2_39 == 3 then
  1840.         qa_players[r0_39].ammo[4] = math.min(qa_players[r0_39].ammo[4] + qa_agap[4], qa_maiw[4])
  1841.         if qa_players[r0_39].weapons[4] == 1 then
  1842.           parse("equip " .. r0_39 .. " 49")
  1843.         end
  1844.         qa_HUD(r0_39 .. " 1")
  1845.         return 1
  1846.       elseif r2_39 == 4 then
  1847.         qa_players[r0_39].ammo[5] = math.min(qa_players[r0_39].ammo[5] + qa_agap[5], qa_maiw[5])
  1848.         if qa_players[r0_39].weapons[5] == 1 then
  1849.           parse("equip " .. r0_39 .. " 77")
  1850.         end
  1851.         qa_HUD(r0_39 .. " 1")
  1852.         return 1
  1853.       elseif r2_39 == 5 then
  1854.         qa_players[r0_39].ammo[6] = math.min(qa_players[r0_39].ammo[6] + qa_agap[6], qa_maiw[6])
  1855.         if qa_players[r0_39].weapons[6] == 1 then
  1856.           parse("equip " .. r0_39 .. " 85")
  1857.         end
  1858.         qa_HUD(r0_39 .. " 1")
  1859.         return 1
  1860.       elseif r2_39 == 6 then
  1861.         qa_players[r0_39].ammo[7] = math.min(qa_players[r0_39].ammo[7] + qa_agap[7], qa_maiw[7])
  1862.         if qa_players[r0_39].weapons[7] == 1 then
  1863.           parse("equip " .. r0_39 .. " 87")
  1864.         end
  1865.         qa_HUD(r0_39 .. " 1")
  1866.         return 1
  1867.       elseif r2_39 == 21 then
  1868.         qa_players[r0_39].ammo[8] = math.min(qa_players[r0_39].ammo[8] + qa_agap[8], qa_maiw[8])
  1869.         if qa_players[r0_39].weapons[8] == 1 then
  1870.           parse("equip " .. r0_39 .. " 38")
  1871.         end
  1872.         qa_HUD(r0_39 .. " 1")
  1873.         return 1
  1874.       elseif r2_39 == 22 then
  1875.         qa_players[r0_39].ammo[9] = math.min(qa_players[r0_39].ammo[9] + qa_agap[9], qa_maiw[9])
  1876.         if qa_players[r0_39].weapons[9] == 1 then
  1877.           parse("equip " .. r0_39 .. " 11")
  1878.         end
  1879.         qa_HUD(r0_39 .. " 1")
  1880.         return 1
  1881.       end
  1882.       if r2_39 == 21 then
  1883.         parse("equip " .. r0_39 .. " " .. r2_39)
  1884.         if qa_players[r0_39].weapons[2] == 0 then
  1885.           parse("setweapon " .. r0_39 .. " " .. r2_39)
  1886.         end
  1887.         qa_players[r0_39].ammo[2] = math.max(math.min(qa_players[r0_39].ammo[2] + qa_players[r0_39].weapons[2], qa_maiw[2]), qa_agwp[2])
  1888.         qa_players[r0_39].weapons[2] = 1
  1889.       elseif r2_39 == 10 then
  1890.         parse("equip " .. r0_39 .. " " .. r2_39)
  1891.         if qa_players[r0_39].weapons[3] == 0 then
  1892.           parse("setweapon " .. r0_39 .. " " .. r2_39)
  1893.         end
  1894.         qa_players[r0_39].ammo[3] = math.max(math.min(qa_players[r0_39].ammo[3] + qa_players[r0_39].weapons[3], qa_maiw[3]), qa_agwp[3])
  1895.         qa_players[r0_39].weapons[3] = 1
  1896.       elseif r2_39 == 11 then
  1897.         parse("equip " .. r0_39 .. " " .. r2_39)
  1898.         if qa_players[r0_39].weapons[9] == 0 then
  1899.           parse("setweapon " .. r0_39 .. " " .. r2_39)
  1900.         end
  1901.         qa_players[r0_39].ammo[9] = math.max(math.min(qa_players[r0_39].ammo[9] + qa_players[r0_39].weapons[9], qa_maiw[9]), qa_agwp[9])
  1902.         qa_players[r0_39].weapons[9] = 1
  1903.       elseif r2_39 == 38 then
  1904.         parse("equip " .. r0_39 .. " " .. r2_39)
  1905.         if qa_players[r0_39].weapons[8] == 0 then
  1906.           parse("setweapon " .. r0_39 .. " " .. r2_39)
  1907.         end
  1908.         qa_players[r0_39].ammo[8] = math.max(math.min(qa_players[r0_39].ammo[8] + qa_players[r0_39].weapons[8], qa_maiw[8]), qa_agwp[8])
  1909.         qa_players[r0_39].weapons[8] = 1
  1910.       elseif r2_39 == 45 then
  1911.         parse("equip " .. r0_39 .. " 87")
  1912.         if qa_players[r0_39].weapons[7] == 0 then
  1913.           parse("setweapon " .. r0_39 .. " 87")
  1914.         end
  1915.         qa_players[r0_39].ammo[7] = math.max(math.min(qa_players[r0_39].ammo[7] + qa_players[r0_39].weapons[7], qa_maiw[7]), qa_agwp[7])
  1916.         qa_players[r0_39].weapons[7] = 1
  1917.       elseif r2_39 == 85 then
  1918.         parse("equip " .. r0_39 .. " " .. r2_39)
  1919.         if qa_players[r0_39].weapons[6] == 0 then
  1920.           parse("setweapon " .. r0_39 .. " " .. r2_39)
  1921.         end
  1922.         qa_players[r0_39].ammo[6] = math.max(math.min(qa_players[r0_39].ammo[6] + qa_players[r0_39].weapons[6], qa_maiw[6]), qa_agwp[6])
  1923.         qa_players[r0_39].weapons[6] = 1
  1924.       elseif r2_39 == 48 then
  1925.         parse("equip " .. r0_39 .. " 77")
  1926.         if qa_players[r0_39].weapons[5] == 0 then
  1927.           parse("setweapon " .. r0_39 .. " " .. 77)
  1928.         end
  1929.         qa_players[r0_39].ammo[5] = math.max(math.min(qa_players[r0_39].ammo[5] + qa_players[r0_39].weapons[5], qa_maiw[5]), qa_agwp[5])
  1930.         qa_players[r0_39].weapons[5] = 1
  1931.         qa_HUD(r0_39 .. " 1 1")
  1932.         return 1
  1933.       elseif r2_39 == 49 then
  1934.         parse("equip " .. r0_39 .. " " .. r2_39)
  1935.         if qa_players[r0_39].weapons[4] == 0 then
  1936.           parse("setweapon " .. r0_39 .. " " .. r2_39)
  1937.         end
  1938.         qa_players[r0_39].ammo[4] = math.max(math.min(qa_players[r0_39].ammo[4] + qa_players[r0_39].weapons[4], qa_maiw[4]), qa_agwp[4])
  1939.         qa_players[r0_39].weapons[4] = 1
  1940.       end
  1941.       qa_HUD(r0_39 .. " 1 1")
  1942.       return 1
  1943.     end
  1944.   end
  1945. end
  1946. addhook("second", "qa_second")
  1947. function qa_second()
  1948.   -- line: [1709, 1774] id: 40
  1949.   for r3_40, r4_40 in pairs(player(0, "tableliving")) do
  1950.     local r5_40 = qa_players[r4_40].armor
  1951.     local r6_40 = player(r4_40, "health")
  1952.     local r7_40 = qa_players[r4_40]
  1953.     if r5_40 > 100 then
  1954.       r7_40.armor = r5_40 - 1
  1955.       qa_HUD(r4_40 .. " 0 0 0 0 0 1")
  1956.     end
  1957.     if r6_40 > 100 then
  1958.       parse("sethealth " .. r4_40 .. " " .. r6_40 - 1)
  1959.     end
  1960.     if r7_40.quadtime > 0 then
  1961.       parse("sv_sound2 " .. r4_40 .. " \"items/sqd.wav\"")
  1962.       r7_40.quadtime = r7_40.quadtime - 1
  1963.       if r7_40.quadtime == 0 then
  1964.         freeimage(r7_40.quadimg)
  1965.         qa_HUD(r4_40 .. " 0 0 0 0 0 0 0 1")
  1966.       else
  1967.         parse("hudtxt2 " .. r4_40 .. " 39 " .. qa_copyright .. "175175255" .. r7_40.quadtime .. ";40 375")
  1968.       end
  1969.     end
  1970.     if r7_40.speedtime > 0 then
  1971.       parse("sv_sound2 " .. r4_40 .. " \"items/health5.wav\"")
  1972.       r7_40.speedtime = r7_40.speedtime - 1
  1973.       if r7_40.speedtime == 0 then
  1974.         qa_HUD(r4_40 .. " 0 0 1 0 0 0 0 1")
  1975.       else
  1976.         parse("hudtxt2 " .. r4_40 .. " 38 " .. qa_copyright .. "255255125" .. r7_40.speedtime .. ";40 335")
  1977.       end
  1978.     end
  1979.     if r7_40.regentime > 0 then
  1980.       parse("sv_sound2 " .. r4_40 .. " \"items/regen.wav\"")
  1981.       r7_40.regentime = r7_40.regentime - 1
  1982.       local r8_40 = 0
  1983.       if r7_40.regeneration_dubl == 0 then
  1984.         r8_40 = math.max(player(r4_40, "health") - 195, 0)
  1985.         parse("sethealth " .. r4_40 .. " " .. player(r4_40, "health") + 5)
  1986.       else
  1987.         r8_40 = math.max(player(r4_40, "health") - 185, 0)
  1988.         parse("sethealth " .. r4_40 .. " " .. player(r4_40, "health") + 15)
  1989.       end
  1990.       r7_40.armor = math.min(r5_40 + r8_40, 200)
  1991.       qa_HUD(r4_40 .. " 0 0 0 0 0 1")
  1992.       if r7_40.regentime == 0 then
  1993.         freeimage(r7_40.regenimg)
  1994.         qa_HUD(r4_40 .. " 0 0 0 0 0 0 0 1")
  1995.       else
  1996.         parse("hudtxt2 " .. r4_40 .. " 37 " .. qa_copyright .. "255050050" .. r7_40.regentime .. ";40 415")
  1997.       end
  1998.     end
  1999.     if r7_40.invisibility > 0 then
  2000.       parse("sv_sound2 " .. r4_40 .. " \"items/regen.wav\"")
  2001.       r7_40.invisibility = r7_40.invisibility - 1
  2002.       if r7_40.invisibility < 1 then
  2003.         parse("setarmor " .. r4_40 .. " 0")
  2004.         qa_HUD(r4_40 .. " 0 0 0 0 0 0 0 1")
  2005.       else
  2006.         parse("hudtxt2 " .. r4_40 .. " 36 " .. qa_copyright .. "050050255" .. r7_40.invisibility .. ";40 295")
  2007.       end
  2008.     end
  2009.     r7_40.regeneration_dubl = 0
  2010.   end
  2011. end
  2012. addhook("drop", "qa_drops")
  2013. function qa_drops(r0_41, r1_41, r2_41)
  2014.   -- line: [1778, 1782] id: 41
  2015.   if player(r0_41, "health") > 0 then
  2016.     return 1
  2017.   end
  2018. end
  2019. addhook("die", "qa_die")
  2020. function qa_die(r0_42, r1_42, r2_42)
  2021.   -- line: [1786, 1822] id: 42
  2022.   if not tile(player(r0_42, "tilex"), player(r0_42, "tiley"), "deadly") and (deadlyframe[tile(player(r0_42, "tilex"), player(r0_42, "tiley"), "frame")] == nil or 0 < qa_players[r0_42].fly_steps or 0 < qa_players[r0_42].ontrain) then
  2023.     parse("effect \"colorsmoke\" " .. player(r0_42, "x") .. " " .. player(r0_42, "y") .. " 1 1 200 0 0")
  2024.     local r3_42 = player(r0_42, "weapontype")
  2025.     if r3_42 ~= 21 and r3_42 ~= 69 and 0 < r3_42 then
  2026.       if r3_42 == 77 then
  2027.         r3_42 = 48
  2028.       elseif r3_42 == 87 then
  2029.         r3_42 = 45
  2030.       end
  2031.       additem(0, r3_42, player(r0_42, "tilex"), player(r0_42, "tiley"))
  2032.     end
  2033.     if qa_players[r0_42].quadtime > 0 then
  2034.       additem(0, 62, player(r0_42, "tilex"), player(r0_42, "tiley"), 1, qa_players[r0_42].quadtime)
  2035.     end
  2036.     if qa_players[r0_42].speedtime > 0 then
  2037.       additem(0, 61, player(r0_42, "tilex"), player(r0_42, "tiley"), 1, qa_players[r0_42].speedtime)
  2038.     end
  2039.     if qa_players[r0_42].regentime > 0 then
  2040.       additem(0, 60, player(r0_42, "tilex"), player(r0_42, "tiley"), 1, qa_players[r0_42].regentime)
  2041.     end
  2042.     if qa_players[r0_42].invisibility > 0 then
  2043.       additem(0, 51, player(r0_42, "tilex"), player(r0_42, "tiley"), 1, qa_players[r0_42].invisibility)
  2044.     end
  2045.   end
  2046.   if qa_players[r0_42].quadtime > 0 then
  2047.     timer(0, "freeimage", qa_players[r0_42].quadimg)
  2048.   end
  2049.   if qa_players[r0_42].regentime > 0 then
  2050.     timer(0, "freeimage", qa_players[r0_42].regenimg)
  2051.   end
  2052.   qa_players[r0_42].armor = 0
  2053.   qa_players[r0_42].bonus = 0
  2054.   timer(0, "qa_HUD", r0_42 .. " 1 1 0 0 1 1 0 1 1")
  2055.   timer(0, "qa_ScoreTable", r0_42 .. " 1")
  2056.   qa_players[r0_42].weapons = nil
  2057.   qa_players[r0_42].last_shot = 0
  2058.   qa_ScoreTable("0 1")
  2059.   return 1
  2060. end
  2061. addhook("spawn", "qa_starts")
  2062. function qa_starts(r0_43)
  2063.   -- line: [1826, 1879] id: 43
  2064.   qa_ScoreTable(r0_43 .. " 1")
  2065.   parse("setmaxhealth " .. r0_43 .. " 200")
  2066.   parse("sethealth " .. r0_43 .. " 100")
  2067.   parse("strip " .. r0_43 .. " 50")
  2068.   if qa_players[r0_43] == nil then
  2069.     qa_players[r0_43] = {}
  2070.   end
  2071.   if qa_players[r0_43].kills == nil then
  2072.     qa_players[r0_43].kills = 0
  2073.   end
  2074.   qa_players[r0_43].weapons = {}
  2075.   qa_players[r0_43].ammo = {}
  2076.   for r4_43 = 1, 9, 1 do
  2077.     qa_players[r0_43].weapons[r4_43] = 0
  2078.     qa_players[r0_43].ammo[r4_43] = 0
  2079.   end
  2080.   qa_players[r0_43].ontrain = 0
  2081.   qa_players[r0_43].fly_controleble = 1
  2082.   qa_players[r0_43].fly_steps = 0
  2083.   qa_players[r0_43].last_shot = -10
  2084.   qa_players[r0_43].combo_shots = 0
  2085.   qa_players[r0_43].lasercolor = player(r0_43, "spraycolor")
  2086.   qa_players[r0_43].lhit = 0
  2087.   qa_players[r0_43].weapons[2] = 1
  2088.   qa_players[r0_43].weapons[1] = 1
  2089.   qa_players[r0_43].oldWeapon = 69
  2090.   qa_players[r0_43].bonus = 0
  2091.   qa_players[r0_43].quadtime = 0
  2092.   qa_players[r0_43].speedtime = 0
  2093.   qa_players[r0_43].regentime = 0
  2094.   qa_players[r0_43].invisibility = 0
  2095.   qa_players[r0_43].regeneration_dubl = 1
  2096.   qa_players[r0_43].rocketreloaded = 1
  2097.   qa_players[r0_43].laserreloaded = 1
  2098.   qa_players[r0_43].fly_dx = 0
  2099.   qa_players[r0_43].fly_dy = 0
  2100.   timer(0, "qa_HUD", r0_43 .. " 1 1 1 0 1 1")
  2101.   local r1_43 = tonumber(game("sv_gamemode"))
  2102.   if r1_43 == 0 or r1_43 == 4 then
  2103.     qa_players[r0_43].ammo[22] = 200
  2104.     qa_players[r0_43].ammo[21] = 200
  2105.     qa_players[r0_43].ammo[6] = 200
  2106.     qa_players[r0_43].ammo[5] = 200
  2107.     qa_players[r0_43].ammo[4] = 200
  2108.     qa_players[r0_43].ammo[3] = 200
  2109.     qa_players[r0_43].ammo[2] = 200
  2110.     qa_players[r0_43].ammo[1] = 200
  2111.     parse("sethealth " .. r0_43 .. " 200")
  2112.     qa_players[r0_43].armor = 200
  2113.     return "10,11,21,38,49,69,77,87,89"
  2114.   else
  2115.     qa_players[r0_43].armor = 0
  2116.     qa_players[r0_43].ammo[2] = 100
  2117.     qa_players[r0_43].ammo[1] = 1
  2118.     return "21,69"
  2119.   end
  2120. end
  2121. addhook("leave", "qa_leave")
  2122. function qa_leave(r0_44)
  2123.   -- line: [1883, 1893] id: 44
  2124.   qa_players[r0_44].fly_controleble = 1
  2125.   qa_players[r0_44].total_combo = 0
  2126.   qa_players[r0_44].total_impressive = 0
  2127.   qa_players[r0_44].total_humilation = 0
  2128.   qa_players[r0_44].last_shot = 0
  2129.   qa_players[r0_44].combo_shots = 0
  2130.   qa_players[r0_44].fly_steps = 0
  2131.   qa_players[r0_44].lhit = 0
  2132.   timer(0, "qa_ScoreTable", "0 1")
  2133. end
  2134. qa_autoslots = {
  2135.   69,
  2136.   21,
  2137.   10,
  2138.   49,
  2139.   77,
  2140.   85,
  2141.   87,
  2142.   38,
  2143.   11
  2144. }
  2145. addhook("say", "qa_sayslot")
  2146. function qa_sayslot(r0_45, r1_45)
  2147.   -- line: [1898, 1979] id: 45
  2148.   if string.sub(r1_45, 1, 6) == "#@slot" then
  2149.     if 0 < player(r0_45, "health") and 0 < qa_players[r0_45].weapons[tonumber(string.sub(r1_45, 7, 7))] and 0 < qa_players[r0_45].ammo[tonumber(string.sub(r1_45, 7, 7))] then
  2150.       parse("setweapon " .. r0_45 .. " " .. qa_autoslots[tonumber(string.sub(r1_45, 7, 7))])
  2151.       qa_HUD(r0_45 .. " 1 1")
  2152.     end
  2153.     return 1
  2154.   elseif r1_45 == "#@WeaponHUD" then
  2155.     if player(r0_45, "health") > 0 then
  2156.       qa_HUD(r0_45 .. " 1 1")
  2157.     end
  2158.     return 1
  2159.   elseif r1_45 == "#@WeaponNEXT" then
  2160.     if player(r0_45, "health") > 0 then
  2161.       for r5_45 = 1, 9, 1 do
  2162.         if player(r0_45, "weapontype") == qa_autoslots[r5_45] then
  2163.           for r9_45 = r5_45 + 1, 10, 1 do
  2164.             if r9_45 == 10 then
  2165.               parse("setweapon " .. r0_45 .. " " .. qa_autoslots[1])
  2166.             elseif 0 < qa_players[r0_45].weapons[r9_45] and 0 < qa_players[r0_45].ammo[r9_45] then
  2167.               parse("setweapon " .. r0_45 .. " " .. qa_autoslots[r9_45])
  2168.               goto label_141
  2169.             end
  2170.           end
  2171.           break
  2172.         end
  2173.       end
  2174.       ::label_141::
  2175.       qa_HUD(r0_45 .. " 1 1")
  2176.     end
  2177.     return 1
  2178.   elseif r1_45 == "#@WeaponPREV" then
  2179.     if player(r0_45, "health") > 0 then
  2180.       for r5_45 = 1, 9, 1 do
  2181.         if player(r0_45, "weapontype") == qa_autoslots[r5_45] then
  2182.           for r9_45 = -r5_45 + 1, 0, 1 do
  2183.             if r9_45 == 0 then
  2184.               for r13_45 = -9, 1, 1 do
  2185.                 if 0 < qa_players[r0_45].weapons[-r13_45] and 0 < qa_players[r0_45].ammo[-r13_45] then
  2186.                   parse("setweapon " .. r0_45 .. " " .. qa_autoslots[-r13_45])
  2187.                   goto label_227
  2188.                 end
  2189.               end
  2190.               goto label_227
  2191.             elseif qa_players[r0_45].weapons[-r9_45] > 0 then
  2192.               parse("setweapon " .. r0_45 .. " " .. qa_autoslots[-r9_45])
  2193.               goto label_227
  2194.             end
  2195.           end
  2196.           break
  2197.         end
  2198.       end
  2199.       ::label_227::
  2200.       qa_HUD(r0_45 .. " 1 1")
  2201.     end
  2202.     return 1
  2203.   elseif r1_45 == "#@taunt" then
  2204.     if player(r0_45, "health") then
  2205.       parse("sv_sound \"taunt/sarge.wav\"")
  2206.     end
  2207.     return 1
  2208.   elseif r1_45 == "#@scoretable" then
  2209.     if not qa_end then
  2210.       qa_ScoreTable(r0_45)
  2211.     end
  2212.     return 1
  2213.   elseif r1_45 == "#@usebonus" then
  2214.     if 0 < player(r0_45, "health") and 0 < qa_players[r0_45].bonus then
  2215.       if qa_players[r0_45].bonus == 1 then
  2216.         parse("sethealth " .. r0_45 .. " " .. player(r0_45, "health") + 100)
  2217.         parse("sv_sound2 " .. r0_45 .. " \"items/health5.wav\"")
  2218.       elseif qa_players[r0_45].bonus == 2 then
  2219.         local r2_45, r3_45 = randomentity(math.random(0, 1))
  2220.         parse("setpos " .. r0_45 .. " " .. r2_45 * 32 + 16 .. " " .. r3_45 * 32 + 16)
  2221.         parse("sv_sound2 " .. r0_45 .. " \"respawn/respawn.wav\"")
  2222.       end
  2223.       qa_players[r0_45].bonus = 0
  2224.       qa_HUD(r0_45 .. " 0 0 0 0 0 0 0 0 1")
  2225.     end
  2226.     return 1
  2227.   end
  2228. end
  2229. addhook("objectkill", "qa_npcdrop")
  2230. function qa_npcdrop(r0_46, r1_46)
  2231.   -- line: [1982, 1990] id: 46
  2232.   if object(r0_46, "type") == 30 and object(r0_46, "player") == 4 and tile(object(r0_46, "tilex"), object(r0_46, "tiley"), "deadly") ~= true then
  2233.     additem(0, 87, object(r0_46, "tilex"), object(r0_46, "tiley"))
  2234.   end
  2235. end
  2236. addhook("flagcapture", "qa_flagcapture")
  2237. function qa_flagcapture(r0_47, r1_47, r2_47, r3_47)
  2238.   -- line: [1993, 1996] id: 47
  2239.   qa_players[r0_47].kills = qa_players[r0_47].kills + 8
  2240.   return 0
  2241. end
  2242. addhook("always", "qa_train_update")
  2243. function qa_train_update()
  2244.   -- line: [1999, 2011] id: 48
  2245.   for r3_48, r4_48 in pairs(trains) do
  2246.     if r4_48.imgid ~= nil then
  2247.       for r8_48, r9_48 in pairs(player(0, "tableliving")) do
  2248.         if qa_players[r9_48].ontrain == r3_48 then
  2249.           parse("setpos " .. r9_48 .. " " .. math.floor(player(r9_48, "x")) + math.floor(object(r4_48.imgid, "x")) - r4_48.x .. " " .. math.floor(player(r9_48, "y")) + math.floor(object(r4_48.imgid, "y")) - r4_48.y)
  2250.         end
  2251.       end
  2252.       r4_48.x = math.floor(object(r4_48.imgid, "x"))
  2253.       r4_48.y = math.floor(object(r4_48.imgid, "y"))
  2254.     end
  2255.   end
  2256. end
  2257. function qa_train_nextpath(r0_49)
  2258.   -- line: [2013, 2021] id: 49
  2259.   r0_49 = tonumber(r0_49)
  2260.   train = trains[tonumber(r0_49)]
  2261.   train.x = math.floor(object(train.imgid, "x"))
  2262.   train.y = math.floor(object(train.imgid, "y"))
  2263.   tween_move(train.imgid, paths[train.nextpath].time, paths[train.nextpath].x, paths[train.nextpath].y)
  2264.   timer(paths[train.nextpath].time, "qa_train_nextpath", r0_49)
  2265.   train.nextpath = paths[train.nextpath].nextpath
  2266. end
  2267. qa_customkillstrings = {}
  2268. function qa_customkill(r0_50)
  2269.   -- line: [2024, 2031] id: 50
  2270.   qa_customkillstrings[#qa_customkillstrings + 1] = r0_50
  2271.   timer(4000, "qa_customkill_remove")
  2272.   local r1_50 = #qa_customkillstrings
  2273.   for r5_50 = 0, 3, 1 do
  2274.     parse("hudtxt " .. 32 + r5_50 .. " " .. qa_copyright .. "255255255" .. (qa_customkillstrings[math.max(r1_50 + r5_50 - 3, r5_50 + 1)] or "") .. ";10 " .. 10 + r5_50 * 15)
  2275.   end
  2276. end
  2277. function qa_customkill_remove()
  2278.   -- line: [2033, 2039] id: 51
  2279.   table.remove(qa_customkillstrings, 1)
  2280.   local r0_51 = #qa_customkillstrings
  2281.   for r4_51 = 0, 3, 1 do
  2282.     parse("hudtxt " .. 32 + r4_51 .. " " .. qa_copyright .. "255255255" .. (qa_customkillstrings[math.max(r0_51 + r4_51 - 3, r4_51 + 1)] or "") .. ";10 " .. 10 + r4_51 * 15)
  2283.   end
  2284. end
  2285. addhook("minute", "qa_anoncer_time")
  2286. function qa_anoncer_time(r0_52)
  2287.   -- line: [2042, 2057] id: 52
  2288.   local r1_52 = tonumber(game("mp_roundtime"))
  2289.   if r1_52 > 0 then
  2290.     rtime = rtime + 1
  2291.     if r1_52 - rtime == 5 then
  2292.       parse("sv_sound \"fun/5_MIN.wav\"")
  2293.     end
  2294.     if r1_52 - rtime == 1 then
  2295.       parse("sv_sound \"fun/1_MIN.wav\"")
  2296.     end
  2297.     if r1_52 - rtime == 0 then
  2298.       parse("sv_sound \"fun/gameend.wav\"")
  2299.       timer(0, "qa_endround")
  2300.     end
  2301.   end
  2302. end
  2303. addhook("join", "qa_startplay")
  2304. function qa_startplay(r0_53)
  2305.   -- line: [2061, 2067] id: 53
  2306.   if #player(0, "table") == 2 then
  2307.     parse("sv_sound \"fun/prepare.wav\"")
  2308.     timer(1000, "parse", "sv_sound fun/321fight.wav")
  2309.     timer(5000, "parse", "restart")
  2310.   end
  2311. end
  2312. function qa_check_win()
  2313.   -- line: [2070, 2081] id: 54
  2314.   if player(0, "team1") == 0 then
  2315.     msg("\xa9000000255BLUE WIN!@C")
  2316.     parse("sv_sound \"fun/gameend.wav\"")
  2317.     parse("restart")
  2318.   end
  2319.   if player(0, "team2") == 0 then
  2320.     msg("\xa9255000000RED WIN!@C")
  2321.     parse("sv_sound \"fun/gameend.wav\"")
  2322.     parse("restart")
  2323.   end
  2324. end
  2325. addhook("team", "qa_bot_skin_name")
  2326. function qa_bot_skin_name(r0_55)
  2327.   -- line: [2084, 2116] id: 55
  2328.   local r1_55 = player(r0_55, "look")
  2329.   local r2_55 = player(r0_55, "team")
  2330.   if player(r0_55, "bot") then
  2331.     if r2_55 == 1 then
  2332.       if r1_55 == 0 then
  2333.         parse("setname " .. r0_55 .. " Orbb")
  2334.       end
  2335.       if r1_55 == 1 then
  2336.         parse("setname " .. r0_55 .. " Bones")
  2337.       end
  2338.       if r1_55 == 2 then
  2339.         parse("setname " .. r0_55 .. " Doom")
  2340.       end
  2341.       if r1_55 == 3 then
  2342.         parse("setname " .. r0_55 .. " Sarge")
  2343.       end
  2344.     elseif r2_55 == 2 then
  2345.       if r1_55 == 0 then
  2346.         parse("setname " .. r0_55 .. " Sorlag")
  2347.       end
  2348.       if r1_55 == 1 then
  2349.         parse("setname " .. r0_55 .. " Visor")
  2350.       end
  2351.       if r1_55 == 2 then
  2352.         parse("setname " .. r0_55 .. " Gorre")
  2353.       end
  2354.       if r1_55 == 3 then
  2355.         parse("setname " .. r0_55 .. " Phobos")
  2356.       end
  2357.     end
  2358.   end
  2359. end
  2360.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement