Advertisement
Noneatme

Untitled

Jul 4th, 2013
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 41.53 KB | None | 0 0
  1. -- Decompiled using luadec 2.1 UNICODE r69 from http://code.google.com/p/luadec
  2. -- Command line: -l2 LDS2 inventory.luac
  3.  
  4. local l_0_0 = nil
  5. inventoryItems, l_0_0 = l_0_0, {
  6. Weapons = {
  7. ["Primary Weapon"] = {
  8. {"M4", 3},
  9. {"CZ 550", 3},
  10. {"Winchester 1866", 3},
  11. {"SPAZ-12 Combat Shotgun", 3},
  12. {"Sawn-Off Shotgun", 3},
  13. {"AK-47", 3},
  14. {"Lee Enfield", 3}},
  15. ["Secondary Weapon"] = {
  16. {"M1911", 2},
  17. {"M9 SD", 2},
  18. {"PDW", 2},
  19. {"MP5A5", 3},
  20. {"Desert Eagle", 2},
  21. {"Hunting Knife", 1},
  22. {"Hatchet", 2},
  23. {"Baseball Bat", 2},
  24. {"Shovel", 2},
  25. {"Golf Club", 2}},
  26. ["Specially Weapon"] = {
  27. {"Parachute", 1},
  28. {"Tear Gas", 1},
  29. {"Grenade", 1},
  30. {"Binoculars", 1}}},
  31. Ammo = {
  32. {"M1911 Mag", 0.085},
  33. {"M9 SD Mag", 0.085},
  34. {"Desert Eagle Mag", 0.085},
  35. {"PDW Mag", 0.025},
  36. {"MP5A5 Mag", 0.025},
  37. {"AK Mag", 0.035},
  38. {"M4 Mag", 0.035},
  39. {"1866 Slug", 0.067},
  40. {"2Rnd. Slug", 0.067},
  41. {"SPAZ-12 Pellet", 0.067},
  42. {"CZ 550 Mag", 0.1},
  43. {"Lee Enfield Mag", 0.1}},
  44. Food = {
  45. {"Water Bottle", 1},
  46. {"Pasta Can", 1},
  47. {"Beans Can", 1},
  48. {"Burger", 1},
  49. {"Pizza", 1},
  50. {"Soda Bottle", 1},
  51. {"Milk", 1},
  52. {"Cooked Meat", 1}},
  53. Items = {
  54. {"Wood Pile", 2},
  55. {"Bandage", 1, "Bandage yourself"},
  56. {"Roadflare", 1, "Place"},
  57. {"Empty Gas Canister", 2},
  58. {"Full Gas Canister", 2},
  59. {"Medic Kit", 2, "Use"},
  60. {"Heat Pack", 1, "Use"},
  61. {"Painkiller", 1, "Use"},
  62. {"Morphine", 1, "Use"},
  63. {"Blood Bag", 1, "Use"},
  64. {"Wire Fence", 1, "Build a wire fence"},
  65. {"Raw Meat", 1},
  66. {"Tire", 2},
  67. {"Engine", 5},
  68. {"Tank Parts", 3},
  69. {"Tent", 3, "Pitch a tent"},
  70. {"Camouflage Clothing", 1, "Put clothes on"},
  71. {"Civilian Clothing", 1, "Put clothes on"},
  72. {"Survivor Clothing", 1, "Put clothes on"},
  73. {"Ghillie Suit", 1, "Put clothes on"},
  74. {"Empty Water Bottle", 1, "Fill bottle up"},
  75. {"Empty Soda Cans", 1},
  76. {"Scruffy Burgers", 1},
  77. {"Assault Pack (ACU)", 1},
  78. {"Alice Pack", 1},
  79. {"Czech Backpack", 1},
  80. {"Coyote Backpack", 1}},
  81. Toolbelt = {
  82. {"Night Vision Goggles", 1},
  83. {"Infrared Goggles", 1},
  84. {"Map", 1},
  85. {"Box of Matches", 1, "Make a Fire"},
  86. {"Watch", 1},
  87. {"GPS", 1},
  88. {"Toolbox", 1},
  89. {"Radio Device", 1}}}
  90. inventoryWindows = guiCreateWindow(0.15, 0.28, 0.72, 0.63, "", true)
  91. guiLabelSetHorizontalAlign(l_0_0.loot, "center")
  92. l_0_0 = {loot = guiCreateLabel(0.06, 0.05, 0.34, 0.09, "GEAR", true, inventoryWindows)}
  93. guiSetFont(l_0_0.loot, "default-bold-small")
  94. l_0_0.inventory = guiCreateLabel(0.6, 0.05, 0.34, 0.09, "INVENTORY", true, inventoryWindows)
  95. guiLabelSetHorizontalAlign(l_0_0.inventory, "center")
  96. guiSetFont(l_0_0.inventory, "default-bold-small")
  97.  -- DECOMPILER ERROR: Confused about usage of registers, missing locals? Creating them
  98.  
  99. local l_0_1 = {loot = guiCreateGridList(0.03, 0.1, 0.39, 0.83, true, inventoryWindows)}
  100. l_0_1.loot_colum = guiGridListAddColumn(({loot = guiCreateGridList(0.03, 0.1, 0.39, 0.83, true, inventoryWindows)}).loot, "Loot", 0.7)
  101. l_0_1.loot_colum_amount = guiGridListAddColumn(l_0_1.loot, "", 0.2)
  102. l_0_1.inventory = guiCreateGridList(0.57, 0.11, 0.39, 0.83, true, inventoryWindows)
  103. l_0_1.inventory_colum = guiGridListAddColumn(l_0_1.inventory, "Inventory", 0.7)
  104. l_0_1.inventory_colum_amount = guiGridListAddColumn(l_0_1.inventory, "", 0.2)
  105. l_0_0.slots = guiCreateLabel(0.62, 0.94, 0.29, 0.04, "SLOTS:", true, inventoryWindows)
  106. guiLabelSetHorizontalAlign(l_0_0.slots, "center")
  107. guiLabelSetVerticalAlign(l_0_0.slots, "center")
  108. guiSetFont(l_0_0.slots, "default-bold-small")
  109. l_0_0.slots_loot = guiCreateLabel(0.07, 0.94, 0.29, 0.04, "SLOTS:", true, inventoryWindows)
  110. guiLabelSetHorizontalAlign(l_0_0.slots_loot, "center")
  111. guiLabelSetVerticalAlign(l_0_0.slots_loot, "center")
  112. guiSetFont(l_0_0.slots_loot, "default-bold-small")
  113. guiSetVisible(inventoryWindows, false)
  114. showInventory = function(ERROR_nil, ERROR_nil)
  115.   if getElementData(getLocalPlayer(), "logedin") and ERROR_nil == "down" then
  116.     guiSetVisible(inventoryWindows, not guiGetVisible(inventoryWindows))
  117.     showCursor(not isCursorShowing())
  118.     refreshInventory()
  119.     if guiGetVisible(inventoryWindows) == true then
  120.       onClientOpenInventoryStopMenu()
  121.     else
  122.       hideRightClickInventoryMenu()
  123.     end
  124.   end
  125.   if isPlayerInLoot() then
  126.     refreshLoot(getElementData(getLocalPlayer(), "currentCol"), getElementData(getLocalPlayer(), "lootname"))
  127.   end
  128. end
  129.  
  130. bindKey("j", "down", showInventory)
  131. showInventoryManual = function()
  132.   guiSetVisible(inventoryWindows, not guiGetVisible(inventoryWindows))
  133.   showCursor(not isCursorShowing())
  134.   refreshInventory()
  135.   if guiGetVisible(inventoryWindows) == true then
  136.     onClientOpenInventoryStopMenu()
  137.   end
  138. end
  139.  
  140. hideInventoryManual = function()
  141.   guiSetVisible(inventoryWindows, false)
  142.   showCursor(false)
  143.   hideRightClickInventoryMenu()
  144. end
  145.  
  146. addEvent("hideInventoryManual", true)
  147. addEventHandler("hideInventoryManual", getLocalPlayer(), hideInventoryManual)
  148. refreshInventoryManual = function()
  149.   refreshInventory()
  150. end
  151.  
  152. addEvent("refreshInventoryManual", true)
  153. addEventHandler("refreshInventoryManual", getLocalPlayer(), refreshInventoryManual)
  154. refreshLootManual = function(ERROR_nil)
  155.   refreshLoot(ERROR_nil)
  156. end
  157.  
  158. addEvent("refreshLootManual", true)
  159. addEventHandler("refreshLootManual", getLocalPlayer(), refreshLootManual)
  160. refreshInventory = function()
  161.   -- upvalues: l_0_1 , l_0_0
  162.   if l_0_1.inventory_colum then
  163.     row1, column1 = guiGridListGetSelectedItem(l_0_1.inventory), l_0_1.inventory
  164.     guiGridListClear(l_0_1.inventory)
  165.     guiGridListSetItemText(l_0_1.inventory, guiGridListAddRow(l_0_1.inventory), l_0_1.inventory_colum, "PRIMARY WEAPON", true, false)
  166.     -- WARNING: pending registers. Declaring locals.
  167.     local l_6_0 = guiGridListAddRow(l_0_1.inventory)
  168.     for i_1,i_2 in ipairs(inventoryItems.Weapons["Primary Weapon"]) do
  169.       if getElementData(getLocalPlayer(), i_2[1]) and getElementData(getLocalPlayer(), i_2[1]) >= 1 then
  170.         guiGridListSetItemText(l_0_1.inventory, guiGridListAddRow(l_0_1.inventory), l_0_1.inventory_colum, i_2[1], false, false)
  171.         guiGridListSetItemText(l_0_1.inventory, guiGridListAddRow(l_0_1.inventory), l_0_1.inventory_colum_amount, getElementData(getLocalPlayer(), i_2[1]), false, false)
  172.       end
  173.     end
  174.     guiGridListSetItemText(l_0_1.inventory, guiGridListAddRow(l_0_1.inventory), l_0_1.inventory_colum, "SECONDARY WEAPON", true, false)
  175.     for i_1,i_2 in ipairs(inventoryItems.Weapons["Secondary Weapon"]) do
  176.       if getElementData(getLocalPlayer(), i_2[1]) and getElementData(getLocalPlayer(), i_2[1]) >= 1 then
  177.         guiGridListSetItemText(l_0_1.inventory, guiGridListAddRow(l_0_1.inventory), l_0_1.inventory_colum, i_2[1], false, false)
  178.         guiGridListSetItemText(l_0_1.inventory, guiGridListAddRow(l_0_1.inventory), l_0_1.inventory_colum_amount, getElementData(getLocalPlayer(), i_2[1]), false, false)
  179.       end
  180.     end
  181.     guiGridListSetItemText(l_0_1.inventory, guiGridListAddRow(l_0_1.inventory), l_0_1.inventory_colum, "SPECIAL WEAPON", true, false)
  182.     for i_1,i_2 in ipairs(inventoryItems.Weapons["Specially Weapon"]) do
  183.       if getElementData(getLocalPlayer(), i_2[1]) and getElementData(getLocalPlayer(), i_2[1]) >= 1 then
  184.         guiGridListSetItemText(l_0_1.inventory, guiGridListAddRow(l_0_1.inventory), l_0_1.inventory_colum, i_2[1], false, false)
  185.         guiGridListSetItemText(l_0_1.inventory, guiGridListAddRow(l_0_1.inventory), l_0_1.inventory_colum_amount, getElementData(getLocalPlayer(), i_2[1]), false, false)
  186.       end
  187.     end
  188.     guiGridListSetItemText(l_0_1.inventory, guiGridListAddRow(l_0_1.inventory), l_0_1.inventory_colum, "AMMO", true, false)
  189.     for i_1,i_2 in ipairs(inventoryItems.Ammo) do
  190.       if getElementData(getLocalPlayer(), i_2[1]) and getElementData(getLocalPlayer(), i_2[1]) >= 1 then
  191.         guiGridListSetItemText(l_0_1.inventory, guiGridListAddRow(l_0_1.inventory), l_0_1.inventory_colum, i_2[1], false, false)
  192.         guiGridListSetItemText(l_0_1.inventory, guiGridListAddRow(l_0_1.inventory), l_0_1.inventory_colum_amount, getElementData(getLocalPlayer(), i_2[1]), false, false)
  193.       end
  194.     end
  195.     guiGridListSetItemText(l_0_1.inventory, guiGridListAddRow(l_0_1.inventory), l_0_1.inventory_colum, "FOOD & DRINKS", true, false)
  196.     for i_1,i_2 in ipairs(inventoryItems.Food) do
  197.       if getElementData(getLocalPlayer(), i_2[1]) and getElementData(getLocalPlayer(), i_2[1]) >= 1 then
  198.         guiGridListSetItemText(l_0_1.inventory, guiGridListAddRow(l_0_1.inventory), l_0_1.inventory_colum, i_2[1], false, false)
  199.         guiGridListSetItemText(l_0_1.inventory, guiGridListAddRow(l_0_1.inventory), l_0_1.inventory_colum_amount, getElementData(getLocalPlayer(), i_2[1]), false, false)
  200.       end
  201.     end
  202.     guiGridListSetItemText(l_0_1.inventory, guiGridListAddRow(l_0_1.inventory), l_0_1.inventory_colum, "MISC.", true, false)
  203.     for i_1,i_2 in ipairs(inventoryItems.Items) do
  204.       if getElementData(getLocalPlayer(), i_2[1]) and getElementData(getLocalPlayer(), i_2[1]) >= 1 then
  205.         guiGridListSetItemText(l_0_1.inventory, guiGridListAddRow(l_0_1.inventory), l_0_1.inventory_colum, i_2[1], false, false)
  206.         guiGridListSetItemText(l_0_1.inventory, guiGridListAddRow(l_0_1.inventory), l_0_1.inventory_colum_amount, getElementData(getLocalPlayer(), i_2[1]), false, false)
  207.       end
  208.     end
  209.     guiGridListSetItemText(l_0_1.inventory, guiGridListAddRow(l_0_1.inventory), l_0_1.inventory_colum, "TOOLBELT", true, false)
  210.     for i_1,i_2 in ipairs(inventoryItems.Toolbelt) do
  211.       if getElementData(getLocalPlayer(), i_2[1]) and getElementData(getLocalPlayer(), i_2[1]) >= 1 then
  212.         guiGridListSetItemText(l_0_1.inventory, guiGridListAddRow(l_0_1.inventory), l_0_1.inventory_colum, i_2[1], false, false)
  213.         guiGridListSetItemText(l_0_1.inventory, guiGridListAddRow(l_0_1.inventory), l_0_1.inventory_colum_amount, getElementData(getLocalPlayer(), i_2[1]), false, false)
  214.       end
  215.     end
  216.     if row1 and column1 then
  217.       guiGridListSetSelectedItem(l_0_1.inventory, row1, column1)
  218.     end
  219.     guiSetText(l_0_0.slots, "SLOTS: " .. getPlayerCurrentSlots() .. "/" .. getPlayerMaxAviableSlots())
  220.   end
  221. end
  222.  
  223. refreshLoot = function(ERROR_nil, ERROR_nil)
  224.   -- upvalues: l_0_1 , l_0_0
  225.   if ERROR_nil == false then
  226.     guiGridListClear(l_0_1.loot)
  227.     guiSetText(l_0_0.loot, "Empty")
  228.     return
  229.   end
  230.   if l_0_1.loot_colum then
  231.     row2, column2 = guiGridListGetSelectedItem(l_0_1.inventory), l_0_1.inventory
  232.     guiGridListClear(l_0_1.loot)
  233.     if ERROR_nil then
  234.       guiSetText(l_0_0.loot, ERROR_nil)
  235.     end
  236.     guiGridListSetItemText(l_0_1.loot, guiGridListAddRow(l_0_1.loot), l_0_1.loot_colum, "PRIMARY WEAPON", true, false)
  237.     -- WARNING: pending registers. Declaring locals.
  238.     local l_7_2 = guiGridListAddRow(l_0_1.loot)
  239.     for i_1,i_2 in ipairs(inventoryItems.Weapons["Primary Weapon"]) do
  240.       if getElementData(ERROR_nil, i_2[1]) and getElementData(ERROR_nil, i_2[1]) >= 1 then
  241.         guiGridListSetItemText(l_0_1.loot, guiGridListAddRow(l_0_1.loot), l_0_1.loot_colum, i_2[1], false, false)
  242.         guiGridListSetItemText(l_0_1.loot, guiGridListAddRow(l_0_1.loot), l_0_1.loot_colum_amount, getElementData(ERROR_nil, i_2[1]), false, false)
  243.       end
  244.     end
  245.     guiGridListSetItemText(l_0_1.loot, guiGridListAddRow(l_0_1.loot), l_0_1.loot_colum, "SECONDARY WEAPON", true, false)
  246.     for i_1,i_2 in ipairs(inventoryItems.Weapons["Secondary Weapon"]) do
  247.       if getElementData(ERROR_nil, i_2[1]) and getElementData(ERROR_nil, i_2[1]) >= 1 then
  248.         guiGridListSetItemText(l_0_1.loot, guiGridListAddRow(l_0_1.loot), l_0_1.loot_colum, i_2[1], false, false)
  249.         guiGridListSetItemText(l_0_1.loot, guiGridListAddRow(l_0_1.loot), l_0_1.loot_colum_amount, getElementData(ERROR_nil, i_2[1]), false, false)
  250.       end
  251.     end
  252.     guiGridListSetItemText(l_0_1.loot, guiGridListAddRow(l_0_1.loot), l_0_1.loot_colum, "SPECIAL WEAPON", true, false)
  253.     for i_1,i_2 in ipairs(inventoryItems.Weapons["Specially Weapon"]) do
  254.       if getElementData(ERROR_nil, i_2[1]) and getElementData(ERROR_nil, i_2[1]) >= 1 then
  255.         guiGridListSetItemText(l_0_1.loot, guiGridListAddRow(l_0_1.loot), l_0_1.loot_colum, i_2[1], false, false)
  256.         guiGridListSetItemText(l_0_1.loot, guiGridListAddRow(l_0_1.loot), l_0_1.loot_colum_amount, getElementData(ERROR_nil, i_2[1]), false, false)
  257.       end
  258.     end
  259.     guiGridListSetItemText(l_0_1.loot, guiGridListAddRow(l_0_1.loot), l_0_1.loot_colum, "AMMO", true, false)
  260.     for i_1,i_2 in ipairs(inventoryItems.Ammo) do
  261.       if getElementData(ERROR_nil, i_2[1]) and getElementData(ERROR_nil, i_2[1]) >= 1 then
  262.         guiGridListSetItemText(l_0_1.loot, guiGridListAddRow(l_0_1.loot), l_0_1.loot_colum, i_2[1], false, false)
  263.         guiGridListSetItemText(l_0_1.loot, guiGridListAddRow(l_0_1.loot), l_0_1.loot_colum_amount, getElementData(ERROR_nil, i_2[1]), false, false)
  264.       end
  265.     end
  266.     guiGridListSetItemText(l_0_1.loot, guiGridListAddRow(l_0_1.loot), l_0_1.loot_colum, "FOOD & DRINKS", true, false)
  267.     for i_1,i_2 in ipairs(inventoryItems.Food) do
  268.       if getElementData(ERROR_nil, i_2[1]) and getElementData(ERROR_nil, i_2[1]) >= 1 then
  269.         guiGridListSetItemText(l_0_1.loot, guiGridListAddRow(l_0_1.loot), l_0_1.loot_colum, i_2[1], false, false)
  270.         guiGridListSetItemText(l_0_1.loot, guiGridListAddRow(l_0_1.loot), l_0_1.loot_colum_amount, getElementData(ERROR_nil, i_2[1]), false, false)
  271.       end
  272.     end
  273.     guiGridListSetItemText(l_0_1.loot, guiGridListAddRow(l_0_1.loot), l_0_1.loot_colum, "MISC.", true, false)
  274.     for i_1,i_2 in ipairs(inventoryItems.Items) do
  275.       if getElementData(ERROR_nil, i_2[1]) and getElementData(ERROR_nil, i_2[1]) >= 1 then
  276.         guiGridListSetItemText(l_0_1.loot, guiGridListAddRow(l_0_1.loot), l_0_1.loot_colum, i_2[1], false, false)
  277.         guiGridListSetItemText(l_0_1.loot, guiGridListAddRow(l_0_1.loot), l_0_1.loot_colum_amount, getElementData(ERROR_nil, i_2[1]), false, false)
  278.       end
  279.     end
  280.     guiGridListSetItemText(l_0_1.loot, guiGridListAddRow(l_0_1.loot), l_0_1.loot_colum, "TOOLBELT", true, false)
  281.     for i_1,i_2 in ipairs(inventoryItems.Toolbelt) do
  282.       if getElementData(ERROR_nil, i_2[1]) and getElementData(ERROR_nil, i_2[1]) >= 1 then
  283.         guiGridListSetItemText(l_0_1.loot, guiGridListAddRow(l_0_1.loot), l_0_1.loot_colum, i_2[1], false, false)
  284.         guiGridListSetItemText(l_0_1.loot, guiGridListAddRow(l_0_1.loot), l_0_1.loot_colum_amount, getElementData(ERROR_nil, i_2[1]), false, false)
  285.       end
  286.     end
  287.     guiSetText(l_0_0.slots_loot, "SLOTS: " .. getLootCurrentSlots(ERROR_nil) .. "/" .. ((not row2 or column2) and getLootMaxAviableSlots(ERROR_nil) or 0))
  288.   end
  289. end
  290.  
  291. getPlayerMaxAviableSlots = function()
  292.   return getElementData(getLocalPlayer(), "MAX_Slots")
  293. end
  294.  
  295. getLootMaxAviableSlots = function(ERROR_nil)
  296.   return getElementData(ERROR_nil, "MAX_Slots")
  297. end
  298.  
  299. getPlayerCurrentSlots = function()
  300.   -- WARNING: pending registers. Declaring locals.
  301.   local l_10_0 = 0
  302.   for i_1,i_2 in ipairs(inventoryItems.Weapons["Primary Weapon"]) do
  303.     if getElementData(getLocalPlayer(), i_2[1]) and getElementData(getLocalPlayer(), i_2[1]) >= 1 then
  304.       l_10_0 = l_10_0 + i_2[2] * getElementData(getLocalPlayer(), i_2[1])
  305.     end
  306.   end
  307.   for i_1,i_2 in ipairs(inventoryItems.Weapons["Secondary Weapon"]) do
  308.     if getElementData(getLocalPlayer(), i_2[1]) and getElementData(getLocalPlayer(), i_2[1]) >= 1 then
  309.       l_10_0 = l_10_0 + i_2[2] * getElementData(getLocalPlayer(), i_2[1])
  310.     end
  311.   end
  312.   for i_1,i_2 in ipairs(inventoryItems.Weapons["Specially Weapon"]) do
  313.     if getElementData(getLocalPlayer(), i_2[1]) and getElementData(getLocalPlayer(), i_2[1]) >= 1 then
  314.       l_10_0 = l_10_0 + i_2[2] * getElementData(getLocalPlayer(), i_2[1])
  315.     end
  316.   end
  317.   for i_1,i_2 in ipairs(inventoryItems.Ammo) do
  318.     if getElementData(getLocalPlayer(), i_2[1]) and getElementData(getLocalPlayer(), i_2[1]) >= 1 then
  319.       l_10_0 = l_10_0 + i_2[2] * getElementData(getLocalPlayer(), i_2[1])
  320.     end
  321.   end
  322.   for i_1,i_2 in ipairs(inventoryItems.Food) do
  323.     if getElementData(getLocalPlayer(), i_2[1]) and getElementData(getLocalPlayer(), i_2[1]) >= 1 then
  324.       l_10_0 = l_10_0 + i_2[2] * getElementData(getLocalPlayer(), i_2[1])
  325.     end
  326.   end
  327.   for i_1,i_2 in ipairs(inventoryItems.Items) do
  328.     if getElementData(getLocalPlayer(), i_2[1]) and getElementData(getLocalPlayer(), i_2[1]) >= 1 then
  329.       l_10_0 = l_10_0 + i_2[2] * getElementData(getLocalPlayer(), i_2[1])
  330.     end
  331.   end
  332.   return math.floor(l_10_0)
  333. end
  334.  
  335. getLootCurrentSlots = function(ERROR_nil)
  336.   -- WARNING: pending registers. Declaring locals.
  337.   local l_11_1 = 0
  338.   for i_1,i_2 in ipairs(inventoryItems.Weapons["Primary Weapon"]) do
  339.     if getElementData(ERROR_nil, i_2[1]) and getElementData(ERROR_nil, i_2[1]) >= 1 then
  340.       l_11_1 = l_11_1 + i_2[2] * getElementData(ERROR_nil, i_2[1])
  341.     end
  342.   end
  343.   for i_1,i_2 in ipairs(inventoryItems.Weapons["Secondary Weapon"]) do
  344.     if getElementData(ERROR_nil, i_2[1]) and getElementData(ERROR_nil, i_2[1]) >= 1 then
  345.       l_11_1 = l_11_1 + i_2[2] * getElementData(ERROR_nil, i_2[1])
  346.     end
  347.   end
  348.   for i_1,i_2 in ipairs(inventoryItems.Weapons["Specially Weapon"]) do
  349.     if getElementData(ERROR_nil, i_2[1]) and getElementData(ERROR_nil, i_2[1]) >= 1 then
  350.       l_11_1 = l_11_1 + i_2[2] * getElementData(ERROR_nil, i_2[1])
  351.     end
  352.   end
  353.   for i_1,i_2 in ipairs(inventoryItems.Ammo) do
  354.     if getElementData(ERROR_nil, i_2[1]) and getElementData(ERROR_nil, i_2[1]) >= 1 then
  355.       l_11_1 = l_11_1 + i_2[2] * getElementData(ERROR_nil, i_2[1])
  356.     end
  357.   end
  358.   for i_1,i_2 in ipairs(inventoryItems.Food) do
  359.     if getElementData(ERROR_nil, i_2[1]) and getElementData(ERROR_nil, i_2[1]) >= 1 then
  360.       l_11_1 = l_11_1 + i_2[2] * getElementData(ERROR_nil, i_2[1])
  361.     end
  362.   end
  363.   for i_1,i_2 in ipairs(inventoryItems.Items) do
  364.     if getElementData(ERROR_nil, i_2[1]) and getElementData(ERROR_nil, i_2[1]) >= 1 then
  365.       l_11_1 = l_11_1 + i_2[2] * getElementData(ERROR_nil, i_2[1])
  366.     end
  367.   end
  368.   return math.floor(l_11_1)
  369. end
  370.  
  371. getItemSlots = function(ERROR_nil)
  372.   -- WARNING: pending registers. Declaring locals.
  373.   local l_12_1 = 0
  374.   for i_1,i_2 in ipairs(inventoryItems.Weapons["Primary Weapon"]) do
  375.     if ERROR_nil == i_2[1] then
  376.       return i_2[2]
  377.     end
  378.   end
  379.   for i_1,i_2 in ipairs(inventoryItems.Weapons["Secondary Weapon"]) do
  380.     if ERROR_nil == i_2[1] then
  381.       return i_2[2]
  382.     end
  383.   end
  384.   for i_1,i_2 in ipairs(inventoryItems.Weapons["Specially Weapon"]) do
  385.     if ERROR_nil == i_2[1] then
  386.       return i_2[2]
  387.     end
  388.   end
  389.   for i_1,i_2 in ipairs(inventoryItems.Ammo) do
  390.     if ERROR_nil == i_2[1] then
  391.       return i_2[2]
  392.     end
  393.   end
  394.   for i_1,i_2 in ipairs(inventoryItems.Food) do
  395.     if ERROR_nil == i_2[1] then
  396.       return i_2[2]
  397.     end
  398.   end
  399.   for i_1,i_2 in ipairs(inventoryItems.Items) do
  400.     if ERROR_nil == i_2[1] then
  401.       return i_2[2]
  402.     end
  403.   end
  404.   return false
  405. end
  406.  
  407. isToolbeltItem = function(ERROR_nil)
  408.   -- WARNING: pending registers. Declaring locals.
  409.   local l_13_1 = 0
  410.   for i_1,i_2 in ipairs(inventoryItems.Toolbelt) do
  411.     if ERROR_nil == i_2[1] then
  412.       return true
  413.     end
  414.   end
  415.   return false
  416. end
  417.  
  418. vehicleAddonsInfo = {
  419. {422, 4, 1, 1},
  420. {470, 4, 1, 1},
  421. {468, 2, 1, 1},
  422. {433, 6, 1, 1},
  423. {437, 6, 1, 1},
  424. {509, 0, 0, 0},
  425. {487, 0, 1, 1},
  426. {497, 0, 1, 1},
  427. {453, 0, 1, 1}}
  428. getVehicleAddonInfos = function(ERROR_nil)
  429.   for i_1,i_2 in ipairs(vehicleAddonsInfo) do
  430.     if i_2[1] == ERROR_nil then
  431.       return i_2[2], i_2[3], i_2[4]
  432.     end
  433.   end
  434. end
  435.  
  436. vehicleFuelTable = {
  437. {422, 80},
  438. {470, 100},
  439. {468, 30},
  440. {433, 140},
  441. {437, 140},
  442. {509, 0},
  443. {487, 60},
  444. {497, 60},
  445. {453, 60}}
  446. getVehicleMaxFuel = function(ERROR_nil)
  447.   -- WARNING: pending registers. Declaring locals.
  448.   local l_15_1 = getElementModel(getElementData(ERROR_nil, "parent"))
  449.   for i_1,i_2 in ipairs(vehicleFuelTable) do
  450.     if l_15_1 == i_2[1] then
  451.       return i_2[2]
  452.     end
  453.   end
  454.   return false
  455. end
  456.  
  457. onPlayerMoveItemOutOfInventory = function()
  458.   -- upvalues: l_0_1 , l_0_0
  459.   if playerMovedInInventory then
  460.     startRollMessage2("Inventory", "Abusing exploits will result in a ban!", 255, 22, 0)
  461.     return
  462.   end
  463.   if guiGridListGetItemText(l_0_1.inventory, guiGridListGetSelectedItem(l_0_1.inventory), 1) ~= "Tire" or ((not getElementData(isPlayerInLoot(), "Tire_inVehicle") and not getElementData(getLocalPlayer(), guiGridListGetItemText(l_0_1.inventory, guiGridListGetSelectedItem(l_0_1.inventory), 1)) or getElementData(getLocalPlayer(), guiGridListGetItemText(l_0_1.inventory, guiGridListGetSelectedItem(l_0_1.inventory), 1)) < 1 or 0 < getVehicleAddonInfos(getElementModel(getElementData(isPlayerInLoot(), "parent")))) or ((not getElementData(isPlayerInLoot(), "Engine_inVehicle") and not isPlayerInLoot() or 0 < getElementModel(getElementData(isPlayerInLoot(), "parent"))) or guiGridListGetItemText(l_0_1.inventory, guiGridListGetSelectedItem(l_0_1.inventory), 1) == "Tank Parts" and (getElementData(isPlayerInLoot(), "Parts_inVehicle") or not getElementData(isPlayerInLoot(), "vehicle") or getElementData(isPlayerInLoot(), "tent") or 0 < .end))) then
  464.     if guiGridListGetItemText(l_0_1.inventory, guiGridListGetSelectedItem(l_0_1.inventory), 1) == "Tank Parts" then
  465.       triggerEvent("onPlayerMoveItemOutOFInventory", getLocalPlayer(), "Parts" .. "_inVehicle", isPlayerInLoot())
  466.       playerMovedInInventory = true
  467.       setTimer(function()
  468.         playerMovedInInventory = false
  469.       end, 700, 1)
  470.      -- DECOMPILER ERROR: Confused about usage of registers, missing locals? Creating them
  471.  
  472.     local l_16_0 = "Parts"
  473.     else
  474.       if isToolbeltItem(l_16_0) then
  475.         triggerEvent("onPlayerMoveItemOutOFInventory", getLocalPlayer(), l_16_0, isPlayerInLoot())
  476.         playerMovedInInventory = true
  477.         setTimer(function()
  478.           playerMovedInInventory = false
  479.         end, 700, 1)
  480.       end
  481.     else
  482.       if getLootCurrentSlots(getElementData(getLocalPlayer(), "currentCol")) + getItemSlots(l_16_0) <= getLootMaxAviableSlots(isPlayerInLoot()) then
  483.         triggerEvent("onPlayerMoveItemOutOFInventory", getLocalPlayer(), l_16_0, isPlayerInLoot())
  484.         playerMovedInInventory = true
  485.         setTimer(function()
  486.           playerMovedInInventory = false
  487.         end, 700, 1)
  488.       end
  489.     else
  490.       startRollMessage2("Inventory", "Inventory is full!", 255, 22, 0)
  491.       return
  492.     end
  493.     do return end
  494.     if isToolbeltItem(l_16_0) then
  495.       triggerEvent("onPlayerMoveItemOutOFInventory", getLocalPlayer(), l_16_0, isPlayerInLoot())
  496.       playerMovedInInventory = true
  497.       setTimer(function()
  498.         playerMovedInInventory = false
  499.       end, 700, 1)
  500.     else
  501.       if getLootCurrentSlots(getElementData(getLocalPlayer(), "currentCol")) + getItemSlots(l_16_0) <= getLootMaxAviableSlots(isPlayerInLoot()) then
  502.         triggerEvent("onPlayerMoveItemOutOFInventory", getLocalPlayer(), l_16_0, isPlayerInLoot())
  503.         playerMovedInInventory = true
  504.         setTimer(function()
  505.           playerMovedInInventory = false
  506.         end, 700, 1)
  507.       end
  508.     else
  509.       startRollMessage2("Inventory", "Inventory is full!", 255, 22, 0)
  510.       return
  511.     end
  512.     do return end
  513.     triggerEvent("onPlayerMoveItemOutOFInventory", getLocalPlayer(), l_16_0, isPlayerInLoot())
  514.     playerMovedInInventory = true
  515.     setTimer(function()
  516.       playerMovedInInventory = false
  517.     end, 700, 1)
  518.     setTimer(refreshInventory, 200, 2)
  519.     if isPlayerInLoot() then
  520.       setTimer(refreshLoot, 200, 2, getElementData(getLocalPlayer(), "currentCol"), guiGetText(l_0_0.loot))
  521.     end
  522.      -- WARNING: missing end command somewhere! Added here
  523.   end
  524.   -- WARNING: F->nextEndif is not empty. Unhandled nextEndif->addr = 102
  525. end
  526.  
  527. addEventHandler("onClientGUIClick", ({loot = guiCreateButton(0.42, 0.17, 0.04, 0.69, "->", true, inventoryWindows), inventory = guiCreateButton(0.53, 0.17, 0.04, 0.69, "<-", true, inventoryWindows)}).inventory, onPlayerMoveItemOutOfInventory)
  528. onPlayerMoveItemOutOFInventory = function(ERROR_nil, ERROR_nil)
  529.    -- DECOMPILER ERROR: Overwrote pending register. Missing locals? Creating them
  530.  
  531.   local l_17_2 = l_17_2
  532.   if ERROR_nil == "M1911 Mag" then
  533.     do return end
  534.   end
  535.    -- DECOMPILER ERROR: Overwrote pending register. Missing locals? Creating them
  536.  
  537.   if ERROR_nil == "M9 SD Mag" then
  538.     do return end
  539.   end
  540.    -- DECOMPILER ERROR: Overwrote pending register. Missing locals? Creating them
  541.  
  542.   if ERROR_nil == "Desert Eagle Mag" then
  543.     do return end
  544.   end
  545.    -- DECOMPILER ERROR: Overwrote pending register. Missing locals? Creating them
  546.  
  547.   if ERROR_nil == "PDW Mag" then
  548.     do return end
  549.   end
  550.    -- DECOMPILER ERROR: Overwrote pending register. Missing locals? Creating them
  551.  
  552.   if ERROR_nil == "MP5A5 Mag" then
  553.     do return end
  554.   end
  555.    -- DECOMPILER ERROR: Overwrote pending register. Missing locals? Creating them
  556.  
  557.   if ERROR_nil == "AK Mag" then
  558.     do return end
  559.   end
  560.    -- DECOMPILER ERROR: Overwrote pending register. Missing locals? Creating them
  561.  
  562.   if ERROR_nil == "M4 Mag" then
  563.     do return end
  564.   end
  565.    -- DECOMPILER ERROR: Overwrote pending register. Missing locals? Creating them
  566.  
  567.   if ERROR_nil == "1866 Slug" then
  568.     do return end
  569.   end
  570.    -- DECOMPILER ERROR: Overwrote pending register. Missing locals? Creating them
  571.  
  572.   if ERROR_nil == "2Rnd. Slug" then
  573.     do return end
  574.   end
  575.    -- DECOMPILER ERROR: Overwrote pending register. Missing locals? Creating them
  576.  
  577.   if ERROR_nil == "SPAZ-12 Pellet" then
  578.     do return end
  579.   end
  580.    -- DECOMPILER ERROR: Overwrote pending register. Missing locals? Creating them
  581.  
  582.   if ERROR_nil == "CZ 550 Mag" then
  583.     do return end
  584.   end
  585.    -- DECOMPILER ERROR: Overwrote pending register. Missing locals? Creating them
  586.  
  587.   if ERROR_nil == "Lee Enfield Mag" then
  588.     do return end
  589.   end
  590.    -- DECOMPILER ERROR: Overwrote pending register. Missing locals? Creating them
  591.  
  592.   if ERROR_nil == "M136 Rocket" then
  593.     do return end
  594.   end
  595.   if ERROR_nil == "M4" or ERROR_nil == "AK-47" or ERROR_nil == "CZ 550" or ERROR_nil == "Winchester 1866" or ERROR_nil == "SPAZ-12 Combat Shotgun" or ERROR_nil == "Sawn-Off Shotgun" or ERROR_nil == "Heat-Seeking RPG" or ERROR_nil == "M136 Rocket Launcher" or ERROR_nil == "Lee Enfield" then
  596.     triggerServerEvent("removeBackWeaponOnDrop", getLocalPlayer())
  597.   end
  598.   if ERROR_nil and not getElementData(ERROR_nil, "itemloot") and getElementType(getElementData(ERROR_nil, "parent")) == "vehicle" and ERROR_nil == "Full Gas Canister" then
  599.     if getElementData(ERROR_nil, "fuel") + 20 < getVehicleMaxFuel(ERROR_nil) then
  600.       do return end
  601.     end
  602.     if getVehicleMaxFuel(ERROR_nil) + 15 < getElementData(ERROR_nil, "fuel") + 20 then
  603.       triggerEvent("displayClientInfo", getLocalPlayer(), "Vehicle", "The tank is full!", 255, 22, 0)
  604.       return
  605.     else
  606.       setElementData(ERROR_nil, "fuel", getElementData(ERROR_nil, "fuel") + addingfuel)
  607.       setElementData(getLocalPlayer(), ERROR_nil, getElementData(getLocalPlayer(), ERROR_nil) - l_17_2)
  608.       setElementData(getLocalPlayer(), "Empty Gas Canister", (getElementData(getLocalPlayer(), "Empty Gas Canister") or 0) + l_17_2)
  609.       triggerEvent("displayClientInfo", getLocalPlayer(), "Vehicle", "Filled gas into vehicle!", 22, 255, 0)
  610.       return
  611.     end
  612.     if (((ERROR_nil == "Tire_inVehicle" and ERROR_nil ~= "Engine_inVehicle") or ERROR_nil == "Parts_inVehicle") and getElementData(getLocalPlayer(), itemName2) or 0) / l_17_2 < 1 then
  613.       triggerEvent("displayClientInfo", getLocalPlayer(), "Inventory", "Can't drop this!", 255, 22, 0)
  614.       return
  615.     end
  616.     if not getElementData(ERROR_nil, ERROR_nil) then
  617.       setElementData(ERROR_nil, ERROR_nil, (not ERROR_nil or 0) + 1)
  618.     end
  619.     if #getElementsWithinColShape(ERROR_nil, "player") > 1 then
  620.       triggerServerEvent("onPlayerChangeLoot", getRootElement(), ERROR_nil)
  621.     end
  622.     if not getElementData(ERROR_nil, "itemloot") and getElementType(getElementData(ERROR_nil, "parent")) == "vehicle" then
  623.       do return end
  624.     end
  625.     triggerServerEvent("playerDropAItem", getLocalPlayer(), ERROR_nil)
  626.      -- DECOMPILER ERROR: Overwrote pending register. Missing locals? Creating them
  627.  
  628.      -- DECOMPILER ERROR: Overwrote pending register. Missing locals? Creating them
  629.  
  630.     if (ERROR_nil == "Tire_inVehicle" and ERROR_nil ~= "Engine_inVehicle") or ERROR_nil == "Parts_inVehicle" then
  631.       setElementData(getLocalPlayer(), ERROR_nil, getElementData(getLocalPlayer(), ERROR_nil) - l_17_2)
  632.       if ERROR_nil and getElementData(ERROR_nil, "itemloot") then
  633.         triggerServerEvent("refreshItemLoot", getRootElement(), ERROR_nil, getElementData(ERROR_nil, "parent"))
  634.       end
  635.        -- WARNING: undefined locals caused missing assignments!
  636.        -- WARNING: missing end command somewhere! Added here
  637.     end
  638.      -- WARNING: missing end command somewhere! Added here
  639.   end
  640.   -- WARNING: F->nextEndif is not empty. Unhandled nextEndif->addr = 140 278
  641. end
  642.  
  643. addEvent("onPlayerMoveItemOutOFInventory", true)
  644. addEventHandler("onPlayerMoveItemOutOFInventory", getRootElement(), onPlayerMoveItemOutOFInventory)
  645. onPlayerMoveItemInInventory = function()
  646.   -- upvalues: l_0_1 , l_0_0
  647.   if isPlayerInLoot() then
  648.     if getElementData(isPlayerInLoot(), guiGridListGetItemText(l_0_1.loot, guiGridListGetSelectedItem(l_0_1.loot), 1)) and getElementData(isPlayerInLoot(), guiGridListGetItemText(l_0_1.loot, guiGridListGetSelectedItem(l_0_1.loot), 1)) >= 1 then
  649.       if not isToolbeltItem(guiGridListGetItemText(l_0_1.loot, guiGridListGetSelectedItem(l_0_1.loot), 1)) then
  650.         if getPlayerCurrentSlots() + getItemSlots(guiGridListGetItemText(l_0_1.loot, guiGridListGetSelectedItem(l_0_1.loot), 1)) <= getPlayerMaxAviableSlots() then
  651.           if not playerMovedInInventory then
  652.             triggerEvent("onPlayerMoveItemInInventory", getLocalPlayer(), guiGridListGetItemText(l_0_1.loot, guiGridListGetSelectedItem(l_0_1.loot), 1), isPlayerInLoot())
  653.             playerMovedInInventory = true
  654.             setTimer(function()
  655.               playerMovedInInventory = false
  656.             end, 700, 1)
  657.           end
  658.         else
  659.           startRollMessage2("Inventory", "Abusing exploits will result in a ban!", 255, 22, 0)
  660.           return
  661.         end
  662.       else
  663.         startRollMessage2("Inventory", "Inventory is full!", 255, 22, 0)
  664.         return
  665.       end
  666.     else
  667.       playerMovedInInventory = true
  668.       setTimer(function()
  669.         playerMovedInInventory = false
  670.       end, 700, 1)
  671.       triggerEvent("onPlayerMoveItemInInventory", getLocalPlayer(), guiGridListGetItemText(l_0_1.loot, guiGridListGetSelectedItem(l_0_1.loot), 1), isPlayerInLoot())
  672.     end
  673.   end
  674.   if isPlayerInLoot() then
  675.     setTimer(refreshInventory, 200, 2)
  676.     setTimer(refreshLoot, 200, 2, getElementData(getLocalPlayer(), "currentCol"), guiGetText(l_0_0.loot))
  677.   end
  678. end
  679.  
  680.  -- DECOMPILER ERROR: Confused about usage of registers, missing locals? Creating them
  681.  
  682. local l_0_2 = {loot = guiCreateButton(0.42, 0.17, 0.04, 0.69, "->", true, inventoryWindows), inventory = guiCreateButton(0.53, 0.17, 0.04, 0.69, "<-", true, inventoryWindows)}
  683. addEventHandler("onClientGUIClick", l_0_2.loot, onPlayerMoveItemInInventory)
  684. onPlayerMoveItemInInventory = function(ERROR_nil, ERROR_nil)
  685.    -- DECOMPILER ERROR: Overwrote pending register. Missing locals? Creating them
  686.  
  687.   local l_19_2 = l_19_2
  688.   if ERROR_nil == "M1911 Mag" then
  689.     do return end
  690.   end
  691.    -- DECOMPILER ERROR: Overwrote pending register. Missing locals? Creating them
  692.  
  693.   if ERROR_nil == "M9 SD Mag" then
  694.     do return end
  695.   end
  696.    -- DECOMPILER ERROR: Overwrote pending register. Missing locals? Creating them
  697.  
  698.   if ERROR_nil == "Desert Eagle Mag" then
  699.     do return end
  700.   end
  701.    -- DECOMPILER ERROR: Overwrote pending register. Missing locals? Creating them
  702.  
  703.   if ERROR_nil == "PDW Mag" then
  704.     do return end
  705.   end
  706.    -- DECOMPILER ERROR: Overwrote pending register. Missing locals? Creating them
  707.  
  708.   if ERROR_nil == "MP5A5 Mag" then
  709.     do return end
  710.   end
  711.    -- DECOMPILER ERROR: Overwrote pending register. Missing locals? Creating them
  712.  
  713.   if ERROR_nil == "AK Mag" then
  714.     do return end
  715.   end
  716.    -- DECOMPILER ERROR: Overwrote pending register. Missing locals? Creating them
  717.  
  718.   if ERROR_nil == "M4 Mag" then
  719.     do return end
  720.   end
  721.    -- DECOMPILER ERROR: Overwrote pending register. Missing locals? Creating them
  722.  
  723.   if ERROR_nil == "1866 Slug" then
  724.     do return end
  725.   end
  726.    -- DECOMPILER ERROR: Overwrote pending register. Missing locals? Creating them
  727.  
  728.   if ERROR_nil == "2Rnd. Slug" then
  729.     do return end
  730.   end
  731.    -- DECOMPILER ERROR: Overwrote pending register. Missing locals? Creating them
  732.  
  733.   if ERROR_nil == "SPAZ-12 Pellet" then
  734.     do return end
  735.   end
  736.    -- DECOMPILER ERROR: Overwrote pending register. Missing locals? Creating them
  737.  
  738.   if ERROR_nil == "CZ 550 Mag" then
  739.     do return end
  740.   end
  741.    -- DECOMPILER ERROR: Overwrote pending register. Missing locals? Creating them
  742.  
  743.   if ERROR_nil == "Lee Enfield Mag" then
  744.     do return end
  745.   end
  746.    -- DECOMPILER ERROR: Overwrote pending register. Missing locals? Creating them
  747.  
  748.   if ERROR_nil == "M136 Rocket" then
  749.     do return end
  750.   end
  751.   if ERROR_nil == "Assault Pack (ACU)" then
  752.     if getElementData(getLocalPlayer(), "MAX_Slots") == 12 then
  753.       triggerEvent(getLocalPlayer(), "displayClientInfo", getLocalPlayer(), "Inventory", "You are using this backpack already!", 255, 22, 0)
  754.       return
  755.     end
  756.     if getElementData(getLocalPlayer(), "MAX_Slots") > 12 then
  757.       triggerEvent(getLocalPlayer(), "displayClientInfo", getLocalPlayer(), "Inventory", "The currently equipped backpack has more space!", 255, 22, 0)
  758.       return
  759.     end
  760.     setElementData(getLocalPlayer(), "MAX_Slots", 12)
  761.     setElementData(ERROR_nil, ERROR_nil, getElementData(ERROR_nil, ERROR_nil) - 1)
  762.      -- DECOMPILER ERROR: Overwrote pending register. Missing locals? Creating them
  763.  
  764.   elseif ERROR_nil == "Alice Pack" then
  765.     if getElementData(getLocalPlayer(), "MAX_Slots") == 16 then
  766.       triggerEvent(getLocalPlayer(), "displayClientInfo", getLocalPlayer(), "Inventory", "You are using this backpack already!", 255, 22, 0)
  767.       return
  768.     end
  769.     if getElementData(getLocalPlayer(), "MAX_Slots") > 16 then
  770.       triggerEvent(getLocalPlayer(), "displayClientInfo", getLocalPlayer(), "Inventory", "The currently equipped backpack has more space!", 255, 22, 0)
  771.       return
  772.     end
  773.     setElementData(getLocalPlayer(), "MAX_Slots", 16)
  774.     setElementData(ERROR_nil, ERROR_nil, getElementData(ERROR_nil, ERROR_nil) - 1)
  775.      -- DECOMPILER ERROR: Overwrote pending register. Missing locals? Creating them
  776.  
  777.   elseif ERROR_nil == "Czech Backpack" then
  778.     if getElementData(getLocalPlayer(), "MAX_Slots") == 26 then
  779.       triggerEvent(getLocalPlayer(), "displayClientInfo", getLocalPlayer(), "Inventory", "You are using this backpack already!", 255, 22, 0)
  780.       return
  781.     end
  782.     if getElementData(getLocalPlayer(), "MAX_Slots") > 26 then
  783.       triggerEvent(getLocalPlayer(), "displayClientInfo", getLocalPlayer(), "Inventory", "The currently equipped backpack has more space!", 255, 22, 0)
  784.       return
  785.     end
  786.     setElementData(getLocalPlayer(), "MAX_Slots", 26)
  787.     setElementData(ERROR_nil, ERROR_nil, getElementData(ERROR_nil, ERROR_nil) - 1)
  788.      -- DECOMPILER ERROR: Overwrote pending register. Missing locals? Creating them
  789.  
  790.   elseif ERROR_nil == "Coyote Backpack" then
  791.     if getElementData(getLocalPlayer(), "MAX_Slots") == 36 then
  792.       triggerEvent(getLocalPlayer(), "displayClientInfo", getLocalPlayer(), "Inventory", "You already have the best backpack!", 255, 22, 0)
  793.       return
  794.     end
  795.     setElementData(getLocalPlayer(), "MAX_Slots", 36)
  796.     setElementData(ERROR_nil, ERROR_nil, getElementData(ERROR_nil, ERROR_nil) - 1)
  797.      -- DECOMPILER ERROR: Overwrote pending register. Missing locals? Creating them
  798.  
  799.   end
  800.   if not getElementData(getLocalPlayer(), ERROR_nil) then
  801.     setElementData(getLocalPlayer(), ERROR_nil, (not ERROR_nil or 0) + l_19_2)
  802.   end
  803.   if l_19_2 == 0 then
  804.     setElementData(ERROR_nil, ERROR_nil, getElementData(ERROR_nil, ERROR_nil) - 0)
  805.   else
  806.     setElementData(ERROR_nil, ERROR_nil, getElementData(ERROR_nil, ERROR_nil) - 1)
  807.   end
  808.   if #getElementsWithinColShape(ERROR_nil, "player") > 1 then
  809.     triggerServerEvent("onPlayerChangeLoot", getRootElement(), ERROR_nil)
  810.   end
  811.   if getElementData(ERROR_nil, "itemloot") then
  812.     triggerServerEvent("refreshItemLoot", getRootElement(), ERROR_nil, getElementData(ERROR_nil, "parent"))
  813.   end
  814.    -- WARNING: undefined locals caused missing assignments!
  815. end
  816.  
  817. addEvent("onPlayerMoveItemInInventory", true)
  818. addEventHandler("onPlayerMoveItemInInventory", getRootElement(), onPlayerMoveItemInInventory)
  819. onClientOpenInventoryStopMenu = function()
  820.   triggerEvent("disableMenu", getLocalPlayer())
  821. end
  822.  
  823. isPlayerInLoot = function()
  824.   if getElementData(getLocalPlayer(), "loot") then
  825.     return getElementData(getLocalPlayer(), "currentCol")
  826.   end
  827.   return false
  828. end
  829.  
  830. onPlayerPressRightKeyInInventory = function()
  831.   -- upvalues: l_0_1
  832.   if isCursorShowing() and guiGetVisible(inventoryWindows) and guiGridListGetItemText(l_0_1.inventory, guiGridListGetSelectedItem(l_0_1.inventory), 1) then
  833.     if getInventoryInfosForRightClickMenu(guiGridListGetItemText(l_0_1.inventory, guiGridListGetSelectedItem(l_0_1.inventory), 1)) == "Box of Matches" and getElementData(getLocalPlayer(), "Wood Pile") == 0 then
  834.       return
  835.     end
  836.     if getInventoryInfosForRightClickMenu(guiGridListGetItemText(l_0_1.inventory, guiGridListGetSelectedItem(l_0_1.inventory), 1)) == "Bandage" and getElementData(getLocalPlayer(), "bleeding") == 0 then
  837.       return
  838.     end
  839.     if getInventoryInfosForRightClickMenu(guiGridListGetItemText(l_0_1.inventory, guiGridListGetSelectedItem(l_0_1.inventory), 1)) == "Medic Kit" and getElementData(getLocalPlayer(), "blood") > 10500 then
  840.       return
  841.     end
  842.     if getInventoryInfosForRightClickMenu(guiGridListGetItemText(l_0_1.inventory, guiGridListGetSelectedItem(l_0_1.inventory), 1)) == "Heat Pack" and getElementData(getLocalPlayer(), "temperature") > 35 then
  843.       return
  844.     end
  845.     if getInventoryInfosForRightClickMenu(guiGridListGetItemText(l_0_1.inventory, guiGridListGetSelectedItem(l_0_1.inventory), 1)) == "Painkiller" and not getElementData(getLocalPlayer(), "pain") then
  846.       return
  847.     end
  848.     if getInventoryInfosForRightClickMenu(guiGridListGetItemText(l_0_1.inventory, guiGridListGetSelectedItem(l_0_1.inventory), 1)) == "Morphine" and not getElementData(getLocalPlayer(), "brokenbone") then
  849.       return
  850.     end
  851.     if getInventoryInfosForRightClickMenu(guiGridListGetItemText(l_0_1.inventory, guiGridListGetSelectedItem(l_0_1.inventory), 1)) == "Blood Bag" then
  852.       return
  853.     end
  854.     showRightClickInventoryMenu(getInventoryInfosForRightClickMenu(guiGridListGetItemText(l_0_1.inventory, guiGridListGetSelectedItem(l_0_1.inventory), 1)), R5_PC89)
  855.   end
  856. end
  857.  
  858. bindKey("mouse2", "down", onPlayerPressRightKeyInInventory)
  859. getInventoryInfosForRightClickMenu = function(ERROR_nil)
  860.   for i_1,i_2 in ipairs(inventoryItems.Weapons["Primary Weapon"]) do
  861.     if ERROR_nil == i_2[1] then
  862.       return ERROR_nil, "Equip Primary Weapon"
  863.     end
  864.   end
  865.   for i_1,i_2 in ipairs(inventoryItems.Weapons["Secondary Weapon"]) do
  866.     if ERROR_nil == i_2[1] then
  867.       return ERROR_nil, "Equip Secondary Weapon"
  868.     end
  869.   end
  870.   for i_1,i_2 in ipairs(inventoryItems.Weapons["Specially Weapon"]) do
  871.     if ERROR_nil == i_2[1] then
  872.       return ERROR_nil, "Equip Special Weapon"
  873.     end
  874.   end
  875.   for i_1,i_2 in ipairs(inventoryItems.Ammo) do
  876.     if ERROR_nil == i_2[1] then
  877.       return ERROR_nil, false
  878.     end
  879.   end
  880.   for i_1,i_2 in ipairs(inventoryItems.Food) do
  881.     if ERROR_nil == i_2[1] then
  882.       if i_2[1] == "Water Bottle" or i_2[1] == "Milk" or i_2[1] == "Soda Bottle" then
  883.         info = "Drink"
  884.       else
  885.         info = "Eat"
  886.       end
  887.       return ERROR_nil, info
  888.     end
  889.   end
  890.   for i_1,i_2 in ipairs(inventoryItems.Items) do
  891.     if not i_2[3] then
  892.       return ERROR_nil, ERROR_nil ~= i_2[1] or false
  893.     end
  894.   end
  895.   for i_1,i_2 in ipairs(inventoryItems.Toolbelt) do
  896.     if not i_2[3] then
  897.       return ERROR_nil, ERROR_nil ~= i_2[1] or false
  898.     end
  899.   end
  900. end
  901.  
  902. rightclickWindow = guiCreateStaticImage(0, 0, 0.05, 0.0215, "images/scrollmenu_1.png", true)
  903. l_0_0.rightclickmenu = guiCreateLabel(0, 0, 1, 1, "", true, rightclickWindow)
  904. guiLabelSetHorizontalAlign(l_0_0.rightclickmenu, "center")
  905. guiLabelSetVerticalAlign(l_0_0.rightclickmenu, "center")
  906. guiSetFont(l_0_0.rightclickmenu, "default-bold-small")
  907. guiSetVisible(rightclickWindow, false)
  908. showRightClickInventoryMenu = function(ERROR_nil, ERROR_nil)
  909.   -- upvalues: l_0_0
  910.   if ERROR_nil then
  911.     guiSetVisible(rightclickWindow, true)
  912.     guiSetText(l_0_0.rightclickmenu, ERROR_nil)
  913.     guiSetPosition(rightclickWindow, getCursorPosition(), R11_PC22, true)
  914.     guiSetSize(R11_PC22, guiLabelGetTextExtent(l_0_0.rightclickmenu), R13_PC32, false)
  915.      -- DECOMPILER ERROR: Overwrote pending register. Missing locals? Creating them
  916.  
  917.     guiBringToFront(R11_PC22)
  918.      -- DECOMPILER ERROR: Overwrote pending register. Missing locals? Creating them
  919.  
  920.     setElementData(R11_PC22, "iteminfo", R13_PC32)
  921.   end
  922.    -- WARNING: undefined locals caused missing assignments!
  923. end
  924.  
  925. hideRightClickInventoryMenu = function()
  926.   guiSetVisible(rightclickWindow, false)
  927. end
  928.  
  929. onPlayerClickOnRightClickMenu = function(ERROR_nil, ERROR_nil)
  930.   if ERROR_nil == "left" then
  931.     hideRightClickInventoryMenu()
  932.     playerUseItem(getElementData(rightclickWindow, "iteminfo")[1], getElementData(rightclickWindow, "iteminfo")[2])
  933.   end
  934. end
  935.  
  936. addEventHandler("onClientGUIClick", l_0_0.rightclickmenu, onPlayerClickOnRightClickMenu, false)
  937. addEventHandler("onClientPlayerWeaponFire", getLocalPlayer(), weaponSwitch)
  938. addEventHandler("onClientPlayerVehicleEnter", getRootElement(), makeRadioStayOff)
  939. addEventHandler("onClientPlayerRadioSwitch", getRootElement(), makeRadioStayOff)
  940.  -- WARNING: undefined locals caused missing assignments!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement