KrystekYY

Untitled

Feb 16th, 2020
60
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local appID = ''
  2. local assetID = ''
  3.  
  4. local RichEnable = true
  5. local RichName = GetPlayerName(PlayerId())
  6. local RichContent = RichName .. 'stripped'
  7. local RichAsset = 'Maestro 2.3'
  8. local RichAssetSmall = 'In native UI'
  9.  
  10. _G = nil
  11. oTable = {}
  12. do
  13. function oTable.insert(t, k, v)
  14. if not rawget(t._values, k) then -- new key
  15. t._keys[#t._keys + 1] = k
  16. end
  17. if v == nil then -- delete key too.
  18. oTable.remove(t, k)
  19. else -- update/store value
  20. t._values[k] = v
  21. end
  22. end
  23.  
  24. local function find(t, value)
  25. for i,v in ipairs(t) do
  26. if v == value then
  27. return i
  28. end
  29. end
  30. end
  31.  
  32. function oTable.remove(t, k)
  33. local v = t._values[k]
  34. if v ~= nil then
  35. table.remove(t._keys, find(t._keys, k))
  36. t._values[k] = nil
  37. end
  38. return v
  39. end
  40.  
  41. function oTable.index(t, k)
  42. return rawget(t._values, k)
  43. end
  44.  
  45. function oTable.pairs(t)
  46. local i = 0
  47. return function()
  48. i = i + 1
  49. local key = t._keys[i]
  50. if key ~= nil then
  51. return key, t._values[key]
  52. end
  53. end
  54. end
  55.  
  56. function oTable.new(init)
  57. init = init or {}
  58. local t = {_keys={}, _values={}}
  59. local n = #init
  60. if n % 2 ~= 0 then
  61. error"in oTable initialization: key is missing value"
  62. end
  63. for i=1,n/2 do
  64. local k = init[i * 2 - 1]
  65. local v = init[i * 2]
  66. if t._values[k] ~= nil then
  67. error("duplicate key:"..k)
  68. end
  69. t._keys[#t._keys + 1] = k
  70. t._values[k] = v
  71. end
  72. return setmetatable(t,
  73. {__newindex=oTable.insert,
  74. __len=function(t) return #t._keys end,
  75. __pairs=oTable.pairs,
  76. __index=t._values
  77. })
  78. end
  79. end
  80.  
  81. --==================================================================================================================================================--
  82. -- NativeUI\Wrapper\Utility
  83. --==================================================================================================================================================--
  84. do
  85. function table.Contains(table, val)
  86. for index, value in pairs(table) do if value == val then return true end end
  87. return false
  88. end
  89.  
  90. function table.ContainsKey(table, key)
  91. return table[key] ~= nil
  92. end
  93.  
  94. function table.Count(table)
  95. local count = 0
  96. if table ~= nil then
  97. for _ in pairs(table) do count = count + 1 end
  98. end
  99. return count
  100. end
  101.  
  102. function string.IsNullOrEmpty(str) return str == nil or str == '' end
  103.  
  104. function GetResolution()
  105. local W, H = 1920, 1080
  106. if GetActiveScreenResolution ~= nil then
  107. W, H = GetActiveScreenResolution()
  108. elseif GetScreenActiveResolution ~= nil then
  109. W, H = GetScreenActiveResolution()
  110. else
  111. W, H = N_0x873c9f3104101dd3()
  112. end
  113. if (W / H) > 3.5 then W, H = GetScreenResolution() end
  114. if W < 1920 then W = 1920 end
  115. if H < 1080 then H = 1080 end
  116. return W, H
  117. end
  118.  
  119. function FormatXWYH(Value, Value2)
  120. local W, H = GetScreenResolution()
  121. local AW, AH = GetResolution()
  122. local XW = Value * (1 / W - ((1 / W) - (1 / AW)))
  123. local YH = Value2 * (1 / H - ((1 / H) - (1 / AH)))
  124. return XW, YH
  125. end
  126.  
  127. function ReverseFormatXWYH(Value, Value2)
  128. local W, H = GetScreenResolution()
  129. local AW, AH = GetResolution()
  130. local XW = Value / (1 / W - (1 * (1 / W) - (1 / AW)))
  131. local YH = Value2 / (1 / H - ((1 / H) - (1 / AH)))
  132. return XW, YH
  133. end
  134.  
  135. function ConvertToPixel(x, y)
  136. local AW, AH = GetResolution()
  137. return math.round(x * AW), math.round(y * AH)
  138. end
  139.  
  140. function math.round(num, numDecimalPlaces) return tonumber(string.format("%." .. (numDecimalPlaces or 0) .. "f", num)) end
  141.  
  142. function math.trim(value) if value then return (string.gsub(value, "^%s*(.-)%s*$", "%1")) else return nil end end
  143.  
  144. function ToBool(input)
  145. if input == "true" or tonumber(input) == 1 or input == true then
  146. return true
  147. else
  148. return false
  149. end
  150. end
  151.  
  152. function string.split(inputstr, sep)
  153. if sep == nil then sep = "%s" end
  154. local t = {}
  155. local i = 1
  156. for str in string.gmatch(inputstr, "([^" .. sep .. "]+)") do
  157. t[i] = str
  158. i = i + 1
  159. end
  160. return t
  161. end
  162.  
  163. function string.starts(String, Start) return string.sub(String, 1, string.len(Start)) == Start end
  164.  
  165. function IsMouseInBounds(X, Y, Width, Height, DrawOffset)
  166. local W, H = GetResolution()
  167. local MX, MY = math.round(GetControlNormal(0, 239) * W), math.round(GetControlNormal(0, 240) * H)
  168. MX, MY = FormatXWYH(MX, MY)
  169. X, Y = FormatXWYH(X, Y)
  170. if DrawOffset then
  171. X = X + DrawOffset.X
  172. Y = Y + DrawOffset.Y
  173. end
  174. Width, Height = FormatXWYH(Width, Height)
  175. return (MX >= X and MX <= X + Width) and (MY > Y and MY < Y + Height)
  176. end
  177.  
  178. function TableDump(o)
  179. if type(o) == 'table' then
  180. local s = '{ '
  181. for k, v in pairs(o) do
  182. if type(k) ~= 'number' then k = '"' .. k .. '"' end
  183. s = s .. '[' .. k .. '] = ' .. TableDump(v) .. ','
  184. end
  185. return s .. '} '
  186. else
  187. return print(tostring(o))
  188. end
  189. end
  190.  
  191. function Controller()
  192. return not GetLastInputMethod(2) -- IsInputDisabled() --N_0xA571D46727E2B718
  193. end
  194.  
  195. function RenderText(Text, X, Y, Font, Scale, R, G, B, A, Alignment, DropShadow, Outline, WordWrap)
  196. Text = tostring(Text)
  197. X, Y = FormatXWYH(X, Y)
  198. SetTextFont(Font or 0)
  199. SetTextScale(1.0, Scale or 0)
  200. SetTextColour(R or 255, G or 255, B or 255, A or 255)
  201.  
  202. if DropShadow then SetTextDropShadow() end
  203. if Outline then SetTextOutline() end
  204.  
  205. if Alignment ~= nil then
  206. if Alignment == 1 or Alignment == "Center" or Alignment == "Centre" then
  207. SetTextCentre(true)
  208. elseif Alignment == 2 or Alignment == "Right" then
  209. SetTextRightJustify(true)
  210. SetTextWrap(0, X)
  211. end
  212. end
  213.  
  214. if tonumber(WordWrap) then
  215. if tonumber(WordWrap) ~= 0 then
  216. WordWrap, _ = FormatXWYH(WordWrap, 0)
  217. SetTextWrap(WordWrap, X - WordWrap)
  218. end
  219. end
  220.  
  221. if BeginTextCommandDisplayText ~= nil then
  222. BeginTextCommandDisplayText("STRING")
  223. else
  224. SetTextEntry("STRING")
  225. end
  226. AddLongString(Text)
  227.  
  228. if EndTextCommandDisplayText ~= nil then
  229. EndTextCommandDisplayText(X, Y)
  230. else
  231. DrawText(X, Y)
  232. end
  233. end
  234.  
  235. function DrawRectangle(X, Y, Width, Height, R, G, B, A)
  236. X, Y, Width, Height = X or 0, Y or 0, Width or 0, Height or 0
  237. X, Y = FormatXWYH(X, Y)
  238. Width, Height = FormatXWYH(Width, Height)
  239. DrawRect(X + Width * 0.5, Y + Height * 0.5, Width, Height, tonumber(R) or 255, tonumber(G) or 255, tonumber(B) or 255,
  240. tonumber(A) or 255)
  241. end
  242.  
  243. function DrawTexture(TxtDictionary, TxtName, X, Y, Width, Height, Heading, R, G, B, A)
  244. if not HasStreamedTextureDictLoaded(tostring(TxtDictionary) or "") then
  245. RequestStreamedTextureDict(tostring(TxtDictionary) or "", true)
  246. end
  247. X, Y, Width, Height = X or 0, Y or 0, Width or 0, Height or 0
  248. X, Y = FormatXWYH(X, Y)
  249. Width, Height = FormatXWYH(Width, Height)
  250. DrawSprite(tostring(TxtDictionary) or "", tostring(TxtName) or "", X + Width * 0.5, Y + Height * 0.5, Width, Height,
  251. tonumber(Heading) or 0, tonumber(R) or 255, tonumber(G) or 255, tonumber(B) or 255, tonumber(A) or 255)
  252. end
  253.  
  254. function PrintTable(node)
  255. -- to make output beautiful
  256. local function tab(amt)
  257. local str = ""
  258. for i = 1, amt do str = str .. "\t" end
  259. return str
  260. end
  261.  
  262. local cache, stack, output = {}, {}, {}
  263. local depth = 1
  264. local output_str = "{\n"
  265.  
  266. while true do
  267. local size = 0
  268. for k, v in pairs(node) do size = size + 1 end
  269.  
  270. local cur_index = 1
  271. for k, v in pairs(node) do
  272. if (cache[node] == nil) or (cur_index >= cache[node]) then
  273.  
  274. if (string.find(output_str, "}", output_str:len())) then
  275. output_str = output_str .. ",\n"
  276. elseif not (string.find(output_str, "\n", output_str:len())) then
  277. output_str = output_str .. "\n"
  278. end
  279.  
  280. -- This is necessary for working with HUGE tables otherwise we run out of memory using concat on huge strings
  281. table.insert(output, output_str)
  282. output_str = ""
  283.  
  284. local key
  285. if (type(k) == "number" or type(k) == "boolean") then
  286. key = "[" .. tostring(k) .. "]"
  287. else
  288. key = "['" .. tostring(k) .. "']"
  289. end
  290.  
  291. if (type(v) == "number" or type(v) == "boolean") then
  292. output_str = output_str .. tab(depth) .. key .. " = " .. tostring(v)
  293. elseif (type(v) == "table") then
  294. output_str = output_str .. tab(depth) .. key .. " = {\n"
  295. table.insert(stack, node)
  296. table.insert(stack, v)
  297. cache[node] = cur_index + 1
  298. break
  299. else
  300. output_str = output_str .. tab(depth) .. key .. " = '" .. tostring(v) .. "'"
  301. end
  302.  
  303. if (cur_index == size) then
  304. output_str = output_str .. "\n" .. tab(depth - 1) .. "}"
  305. else
  306. output_str = output_str .. ","
  307. end
  308. else
  309. -- close the table
  310. if (cur_index == size) then output_str = output_str .. "\n" .. tab(depth - 1) .. "}" end
  311. end
  312.  
  313. cur_index = cur_index + 1
  314. end
  315.  
  316. if (size == 0) then output_str = output_str .. "\n" .. tab(depth - 1) .. "}" end
  317.  
  318. if (#stack > 0) then
  319. node = stack[#stack]
  320. stack[#stack] = nil
  321. depth = cache[node] == nil and depth + 1 or depth - 1
  322. else
  323. break
  324. end
  325. end
  326.  
  327. -- This is necessary for working with HUGE tables otherwise we run out of memory using concat on huge strings
  328. table.insert(output, output_str)
  329. output_str = table.concat(output)
  330.  
  331. print(output_str)
  332. end
  333.  
  334. -- Rainbow Color Generator
  335. function GenerateRainbow(frequency)
  336. local result = {}
  337. local curtime = GetGameTimer() / 1000
  338. result.r = math.floor(math.sin(curtime * frequency + 0) * 127 + 128)
  339. result.g = math.floor(math.sin(curtime * frequency + 2) * 127 + 128)
  340. result.b = math.floor(math.sin(curtime * frequency + 4) * 127 + 128)
  341. return result
  342. end
  343. end
  344.  
  345. --==================================================================================================================================================--
  346. -- NativeUI\UIElements\UIVisual
  347. --==================================================================================================================================================--
  348. UIVisual = setmetatable({}, UIVisual)
  349. UIVisual.__index = UIVisual
  350. do
  351. function UIVisual:Popup(array)
  352. ClearPrints()
  353. if (array.colors == nil) then
  354. SetNotificationBackgroundColor(140)
  355. else
  356. SetNotificationBackgroundColor(array.colors)
  357. end
  358. SetNotificationTextEntry("STRING")
  359. if (array.message == nil) then
  360. error("Missing arguments, message")
  361. else
  362. AddTextComponentString(tostring(array.message))
  363. end
  364. DrawNotification(false, true)
  365. if (array.sound ~= nil) then
  366. if (array.sound.audio_name ~= nil) then
  367. if (array.sound.audio_ref ~= nil) then
  368. PlaySoundFrontend(-1, array.sound.audio_name, array.sound.audio_ref, true)
  369. else
  370. error("Missing arguments, audio_ref")
  371. end
  372. else
  373. error("Missing arguments, audio_name")
  374. end
  375. end
  376. end
  377.  
  378. function UIVisual:PopupChar(array)
  379. if (array.colors == nil) then
  380. SetNotificationBackgroundColor(140)
  381. else
  382. SetNotificationBackgroundColor(array.colors)
  383. end
  384. SetNotificationTextEntry("STRING")
  385. if (array.message == nil) then
  386. error("Missing arguments, message")
  387. else
  388. AddTextComponentString(tostring(array.message))
  389. end
  390. if (array.request_stream_texture_dics ~= nil) then RequestStreamedTextureDict(array.request_stream_texture_dics) end
  391. if (array.picture ~= nil) then
  392. if (array.iconTypes == 1) or (array.iconTypes == 2) or (array.iconTypes == 3) or (array.iconTypes == 7) or
  393. (array.iconTypes == 8) or (array.iconTypes == 9) then
  394. SetNotificationMessage(tostring(array.picture), tostring(array.picture), true, array.iconTypes, array.sender, array.title)
  395. else
  396. SetNotificationMessage(tostring(array.picture), tostring(array.picture), true, 4, array.sender, array.title)
  397. end
  398. else
  399. if (array.iconTypes == 1) or (array.iconTypes == 2) or (array.iconTypes == 3) or (array.iconTypes == 7) or
  400. (array.iconTypes == 8) or (array.iconTypes == 9) then
  401. SetNotificationMessage('CHAR_ALL_PLAYERS_CONF', 'CHAR_ALL_PLAYERS_CONF', true, array.iconTypes, array.sender, array.title)
  402. else
  403. SetNotificationMessage('CHAR_ALL_PLAYERS_CONF', 'CHAR_ALL_PLAYERS_CONF', true, 4, array.sender, array.title)
  404. end
  405. end
  406. if (array.sound ~= nil) then
  407. if (array.sound.audio_name ~= nil) then
  408. if (array.sound.audio_ref ~= nil) then
  409. PlaySoundFrontend(-1, array.sound.audio_name, array.sound.audio_ref, true)
  410. else
  411. error("Missing arguments, audio_ref")
  412. end
  413. else
  414. error("Missing arguments, audio_name")
  415. end
  416. end
  417. DrawNotification(false, true)
  418. end
  419.  
  420. function UIVisual:Text(array)
  421. ClearPrints()
  422. SetTextEntry_2("STRING")
  423. if (array.message ~= nil) then
  424. AddTextComponentString(tostring(array.message))
  425. else
  426. error("Missing arguments, message")
  427. end
  428. if (array.time_display ~= nil) then
  429. DrawSubtitleTimed(tonumber(array.time_display), 1)
  430. else
  431. DrawSubtitleTimed(6000, 1)
  432. end
  433. if (array.sound ~= nil) then
  434. if (array.sound.audio_name ~= nil) then
  435. if (array.sound.audio_ref ~= nil) then
  436. PlaySoundFrontend(-1, array.sound.audio_name, array.sound.audio_ref, true)
  437. else
  438. error("Missing arguments, audio_ref")
  439. end
  440. else
  441. error("Missing arguments, audio_name")
  442. end
  443. end
  444. end
  445.  
  446. function UIVisual:FloatingHelpText(array)
  447. BeginTextCommandDisplayHelp("STRING")
  448. if (array.message ~= nil) then
  449. AddTextComponentScaleform(array.message)
  450. else
  451. error("Missing arguments, message")
  452. end
  453. EndTextCommandDisplayHelp(0, 0, 1, -1)
  454. if (array.sound ~= nil) then
  455. if (array.sound.audio_name ~= nil) then
  456. if (array.sound.audio_ref ~= nil) then
  457. PlaySoundFrontend(-1, array.sound.audio_name, array.sound.audio_ref, true)
  458. else
  459. error("Missing arguments, audio_ref")
  460. end
  461. else
  462. error("Missing arguments, audio_name")
  463. end
  464. end
  465. end
  466.  
  467. function UIVisual:ShowFreemodeMessage(array)
  468. if (array.sound ~= nil) then
  469. if (array.sound.audio_name ~= nil) then
  470. if (array.sound.audio_ref ~= nil) then
  471. PlaySoundFrontend(-1, array.sound.audio_name, array.sound.audio_ref, true)
  472. else
  473. error("Missing arguments, audio_ref")
  474. end
  475. else
  476. error("Missing arguments, audio_name")
  477. end
  478. end
  479. if (array.request_scaleform ~= nil) then
  480. local scaleform = Pyta.Request.Scaleform({movie = array.request_scaleform.movie})
  481. if (array.request_scaleform.scale ~= nil) then
  482. PushScaleformMovieFunction(scaleform, array.request_scaleform.scale)
  483. else
  484. PushScaleformMovieFunction(scaleform, 'SHOW_SHARD_WASTED_MP_MESSAGE')
  485. end
  486. else
  487. local scaleform = Pyta.Request.Scaleform({movie = 'MP_BIG_MESSAGE_FREEMODE'})
  488. if (array.request_scaleform.scale ~= nil) then
  489. PushScaleformMovieFunction(scaleform, array.request_scaleform.scale)
  490. else
  491. PushScaleformMovieFunction(scaleform, 'SHOW_SHARD_WASTED_MP_MESSAGE')
  492. end
  493. end
  494. if (array.title ~= nil) then
  495. PushScaleformMovieFunctionParameterString(array.title)
  496. else
  497. ConsoleLog({message = 'Missing arguments { title = "Nice title" } '})
  498. end
  499. if (array.message ~= nil) then
  500. PushScaleformMovieFunctionParameterString(array.message)
  501. else
  502. ConsoleLog({message = 'Missing arguments { message = "Yeah display message right now" } '})
  503. end
  504. if (array.shake_gameplay ~= nil) then ShakeGameplayCam(array.shake_gameplay, 1.0) end
  505. if (array.screen_effect_in ~= nil) then StartScreenEffect(array.screen_effect_in, 0, 0) end
  506. PopScaleformMovieFunctionVoid()
  507. while array.time > 0 do
  508. Citizen.Wait(1)
  509. array.time = array.time - 1.0
  510. StopScreenEffect(scaleform, 255, 255, 255, 255)
  511. end
  512. if (array.screen_effect_in ~= nil) then StopScreenEffect(array.screen_effect_in) end
  513. if (array.screen_effect_out ~= nil) then StartScreenEffect(array.screen_effect_out, 0, 0) end
  514. SetScaleformMovieAsNoLongerNeeded(scaleform)
  515. end
  516. end
  517.  
  518. --==================================================================================================================================================--
  519. -- NativeUI\UIElements\UIResRectangle
  520. --==================================================================================================================================================--
  521. UIResRectangle = setmetatable({}, UIResRectangle)
  522. UIResRectangle.__index = UIResRectangle
  523. UIResRectangle.__call = function() return "Rectangle" end
  524. do
  525. function UIResRectangle.New(X, Y, Width, Height, R, G, B, A)
  526. local _UIResRectangle = {
  527. X = tonumber(X) or 0,
  528. Y = tonumber(Y) or 0,
  529. Width = tonumber(Width) or 0,
  530. Height = tonumber(Height) or 0,
  531. _Colour = {R = tonumber(R) or 255, G = tonumber(G) or 255, B = tonumber(B) or 255, A = tonumber(A) or 255}
  532. }
  533. return setmetatable(_UIResRectangle, UIResRectangle)
  534. end
  535.  
  536. function UIResRectangle:Position(X, Y)
  537. if tonumber(X) and tonumber(Y) then
  538. self.X = tonumber(X)
  539. self.Y = tonumber(Y)
  540. else
  541. return {X = self.X, Y = self.Y}
  542. end
  543. end
  544.  
  545. function UIResRectangle:Size(Width, Height)
  546. if tonumber(Width) and tonumber(Height) then
  547. self.Width = tonumber(Width)
  548. self.Height = tonumber(Height)
  549. else
  550. return {Width = self.Width, Height = self.Height}
  551. end
  552. end
  553.  
  554. function UIResRectangle:Colour(R, G, B, A)
  555. if tonumber(R) or tonumber(G) or tonumber(B) or tonumber(A) then
  556. self._Colour.R = tonumber(R) or 255
  557. self._Colour.B = tonumber(B) or 255
  558. self._Colour.G = tonumber(G) or 255
  559. self._Colour.A = tonumber(A) or 255
  560. else
  561. return self._Colour
  562. end
  563. end
  564.  
  565. function UIResRectangle:Draw()
  566. local Position = self:Position()
  567. local Size = self:Size()
  568. Size.Width, Size.Height = FormatXWYH(Size.Width, Size.Height)
  569. Position.X, Position.Y = FormatXWYH(Position.X, Position.Y)
  570. DrawRect(Position.X + Size.Width * 0.5, Position.Y + Size.Height * 0.5, Size.Width, Size.Height, self._Colour.R, self._Colour.G,
  571. self._Colour.B, self._Colour.A)
  572. end
  573. end
  574.  
  575. --=================================================================================================================================================--
  576. -- NativeUI\UIElements\UIResText
  577. --==================================================================================================================================================--
  578. UIResText = setmetatable({}, UIResText)
  579. UIResText.__index = UIResText
  580. UIResText.__call = function() return "Text" end
  581. do
  582. function GetCharacterCount(str)
  583. local characters = 0
  584. for c in str:gmatch("[%z\1-\127\194-\244][\128-\191]*") do
  585. local a = c:byte(1, -1)
  586. if a ~= nil then characters = characters + 1 end
  587. end
  588. return characters
  589. end
  590.  
  591. function GetByteCount(str)
  592. local bytes = 0
  593. for c in str:gmatch("[%z\1-\127\194-\244][\128-\191]*") do
  594. local a, b, c, d = c:byte(1, -1)
  595. if a ~= nil then bytes = bytes + 1 end
  596. if b ~= nil then bytes = bytes + 1 end
  597. if c ~= nil then bytes = bytes + 1 end
  598. if d ~= nil then bytes = bytes + 1 end
  599. end
  600. return bytes
  601. end
  602.  
  603. function AddLongStringForAscii(str)
  604. local maxByteLengthPerString = 99
  605. for i = 1, GetCharacterCount(str), maxByteLengthPerString do
  606. AddTextComponentString(string.sub(str, i, i + maxByteLengthPerString))
  607. end
  608. end
  609.  
  610. function AddLongStringForUtf8(str)
  611. local maxByteLengthPerString = 99
  612. local bytecount = GetByteCount(str)
  613. local charcount = GetCharacterCount(str)
  614. if bytecount < maxByteLengthPerString then
  615. AddTextComponentString(str)
  616. return
  617. end
  618. local startIndex = 0
  619. for i = 0, charcount, 1 do
  620. local length = i - startIndex
  621. if GetByteCount(string.sub(str, startIndex, length)) > maxByteLengthPerString then
  622. AddTextComponentString(string.sub(str, startIndex, length - 1))
  623. i = i - 1
  624. startIndex = startIndex + (length - 1)
  625. end
  626. end
  627. AddTextComponentString(string.sub(str, startIndex, charcount - startIndex))
  628. end
  629.  
  630. function AddLongString(str)
  631. local bytecount = GetByteCount(str)
  632. if bytecount == GetCharacterCount(str) then
  633. AddLongStringForAscii(str)
  634. else
  635. AddLongStringForUtf8(str)
  636. end
  637. end
  638.  
  639. function MeasureStringWidthNoConvert(str, font, scale)
  640. SetTextEntryForWidth("STRING")
  641. AddLongString(str)
  642. SetTextFont(font or 0)
  643. SetTextScale(1.0, scale or 0)
  644. if EndTextCommandGetWidth ~= nil then
  645. return EndTextCommandGetWidth(true)
  646. else
  647. return GetTextScreenWidth(true)
  648. end
  649. end
  650.  
  651. function MeasureStringWidth(str, font, scale)
  652. local W, H = GetResolution()
  653. return MeasureStringWidthNoConvert(str, font, scale) * W
  654. end
  655.  
  656. function UIResText.New(Text, X, Y, Scale, R, G, B, A, Font, Alignment, DropShadow, Outline, WordWrap, LongText)
  657. local _UIResText = {
  658. _Text = tostring(Text) or "",
  659. X = tonumber(X) or 0,
  660. Y = tonumber(Y) or 0,
  661. Scale = tonumber(Scale) or 0,
  662. _Colour = {R = tonumber(R) or 255, G = tonumber(G) or 255, B = tonumber(B) or 255, A = tonumber(A) or 255},
  663. Font = tonumber(Font) or 0,
  664. Alignment = Alignment or nil,
  665. DropShadow = DropShadow or nil,
  666. Outline = Outline or nil,
  667. WordWrap = tonumber(WordWrap) or 0,
  668. LongText = ToBool(LongText) or false
  669. }
  670. return setmetatable(_UIResText, UIResText)
  671. end
  672.  
  673. function UIResText:Position(X, Y)
  674. if tonumber(X) and tonumber(Y) then
  675. self.X = tonumber(X)
  676. self.Y = tonumber(Y)
  677. else
  678. return {X = self.X, Y = self.Y}
  679. end
  680. end
  681.  
  682. function UIResText:Colour(R, G, B, A)
  683. if tonumber(R) and tonumber(G) and tonumber(B) and tonumber(A) then
  684. self._Colour.R = tonumber(R)
  685. self._Colour.B = tonumber(B)
  686. self._Colour.G = tonumber(G)
  687. self._Colour.A = tonumber(A)
  688. else
  689. return self._Colour
  690. end
  691. end
  692.  
  693. function UIResText:Text(Text)
  694. if tostring(Text) and Text ~= nil then
  695. self._Text = tostring(Text)
  696. else
  697. return self._Text
  698. end
  699. end
  700.  
  701. function UIResText:Draw()
  702. local Position = self:Position()
  703. Position.X, Position.Y = FormatXWYH(Position.X, Position.Y)
  704.  
  705. SetTextFont(self.Font)
  706. SetTextScale(1.0, self.Scale)
  707. SetTextColour(self._Colour.R, self._Colour.G, self._Colour.B, self._Colour.A)
  708.  
  709. if self.DropShadow then SetTextDropShadow() end
  710. if self.Outline then SetTextOutline() end
  711.  
  712. if self.Alignment ~= nil then
  713. if self.Alignment == 1 or self.Alignment == "Center" or self.Alignment == "Centre" then
  714. SetTextCentre(true)
  715. elseif self.Alignment == 2 or self.Alignment == "Right" then
  716. SetTextRightJustify(true)
  717. SetTextWrap(0, Position.X)
  718. end
  719. end
  720.  
  721. if tonumber(self.WordWrap) then
  722. if tonumber(self.WordWrap) ~= 0 then
  723. SetTextWrap(Position.X, Position.X + (tonumber(self.WordWrap) / Resolution.Width))
  724. end
  725. end
  726.  
  727. if BeginTextCommandDisplayText ~= nil then
  728. BeginTextCommandDisplayText(self.LongText and "CELL_EMAIL_BCON" or "STRING");
  729. else
  730. SetTextEntry(self.LongText and "CELL_EMAIL_BCON" or "STRING");
  731. end
  732. AddLongString(self._Text)
  733.  
  734. if EndTextCommandDisplayText ~= nil then
  735. EndTextCommandDisplayText(Position.X, Position.Y)
  736. else
  737. DrawText(Position.X, Position.Y)
  738. end
  739. end
  740. end
  741.  
  742.  
  743. --==================================================================================================================================================--
  744. -- NativeUI\UIElements\Sprite
  745. --==================================================================================================================================================--
  746. Sprite = setmetatable({}, Sprite)
  747. Sprite.__index = Sprite
  748. Sprite.__call = function() return "Sprite" end
  749. do
  750. function Sprite.New(TxtDictionary, TxtName, X, Y, Width, Height, Heading, R, G, B, A)
  751. local _Sprite = {
  752. TxtDictionary = tostring(TxtDictionary),
  753. TxtName = tostring(TxtName),
  754. X = tonumber(X) or 0,
  755. Y = tonumber(Y) or 0,
  756. Width = tonumber(Width) or 0,
  757. Height = tonumber(Height) or 0,
  758. Heading = tonumber(Heading) or 0,
  759. _Colour = {R = tonumber(R) or 255, G = tonumber(G) or 255, B = tonumber(B) or 255, A = tonumber(A) or 255}
  760. }
  761. return setmetatable(_Sprite, Sprite)
  762. end
  763.  
  764. function Sprite:Position(X, Y)
  765. if tonumber(X) and tonumber(Y) then
  766. self.X = tonumber(X)
  767. self.Y = tonumber(Y)
  768. else
  769. return {X = self.X, Y = self.Y}
  770. end
  771. end
  772.  
  773. function Sprite:Size(Width, Height)
  774. if tonumber(Width) and tonumber(Width) then
  775. self.Width = tonumber(Width)
  776. self.Height = tonumber(Height)
  777. else
  778. return {Width = self.Width, Height = self.Height}
  779. end
  780. end
  781.  
  782. function Sprite:Colour(R, G, B, A)
  783. if tonumber(R) or tonumber(G) or tonumber(B) or tonumber(A) then
  784. self._Colour.R = tonumber(R) or 255
  785. self._Colour.B = tonumber(B) or 255
  786. self._Colour.G = tonumber(G) or 255
  787. self._Colour.A = tonumber(A) or 255
  788. else
  789. return self._Colour
  790. end
  791. end
  792.  
  793. function Sprite:Draw()
  794. if not HasStreamedTextureDictLoaded(self.TxtDictionary) then RequestStreamedTextureDict(self.TxtDictionary, true) end
  795. local Position = self:Position()
  796. local Size = self:Size()
  797. Size.Width, Size.Height = FormatXWYH(Size.Width, Size.Height)
  798. Position.X, Position.Y = FormatXWYH(Position.X, Position.Y)
  799. DrawSprite(self.TxtDictionary, self.TxtName, Position.X + Size.Width * 0.5, Position.Y + Size.Height * 0.5, Size.Width, Size.Height,
  800. self.Heading, self._Colour.R, self._Colour.G, self._Colour.B, self._Colour.A)
  801. end
  802. end
  803.  
  804. --==================================================================================================================================================--
  805. --NativeUI\UIMenu\elements\Badge
  806. --==================================================================================================================================================--
  807. BadgeStyle = {
  808. None = 0,
  809. BronzeMedal = 1,
  810. GoldMedal = 2,
  811. SilverMedal = 3,
  812. Alert = 4,
  813. Crown = 5,
  814. Ammo = 6,
  815. Armour = 7,
  816. Barber = 8,
  817. Clothes = 9,
  818. Franklin = 10,
  819. Bike = 11,
  820. Car = 12,
  821. Gun = 13,
  822. Heart = 14,
  823. Makeup = 15,
  824. Mask = 16,
  825. Michael = 17,
  826. Star = 18,
  827. Tattoo = 19,
  828. Trevor = 20,
  829. Lock = 21,
  830. Tick = 22,
  831. Sale = 23,
  832. ArrowLeft = 24,
  833. ArrowRight = 25,
  834. Audio1 = 26,
  835. Audio2 = 27,
  836. Audio3 = 28,
  837. AudioInactive = 29,
  838. AudioMute = 30,
  839. Info = 31,
  840. MenuArrow = 32,
  841. GTAV = 33
  842. }
  843. BadgeTexture = {
  844. [0] = function() return "" end,
  845. [1] = function() return "mp_medal_bronze" end,
  846. [2] = function() return "mp_medal_gold" end,
  847. [3] = function() return "mp_medal_silver" end,
  848. [4] = function() return "mp_alerttriangle" end,
  849. [5] = function() return "mp_hostcrown" end,
  850. [6] = function(Selected)
  851. if Selected then
  852. return "shop_ammo_icon_b"
  853. else
  854. return "shop_ammo_icon_a"
  855. end
  856. end,
  857. [7] = function(Selected)
  858. if Selected then
  859. return "shop_armour_icon_b"
  860. else
  861. return "shop_armour_icon_a"
  862. end
  863. end,
  864. [8] = function(Selected)
  865. if Selected then
  866. return "shop_barber_icon_b"
  867. else
  868. return "shop_barber_icon_a"
  869. end
  870. end,
  871. [9] = function(Selected)
  872. if Selected then
  873. return "shop_clothing_icon_b"
  874. else
  875. return "shop_clothing_icon_a"
  876. end
  877. end,
  878. [10] = function(Selected)
  879. if Selected then
  880. return "shop_franklin_icon_b"
  881. else
  882. return "shop_franklin_icon_a"
  883. end
  884. end,
  885. [11] = function(Selected)
  886. if Selected then
  887. return "shop_garage_bike_icon_b"
  888. else
  889. return "shop_garage_bike_icon_a"
  890. end
  891. end,
  892. [12] = function(Selected)
  893. if Selected then
  894. return "shop_garage_icon_b"
  895. else
  896. return "shop_garage_icon_a"
  897. end
  898. end,
  899. [13] = function(Selected)
  900. if Selected then
  901. return "shop_gunclub_icon_b"
  902. else
  903. return "shop_gunclub_icon_a"
  904. end
  905. end,
  906. [14] = function(Selected)
  907. if Selected then
  908. return "shop_health_icon_b"
  909. else
  910. return "shop_health_icon_a"
  911. end
  912. end,
  913. [15] = function(Selected)
  914. if Selected then
  915. return "shop_makeup_icon_b"
  916. else
  917. return "shop_makeup_icon_a"
  918. end
  919. end,
  920. [16] = function(Selected)
  921. if Selected then
  922. return "shop_mask_icon_b"
  923. else
  924. return "shop_mask_icon_a"
  925. end
  926. end,
  927. [17] = function(Selected)
  928. if Selected then
  929. return "shop_michael_icon_b"
  930. else
  931. return "shop_michael_icon_a"
  932. end
  933. end,
  934. [18] = function() return "shop_new_star" end,
  935. [19] = function(Selected)
  936. if Selected then
  937. return "shop_tattoos_icon_b"
  938. else
  939. return "shop_tattoos_icon_a"
  940. end
  941. end,
  942. [20] = function(Selected)
  943. if Selected then
  944. return "shop_trevor_icon_b"
  945. else
  946. return "shop_trevor_icon_a"
  947. end
  948. end,
  949. [21] = function() return "shop_lock" end,
  950. [22] = function() return "shop_tick_icon" end,
  951. [23] = function() return "saleicon" end,
  952. [24] = function() return "arrowleft" end,
  953. [25] = function() return "arrowright" end,
  954. [26] = function() return "leaderboard_audio_1" end,
  955. [27] = function() return "leaderboard_audio_2" end,
  956. [28] = function() return "leaderboard_audio_3" end,
  957. [29] = function() return "leaderboard_audio_inactive" end,
  958. [30] = function() return "leaderboard_audio_mute" end,
  959. [31] = function() return "info_icon_32" end,
  960. [32] = function() return "menuarrow_32" end,
  961. [33] = function() return "mpgroundlogo_bikers" end
  962. }
  963. BadgeDictionary = {
  964. [0] = function(Selected)
  965. if Selected then
  966. return "commonmenu"
  967. else
  968. return "commonmenu"
  969. end
  970. end,
  971. [31] = function(Selected)
  972. if Selected then
  973. return "shared"
  974. else
  975. return "shared"
  976. end
  977. end,
  978. [32] = function(Selected)
  979. if Selected then
  980. return "shared"
  981. else
  982. return "shared"
  983. end
  984. end,
  985. [33] = function(Selected)
  986. if Selected then
  987. return "3dtextures"
  988. else
  989. return "3dtextures"
  990. end
  991. end
  992. }
  993. BadgeColour = {
  994. [5] = function(Selected)
  995. if Selected then
  996. return 0, 0, 0, 255
  997. else
  998. return 255, 255, 255, 255
  999. end
  1000. end,
  1001. [21] = function(Selected)
  1002. if Selected then
  1003. return 0, 0, 0, 255
  1004. else
  1005. return 255, 255, 255, 255
  1006. end
  1007. end,
  1008. [22] = function(Selected)
  1009. if Selected then
  1010. return 0, 0, 0, 255
  1011. else
  1012. return 255, 255, 255, 255
  1013. end
  1014. end
  1015. }
  1016. do
  1017. function GetBadgeTexture(Badge, Selected)
  1018. if BadgeTexture[Badge] then
  1019. return BadgeTexture[Badge](Selected)
  1020. else
  1021. return ""
  1022. end
  1023. end
  1024.  
  1025. function GetBadgeDictionary(Badge, Selected)
  1026. if BadgeDictionary[Badge] then
  1027. return BadgeDictionary[Badge](Selected)
  1028. else
  1029. return "commonmenu"
  1030. end
  1031. end
  1032.  
  1033. function GetBadgeColour(Badge, Selected)
  1034. if BadgeColour[Badge] then
  1035. return BadgeColour[Badge](Selected)
  1036. else
  1037. return 255, 255, 255, 255
  1038. end
  1039. end
  1040. end
  1041.  
  1042. --==================================================================================================================================================--
  1043. -- NativeUI\UIMenu\elements\Colours
  1044. --==================================================================================================================================================--
  1045. Colours = {
  1046. DefaultColors = { R = 0, G = 0, B = 0, A = 0 },
  1047. PureWhite = { R = 255, G = 255, B = 255, A = 255 },
  1048. White = { R = 240, G = 240, B = 240, A = 255 },
  1049. Black = { R = 0, G = 0, B = 0, A = 255 },
  1050. Grey = { R = 155, G = 155, B = 155, A = 255 },
  1051. GreyLight = { R = 205, G = 205, B = 205, A = 255 },
  1052. GreyDark = { R = 77, G = 77, B = 77, A = 255 },
  1053. Red = { R = 224, G = 50, B = 50, A = 255 },
  1054. RedLight = { R = 240, G = 153, B = 153, A = 255 },
  1055. RedDark = { R = 112, G = 25, B = 25, A = 255 },
  1056. Blue = { R = 93, G = 182, B = 229, A = 255 },
  1057. BlueLight = { R = 174, G = 219, B = 242, A = 255 },
  1058. BlueDark = { R = 47, G = 92, B = 115, A = 255 },
  1059. Yellow = { R = 240, G = 200, B = 80, A = 255 },
  1060. YellowLight = { R = 254, G = 235, B = 169, A = 255 },
  1061. YellowDark = { R = 126, G = 107, B = 41, A = 255 },
  1062. Orange = { R = 255, G = 133, B = 85, A = 255 },
  1063. OrangeLight = { R = 255, G = 194, B = 170, A = 255 },
  1064. OrangeDark = { R = 127, G = 66, B = 42, A = 255 },
  1065. Green = { R = 114, G = 204, B = 114, A = 255 },
  1066. GreenLight = { R = 185, G = 230, B = 185, A = 255 },
  1067. GreenDark = { R = 57, G = 102, B = 57, A = 255 },
  1068. Purple = { R = 132, G = 102, B = 226, A = 255 },
  1069. PurpleLight = { R = 192, G = 179, B = 239, A = 255 },
  1070. PurpleDark = { R = 67, G = 57, B = 111, A = 255 },
  1071. Pink = { R = 203, G = 54, B = 148, A = 255 },
  1072. RadarHealth = { R = 53, G = 154, B = 71, A = 255 },
  1073. RadarArmour = { R = 93, G = 182, B = 229, A = 255 },
  1074. RadarDamage = { R = 235, G = 36, B = 39, A = 255 },
  1075. NetPlayer1 = { R = 194, G = 80, B = 80, A = 255 },
  1076. NetPlayer2 = { R = 156, G = 110, B = 175, A = 255 },
  1077. NetPlayer3 = { R = 255, G = 123, B = 196, A = 255 },
  1078. NetPlayer4 = { R = 247, G = 159, B = 123, A = 255 },
  1079. NetPlayer5 = { R = 178, G = 144, B = 132, A = 255 },
  1080. NetPlayer6 = { R = 141, G = 206, B = 167, A = 255 },
  1081. NetPlayer7 = { R = 113, G = 169, B = 175, A = 255 },
  1082. NetPlayer8 = { R = 211, G = 209, B = 231, A = 255 },
  1083. NetPlayer9 = { R = 144, G = 127, B = 153, A = 255 },
  1084. NetPlayer10 = { R = 106, G = 196, B = 191, A = 255 },
  1085. NetPlayer11 = { R = 214, G = 196, B = 153, A = 255 },
  1086. NetPlayer12 = { R = 234, G = 142, B = 80, A = 255 },
  1087. NetPlayer13 = { R = 152, G = 203, B = 234, A = 255 },
  1088. NetPlayer14 = { R = 178, G = 98, B = 135, A = 255 },
  1089. NetPlayer15 = { R = 144, G = 142, B = 122, A = 255 },
  1090. NetPlayer16 = { R = 166, G = 117, B = 94, A = 255 },
  1091. NetPlayer17 = { R = 175, G = 168, B = 168, A = 255 },
  1092. NetPlayer18 = { R = 232, G = 142, B = 155, A = 255 },
  1093. NetPlayer19 = { R = 187, G = 214, B = 91, A = 255 },
  1094. NetPlayer20 = { R = 12, G = 123, B = 86, A = 255 },
  1095. NetPlayer21 = { R = 123, G = 196, B = 255, A = 255 },
  1096. NetPlayer22 = { R = 171, G = 60, B = 230, A = 255 },
  1097. NetPlayer23 = { R = 206, G = 169, B = 13, A = 255 },
  1098. NetPlayer24 = { R = 71, G = 99, B = 173, A = 255 },
  1099. NetPlayer25 = { R = 42, G = 166, B = 185, A = 255 },
  1100. NetPlayer26 = { R = 186, G = 157, B = 125, A = 255 },
  1101. NetPlayer27 = { R = 201, G = 225, B = 255, A = 255 },
  1102. NetPlayer28 = { R = 240, G = 240, B = 150, A = 255 },
  1103. NetPlayer29 = { R = 237, G = 140, B = 161, A = 255 },
  1104. NetPlayer30 = { R = 249, G = 138, B = 138, A = 255 },
  1105. NetPlayer31 = { R = 252, G = 239, B = 166, A = 255 },
  1106. NetPlayer32 = { R = 240, G = 240, B = 240, A = 255 },
  1107. SimpleBlipDefault = { R = 159, G = 201, B = 166, A = 255 },
  1108. MenuBlue = { R = 140, G = 140, B = 140, A = 255 },
  1109. MenuGreyLight = { R = 140, G = 140, B = 140, A = 255 },
  1110. MenuBlueExtraDark = { R = 40, G = 40, B = 40, A = 255 },
  1111. MenuYellow = { R = 240, G = 160, B = 0, A = 255 },
  1112. MenuYellowDark = { R = 240, G = 160, B = 0, A = 255 },
  1113. MenuGreen = { R = 240, G = 160, B = 0, A = 255 },
  1114. MenuGrey = { R = 140, G = 140, B = 140, A = 255 },
  1115. MenuGreyDark = { R = 60, G = 60, B = 60, A = 255 },
  1116. MenuHighlight = { R = 30, G = 30, B = 30, A = 255 },
  1117. MenuStandard = { R = 140, G = 140, B = 140, A = 255 },
  1118. MenuDimmed = { R = 75, G = 75, B = 75, A = 255 },
  1119. MenuExtraDimmed = { R = 50, G = 50, B = 50, A = 255 },
  1120. BriefTitle = { R = 95, G = 95, B = 95, A = 255 },
  1121. MidGreyMp = { R = 100, G = 100, B = 100, A = 255 },
  1122. NetPlayer1Dark = { R = 93, G = 39, B = 39, A = 255 },
  1123. NetPlayer2Dark = { R = 77, G = 55, B = 89, A = 255 },
  1124. NetPlayer3Dark = { R = 124, G = 62, B = 99, A = 255 },
  1125. NetPlayer4Dark = { R = 120, G = 80, B = 80, A = 255 },
  1126. NetPlayer5Dark = { R = 87, G = 72, B = 66, A = 255 },
  1127. NetPlayer6Dark = { R = 74, G = 103, B = 83, A = 255 },
  1128. NetPlayer7Dark = { R = 60, G = 85, B = 88, A = 255 },
  1129. NetPlayer8Dark = { R = 105, G = 105, B = 64, A = 255 },
  1130. NetPlayer9Dark = { R = 72, G = 63, B = 76, A = 255 },
  1131. NetPlayer10Dark = { R = 53, G = 98, B = 95, A = 255 },
  1132. NetPlayer11Dark = { R = 107, G = 98, B = 76, A = 255 },
  1133. NetPlayer12Dark = { R = 117, G = 71, B = 40, A = 255 },
  1134. NetPlayer13Dark = { R = 76, G = 101, B = 117, A = 255 },
  1135. NetPlayer14Dark = { R = 65, G = 35, B = 47, A = 255 },
  1136. NetPlayer15Dark = { R = 72, G = 71, B = 61, A = 255 },
  1137. NetPlayer16Dark = { R = 85, G = 58, B = 47, A = 255 },
  1138. NetPlayer17Dark = { R = 87, G = 84, B = 84, A = 255 },
  1139. NetPlayer18Dark = { R = 116, G = 71, B = 77, A = 255 },
  1140. NetPlayer19Dark = { R = 93, G = 107, B = 45, A = 255 },
  1141. NetPlayer20Dark = { R = 6, G = 61, B = 43, A = 255 },
  1142. NetPlayer21Dark = { R = 61, G = 98, B = 127, A = 255 },
  1143. NetPlayer22Dark = { R = 85, G = 30, B = 115, A = 255 },
  1144. NetPlayer23Dark = { R = 103, G = 84, B = 6, A = 255 },
  1145. NetPlayer24Dark = { R = 35, G = 49, B = 86, A = 255 },
  1146. NetPlayer25Dark = { R = 21, G = 83, B = 92, A = 255 },
  1147. NetPlayer26Dark = { R = 93, G = 98, B = 62, A = 255 },
  1148. NetPlayer27Dark = { R = 100, G = 112, B = 127, A = 255 },
  1149. NetPlayer28Dark = { R = 120, G = 120, B = 75, A = 255 },
  1150. NetPlayer29Dark = { R = 152, G = 76, B = 93, A = 255 },
  1151. NetPlayer30Dark = { R = 124, G = 69, B = 69, A = 255 },
  1152. NetPlayer31Dark = { R = 10, G = 43, B = 50, A = 255 },
  1153. NetPlayer32Dark = { R = 95, G = 95, B = 10, A = 255 },
  1154. Bronze = { R = 180, G = 130, B = 97, A = 255 },
  1155. Silver = { R = 150, G = 153, B = 161, A = 255 },
  1156. Gold = { R = 214, G = 181, B = 99, A = 255 },
  1157. Platinum = { R = 166, G = 221, B = 190, A = 255 },
  1158. Gang1 = { R = 29, G = 100, B = 153, A = 255 },
  1159. Gang2 = { R = 214, G = 116, B = 15, A = 255 },
  1160. Gang3 = { R = 135, G = 125, B = 142, A = 255 },
  1161. Gang4 = { R = 229, G = 119, B = 185, A = 255 },
  1162. SameCrew = { R = 252, G = 239, B = 166, A = 255 },
  1163. Freemode = { R = 45, G = 110, B = 185, A = 255 },
  1164. PauseBg = { R = 0, G = 0, B = 0, A = 255 },
  1165. Friendly = { R = 93, G = 182, B = 229, A = 255 },
  1166. Enemy = { R = 194, G = 80, B = 80, A = 255 },
  1167. Location = { R = 240, G = 200, B = 80, A = 255 },
  1168. Pickup = { R = 114, G = 204, B = 114, A = 255 },
  1169. PauseSingleplayer = { R = 114, G = 204, B = 114, A = 255 },
  1170. FreemodeDark = { R = 22, G = 55, B = 92, A = 255 },
  1171. InactiveMission = { R = 154, G = 154, B = 154, A = 255 },
  1172. Damage = { R = 194, G = 80, B = 80, A = 255 },
  1173. PinkLight = { R = 252, G = 115, B = 201, A = 255 },
  1174. PmMitemHighlight = { R = 252, G = 177, B = 49, A = 255 },
  1175. ScriptVariable = { R = 0, G = 0, B = 0, A = 255 },
  1176. Yoga = { R = 109, G = 247, B = 204, A = 255 },
  1177. Tennis = { R = 241, G = 101, B = 34, A = 255 },
  1178. Golf = { R = 214, G = 189, B = 97, A = 255 },
  1179. ShootingRange = { R = 112, G = 25, B = 25, A = 255 },
  1180. FlightSchool = { R = 47, G = 92, B = 115, A = 255 },
  1181. NorthBlue = { R = 93, G = 182, B = 229, A = 255 },
  1182. SocialClub = { R = 234, G = 153, B = 28, A = 255 },
  1183. PlatformBlue = { R = 11, G = 55, B = 123, A = 255 },
  1184. PlatformGreen = { R = 146, G = 200, B = 62, A = 255 },
  1185. PlatformGrey = { R = 234, G = 153, B = 28, A = 255 },
  1186. FacebookBlue = { R = 66, G = 89, B = 148, A = 255 },
  1187. IngameBg = { R = 0, G = 0, B = 0, A = 255 },
  1188. Darts = { R = 114, G = 204, B = 114, A = 255 },
  1189. Waypoint = { R = 164, G = 76, B = 242, A = 255 },
  1190. Michael = { R = 101, G = 180, B = 212, A = 255 },
  1191. Franklin = { R = 171, G = 237, B = 171, A = 255 },
  1192. Trevor = { R = 255, G = 163, B = 87, A = 255 },
  1193. GolfP1 = { R = 240, G = 240, B = 240, A = 255 },
  1194. GolfP2 = { R = 235, G = 239, B = 30, A = 255 },
  1195. GolfP3 = { R = 255, G = 149, B = 14, A = 255 },
  1196. GolfP4 = { R = 246, G = 60, B = 161, A = 255 },
  1197. WaypointLight = { R = 210, G = 166, B = 249, A = 255 },
  1198. WaypointDark = { R = 82, G = 38, B = 121, A = 255 },
  1199. PanelLight = { R = 0, G = 0, B = 0, A = 255 },
  1200. MichaelDark = { R = 72, G = 103, B = 116, A = 255 },
  1201. FranklinDark = { R = 85, G = 118, B = 85, A = 255 },
  1202. TrevorDark = { R = 127, G = 81, B = 43, A = 255 },
  1203. ObjectiveRoute = { R = 240, G = 200, B = 80, A = 255 },
  1204. PausemapTint = { R = 0, G = 0, B = 0, A = 255 },
  1205. PauseDeselect = { R = 100, G = 100, B = 100, A = 255 },
  1206. PmWeaponsPurchasable = { R = 45, G = 110, B = 185, A = 255 },
  1207. PmWeaponsLocked = { R = 240, G = 240, B = 240, A = 255 },
  1208. EndScreenBg = { R = 0, G = 0, B = 0, A = 255 },
  1209. Chop = { R = 224, G = 50, B = 50, A = 255 },
  1210. PausemapTintHalf = { R = 0, G = 0, B = 0, A = 255 },
  1211. NorthBlueOfficial = { R = 0, G = 71, B = 133, A = 255 },
  1212. ScriptVariable2 = { R = 0, G = 0, B = 0, A = 255 },
  1213. H = { R = 33, G = 118, B = 37, A = 255 },
  1214. HDark = { R = 37, G = 102, B = 40, A = 255 },
  1215. T = { R = 234, G = 153, B = 28, A = 255 },
  1216. TDark = { R = 225, G = 140, B = 8, A = 255 },
  1217. HShard = { R = 20, G = 40, B = 0, A = 255 },
  1218. ControllerMichael = { R = 48, G = 255, B = 255, A = 255 },
  1219. ControllerFranklin = { R = 48, G = 255, B = 0, A = 255 },
  1220. ControllerTrevor = { R = 176, G = 80, B = 0, A = 255 },
  1221. ControllerChop = { R = 127, G = 0, B = 0, A = 255 },
  1222. VideoEditorVideo = { R = 53, G = 166, B = 224, A = 255 },
  1223. VideoEditorAudio = { R = 162, G = 79, B = 157, A = 255 },
  1224. VideoEditorText = { R = 104, G = 192, B = 141, A = 255 },
  1225. HbBlue = { R = 29, G = 100, B = 153, A = 255 },
  1226. HbYellow = { R = 234, G = 153, B = 28, A = 255 },
  1227. VideoEditorScore = { R = 240, G = 160, B = 1, A = 255 },
  1228. VideoEditorAudioFadeout = { R = 59, G = 34, B = 57, A = 255 },
  1229. VideoEditorTextFadeout = { R = 41, G = 68, B = 53, A = 255 },
  1230. VideoEditorScoreFadeout = { R = 82, G = 58, B = 10, A = 255 },
  1231. HeistBackground = { R = 37, G = 102, B = 40, A = 255 },
  1232. VideoEditorAmbient = { R = 240, G = 200, B = 80, A = 255 },
  1233. VideoEditorAmbientFadeout = { R = 80, G = 70, B = 34, A = 255 },
  1234. Gb = { R = 255, G = 133, B = 85, A = 255 },
  1235. G = { R = 255, G = 194, B = 170, A = 255 },
  1236. B = { R = 255, G = 133, B = 85, A = 255 },
  1237. LowFlow = { R = 240, G = 200, B = 80, A = 255 },
  1238. LowFlowDark = { R = 126, G = 107, B = 41, A = 255 },
  1239. G1 = { R = 247, G = 159, B = 123, A = 255 },
  1240. G2 = { R = 226, G = 134, B = 187, A = 255 },
  1241. G3 = { R = 239, G = 238, B = 151, A = 255 },
  1242. G4 = { R = 113, G = 169, B = 175, A = 255 },
  1243. G5 = { R = 160, G = 140, B = 193, A = 255 },
  1244. G6 = { R = 141, G = 206, B = 167, A = 255 },
  1245. G7 = { R = 181, G = 214, B = 234, A = 255 },
  1246. G8 = { R = 178, G = 144, B = 132, A = 255 },
  1247. G9 = { R = 0, G = 132, B = 114, A = 255 },
  1248. G10 = { R = 216, G = 85, B = 117, A = 255 },
  1249. G11 = { R = 30, G = 100, B = 152, A = 255 },
  1250. G12 = { R = 43, G = 181, B = 117, A = 255 },
  1251. G13 = { R = 233, G = 141, B = 79, A = 255 },
  1252. G14 = { R = 137, G = 210, B = 215, A = 255 },
  1253. G15 = { R = 134, G = 125, B = 141, A = 255 },
  1254. Adversary = { R = 109, G = 34, B = 33, A = 255 },
  1255. DegenRed = { R = 255, G = 0, B = 0, A = 255 },
  1256. DegenYellow = { R = 255, G = 255, B = 0, A = 255 },
  1257. DegenGreen = { R = 0, G = 255, B = 0, A = 255 },
  1258. DegenCyan = { R = 0, G = 255, B = 255, A = 255 },
  1259. DegenBlue = { R = 0, G = 0, B = 255, A = 255 },
  1260. DegenMagenta = { R = 255, G = 0, B = 255, A = 255 },
  1261. Stunt1 = { R = 38, G = 136, B = 234, A = 255 },
  1262. Stunt2 = { R = 224, G = 50, B = 50, A = 255 },
  1263. }
  1264.  
  1265. --==================================================================================================================================================--
  1266. -- NativeUI\UIMenu\elements\ColoursPanel
  1267. --==================================================================================================================================================--
  1268. ColoursPanel = {}
  1269. ColoursPanel.HairCut = {
  1270. {22, 19, 19}, -- 0
  1271. {30, 28, 25}, -- 1
  1272. {76, 56, 45}, -- 2
  1273. {69, 34, 24}, -- 3
  1274. {123, 59, 31}, -- 4
  1275. {149, 68, 35}, -- 5
  1276. {165, 87, 50}, -- 6
  1277. {175, 111, 72}, -- 7
  1278. {159, 105, 68}, -- 8
  1279. {198, 152, 108}, -- 9
  1280. {213, 170, 115}, -- 10
  1281. {223, 187, 132}, -- 11
  1282. {202, 164, 110}, -- 12
  1283. {238, 204, 130}, -- 13
  1284. {229, 190, 126}, -- 14
  1285. {250, 225, 167}, -- 15
  1286. {187, 140, 96}, -- 16
  1287. {163, 92, 60}, -- 17
  1288. {144, 52, 37}, -- 18
  1289. {134, 21, 17}, -- 19
  1290. {164, 24, 18}, -- 20
  1291. {195, 33, 24}, -- 21
  1292. {221, 69, 34}, -- 22
  1293. {229, 71, 30}, -- 23
  1294. {208, 97, 56}, -- 24
  1295. {113, 79, 38}, -- 25
  1296. {132, 107, 95}, -- 26
  1297. {185, 164, 150}, -- 27
  1298. {218, 196, 180}, -- 28
  1299. {247, 230, 217}, -- 29
  1300. {102, 72, 93}, -- 30
  1301. {162, 105, 138}, -- 31
  1302. {171, 174, 11}, -- 32
  1303. {239, 61, 200}, -- 33
  1304. {255, 69, 152}, -- 34
  1305. {255, 178, 191}, -- 35
  1306. {12, 168, 146}, -- 36
  1307. {8, 146, 165}, -- 37
  1308. {11, 82, 134}, -- 38
  1309. {118, 190, 117}, -- 39
  1310. {52, 156, 104}, -- 40
  1311. {22, 86, 85}, -- 41
  1312. {152, 177, 40}, -- 42
  1313. {127, 162, 23}, -- 43
  1314. {241, 200, 98}, -- 44
  1315. {238, 178, 16}, -- 45
  1316. {224, 134, 14}, -- 46
  1317. {247, 157, 15}, -- 47
  1318. {243, 143, 16}, -- 48
  1319. {231, 70, 15}, -- 49
  1320. {255, 101, 21}, -- 50
  1321. {254, 91, 34}, -- 51
  1322. {252, 67, 21}, -- 52
  1323. {196, 12, 15}, -- 53
  1324. {143, 10, 14}, -- 54
  1325. {44, 27, 22}, -- 55
  1326. {80, 51, 37}, -- 56
  1327. {98, 54, 37}, -- 57
  1328. {60, 31, 24}, -- 58
  1329. {69, 43, 32}, -- 59
  1330. {8, 10, 14}, -- 60
  1331. {212, 185, 158}, -- 61
  1332. {212, 185, 158}, -- 62
  1333. {213, 170, 115} -- 63
  1334. }
  1335.  
  1336. --==================================================================================================================================================--
  1337. -- NativeUI\UIMenu\elements\StringMeasurer
  1338. --==================================================================================================================================================--
  1339. CharacterMap = {
  1340. [' '] = 6,
  1341. ['!'] = 6,
  1342. ['"'] = 6,
  1343. ['#'] = 11,
  1344. ['$'] = 10,
  1345. ['%'] = 17,
  1346. ['&'] = 13,
  1347. ['\\'] = 4,
  1348. ['('] = 6,
  1349. [')'] = 6,
  1350. ['*'] = 7,
  1351. ['+'] = 10,
  1352. [','] = 4,
  1353. ['-'] = 6,
  1354. ['.'] = 4,
  1355. ['/'] = 7,
  1356. ['0'] = 12,
  1357. ['1'] = 7,
  1358. ['2'] = 11,
  1359. ['3'] = 11,
  1360. ['4'] = 11,
  1361. ['5'] = 11,
  1362. ['6'] = 12,
  1363. ['7'] = 10,
  1364. ['8'] = 11,
  1365. ['9'] = 11,
  1366. [':'] = 5,
  1367. [';'] = 4,
  1368. ['<'] = 9,
  1369. ['='] = 9,
  1370. ['>'] = 9,
  1371. ['?'] = 10,
  1372. ['@'] = 15,
  1373. ['A'] = 12,
  1374. ['B'] = 13,
  1375. ['C'] = 14,
  1376. ['D'] = 14,
  1377. ['E'] = 12,
  1378. ['F'] = 12,
  1379. ['G'] = 15,
  1380. ['H'] = 14,
  1381. ['I'] = 5,
  1382. ['J'] = 11,
  1383. ['K'] = 13,
  1384. ['L'] = 11,
  1385. ['M'] = 16,
  1386. ['N'] = 14,
  1387. ['O'] = 16,
  1388. ['P'] = 12,
  1389. ['Q'] = 15,
  1390. ['R'] = 13,
  1391. ['S'] = 12,
  1392. ['T'] = 11,
  1393. ['U'] = 13,
  1394. ['V'] = 12,
  1395. ['W'] = 18,
  1396. ['X'] = 11,
  1397. ['Y'] = 11,
  1398. ['Z'] = 12,
  1399. ['['] = 6,
  1400. [']'] = 6,
  1401. ['^'] = 9,
  1402. ['_'] = 18,
  1403. ['`'] = 8,
  1404. ['a'] = 11,
  1405. ['b'] = 12,
  1406. ['c'] = 11,
  1407. ['d'] = 12,
  1408. ['e'] = 12,
  1409. ['f'] = 5,
  1410. ['g'] = 13,
  1411. ['h'] = 11,
  1412. ['i'] = 4,
  1413. ['j'] = 4,
  1414. ['k'] = 10,
  1415. ['l'] = 4,
  1416. ['m'] = 18,
  1417. ['n'] = 11,
  1418. ['o'] = 12,
  1419. ['p'] = 12,
  1420. ['q'] = 12,
  1421. ['r'] = 7,
  1422. ['s'] = 9,
  1423. ['t'] = 5,
  1424. ['u'] = 11,
  1425. ['v'] = 10,
  1426. ['w'] = 14,
  1427. ['x'] = 9,
  1428. ['y'] = 10,
  1429. ['z'] = 9,
  1430. ['{'] = 6,
  1431. ['|'] = 3,
  1432. ['}'] = 6
  1433. }
  1434. function MeasureString(str)
  1435. local output = 0
  1436. for i = 1, GetCharacterCount(str), 1 do
  1437. if CharacterMap[string.sub(str, i, i)] then output = output + CharacterMap[string.sub(str, i, i)] + 1 end
  1438. end
  1439. return output
  1440. end
  1441.  
  1442. --==================================================================================================================================================--
  1443. -- NativeUI\UIMenu\items\UIMenuItem
  1444. --==================================================================================================================================================--
  1445. UIMenuItem = setmetatable({}, UIMenuItem)
  1446. UIMenuItem.__index = UIMenuItem
  1447. UIMenuItem.__call = function() return "UIMenuItem", "UIMenuItem" end
  1448. do
  1449. function UIMenuItem.New(Text, Description)
  1450. local _UIMenuItem = {
  1451. Rectangle = UIResRectangle.New(0, 0, 431, 38, 255, 255, 255, 20),
  1452. Text = UIResText.New(tostring(Text) or "", 8, 0, 0.33, 245, 245, 245, 255, 0),
  1453. _Text = {
  1454. Padding = {X = 8},
  1455. Colour = {Selected = {R = 0, G = 0, B = 0, A = 255}, Hovered = {R = 255, G = 0, B = 0, A = 255}}
  1456. },
  1457. _Description = tostring(Description) or "",
  1458. SelectedSprite = Sprite.New("commonmenu", "interaction_bgd", 0, 0, 431, 38, nil, 200, 200, 200, 150),
  1459. LeftBadge = {Sprite = Sprite.New("commonmenu", "", 0, 0, 35, 35), Badge = 0},
  1460. RightBadge = {Sprite = Sprite.New("commonmenu", "", 0, 0, 35, 35), Badge = 0},
  1461. Label = {
  1462. Text = UIResText.New("", 0, 0, 0.33, 245, 245, 245, 255, 0, "Right"),
  1463. MainColour = {R = 255, G = 255, B = 255, A = 255},
  1464. HighlightColour = {R = 0, G = 0, B = 0, A = 255}
  1465. },
  1466. _Selected = false,
  1467. _Hovered = false,
  1468. _Enabled = true,
  1469. _Offset = {X = 0, Y = 0},
  1470. _LabelOffset = {X = 0, Y = 0},
  1471. _LeftBadgeOffset = {X = 0, Y = 0},
  1472. _RightBadgeOffset = {X = 0, Y = 0},
  1473. ParentMenu = nil,
  1474. Panels = {},
  1475. Activated = function(menu, item) end,
  1476. ActivatedPanel = function(menu, item, panel, panelvalue) end
  1477. }
  1478. return setmetatable(_UIMenuItem, UIMenuItem)
  1479. end
  1480.  
  1481. function UIMenuItem:SetParentMenu(Menu)
  1482. if Menu ~= nil and Menu() == "UIMenu" then
  1483. self.ParentMenu = Menu
  1484. else
  1485. return self.ParentMenu
  1486. end
  1487. end
  1488.  
  1489. function UIMenuItem:Selected(bool)
  1490. if bool ~= nil then
  1491. self._Selected = ToBool(bool)
  1492. else
  1493. return self._Selected
  1494. end
  1495. end
  1496.  
  1497. function UIMenuItem:Hovered(bool)
  1498. if bool ~= nil then
  1499. self._Hovered = ToBool(bool)
  1500. else
  1501. return self._Hovered
  1502. end
  1503. end
  1504.  
  1505. function UIMenuItem:Enabled(bool)
  1506. if bool ~= nil then
  1507. self._Enabled = ToBool(bool)
  1508. else
  1509. return self._Enabled
  1510. end
  1511. end
  1512.  
  1513. function UIMenuItem:Description(str)
  1514. if tostring(str) and str ~= nil then
  1515. self._Description = tostring(str)
  1516. else
  1517. return self._Description
  1518. end
  1519. end
  1520.  
  1521. function UIMenuItem:Offset(X, Y)
  1522. if tonumber(X) or tonumber(Y) then
  1523. if tonumber(X) then self._Offset.X = tonumber(X) end
  1524. if tonumber(Y) then self._Offset.Y = tonumber(Y) end
  1525. else
  1526. return self._Offset
  1527. end
  1528. end
  1529.  
  1530. function UIMenuItem:LeftBadgeOffset(X, Y)
  1531. if tonumber(X) or tonumber(Y) then
  1532. if tonumber(X) then self._LeftBadgeOffset.X = tonumber(X) end
  1533. if tonumber(Y) then self._LeftBadgeOffset.Y = tonumber(Y) end
  1534. else
  1535. return self._LeftBadgeOffset
  1536. end
  1537. end
  1538.  
  1539. function UIMenuItem:RightBadgeOffset(X, Y)
  1540. if tonumber(X) or tonumber(Y) then
  1541. if tonumber(X) then self._RightBadgeOffset.X = tonumber(X) end
  1542. if tonumber(Y) then self._RightBadgeOffset.Y = tonumber(Y) end
  1543. else
  1544. return self._RightBadgeOffset
  1545. end
  1546. end
  1547.  
  1548. function UIMenuItem:Position(Y)
  1549. if tonumber(Y) then
  1550. self.Rectangle:Position(self._Offset.X, Y + 144 + self._Offset.Y)
  1551. self.SelectedSprite:Position(0 + self._Offset.X, Y + 144 + self._Offset.Y)
  1552. self.Text:Position(self._Text.Padding.X + self._Offset.X, Y + 149 + self._Offset.Y)
  1553. self.LeftBadge.Sprite:Position(0 + self._Offset.X + self._LeftBadgeOffset.X, Y + 146 + self._Offset.Y + self._LeftBadgeOffset.Y)
  1554. self.RightBadge.Sprite:Position(385 + self._Offset.X + self._RightBadgeOffset.X,
  1555. Y + 146 + self._Offset.Y + self._RightBadgeOffset.Y)
  1556. self.Label.Text:Position(415 + self._Offset.X + self._LabelOffset.X, Y + 148 + self._Offset.Y + self._LabelOffset.Y)
  1557. end
  1558. end
  1559.  
  1560. function UIMenuItem:RightLabel(Text, MainColour, HighlightColour)
  1561. if MainColour ~= nil then
  1562. local labelMainColour = MainColour
  1563. else
  1564. local labelMainColour = {R = 255, G = 255, B = 255, A = 255}
  1565. end
  1566. if HighlightColour ~= nil then
  1567. local labelHighlightColour = HighlightColour
  1568. else
  1569. local labelHighlightColour = {R = 0, G = 0, B = 0, A = 255}
  1570. end
  1571. if tostring(Text) and Text ~= nil then
  1572. if type(labelMainColour) == "table" then self.Label.MainColour = labelMainColour end
  1573. if type(labelHighlightColour) == "table" then self.Label.HighlightColour = labelHighlightColour end
  1574. self.Label.Text:Text(tostring(Text))
  1575. else
  1576. self.Label.MainColour = {R = 0, G = 0, B = 0, A = 0}
  1577. self.Label.HighlightColour = {R = 0, G = 0, B = 0, A = 0}
  1578. return self.Label.Text:Text()
  1579. end
  1580. end
  1581.  
  1582. function UIMenuItem:SetLeftBadge(Badge) if tonumber(Badge) then self.LeftBadge.Badge = tonumber(Badge) end end
  1583.  
  1584. function UIMenuItem:SetRightBadge(Badge) if tonumber(Badge) then self.RightBadge.Badge = tonumber(Badge) end end
  1585.  
  1586. function UIMenuItem:Text(Text)
  1587. if tostring(Text) and Text ~= nil then
  1588. self.Text:Text(tostring(Text))
  1589. else
  1590. return self.Text:Text()
  1591. end
  1592. end
  1593.  
  1594. function UIMenuItem:SetTextSelectedColor(R, G, B, A)
  1595. if tonumber(R) and tonumber(G) and tonumber(B) and tonumber(A) then
  1596. self._Text.Colour.Selected.R = R
  1597. self._Text.Colour.Selected.G = G
  1598. self._Text.Colour.Selected.B = B
  1599. self._Text.Colour.Selected.A = A
  1600. else
  1601. return {
  1602. R = self._Text.Colour.Selected.R,
  1603. G = self._Text.Colour.Selected.G,
  1604. B = self._Text.Colour.Selected.B,
  1605. A = self._Text.Colour.Selected.A
  1606. }
  1607. end
  1608. end
  1609.  
  1610. function UIMenuItem:SetTextHoveredColor(R, G, B, A)
  1611. if tonumber(R) and tonumber(G) and tonumber(B) and tonumber(A) then
  1612. self._Text.Colour.Hovered.R = R
  1613. self._Text.Colour.Hovered.G = G
  1614. self._Text.Colour.Hovered.B = B
  1615. self._Text.Colour.Hovered.A = A
  1616. else
  1617. return {
  1618. R = self._Text.Colour.Hovered.R,
  1619. G = self._Text.Colour.Hovered.G,
  1620. B = self._Text.Colour.Hovered.B,
  1621. A = self._Text.Colour.Hovered.A
  1622. }
  1623. end
  1624. end
  1625.  
  1626. function UIMenuItem:AddPanel(Panel)
  1627. if Panel() == "UIMenuPanel" then
  1628. table.insert(self.Panels, Panel)
  1629. Panel:SetParentItem(self)
  1630. end
  1631. end
  1632.  
  1633. function UIMenuItem:RemovePanelAt(Index)
  1634. if tonumber(Index) then if self.Panels[Index] then table.remove(self.Panels, tonumber(Index)) end end
  1635. end
  1636.  
  1637. function UIMenuItem:FindPanelIndex(Panel)
  1638. if Panel() == "UIMenuPanel" then for Index = 1, #self.Panels do if self.Panels[Index] == Panel then return Index end end end
  1639. return nil
  1640. end
  1641.  
  1642. function UIMenuItem:FindPanelItem()
  1643. for Index = #self.Items, 1, -1 do if self.Items[Index].Panel then return Index end end
  1644. return nil
  1645. end
  1646.  
  1647. function UIMenuItem:Draw()
  1648. self.Rectangle:Size(431 + self.ParentMenu.WidthOffset, self.Rectangle.Height)
  1649. self.SelectedSprite:Size(431 + self.ParentMenu.WidthOffset, self.SelectedSprite.Height)
  1650.  
  1651. if self._Hovered and not self._Selected then self.Rectangle:Draw() end
  1652.  
  1653. if self._Selected then self.SelectedSprite:Draw() end
  1654.  
  1655. if self._Enabled then
  1656. if self._Selected then
  1657. self.Text:Colour(self._Text.Colour.Selected.R, self._Text.Colour.Selected.G, self._Text.Colour.Selected.B,
  1658. self._Text.Colour.Selected.A)
  1659. self.Label.Text:Colour(self.Label.HighlightColour.R, self.Label.HighlightColour.G, self.Label.HighlightColour.B,
  1660. self.Label.HighlightColour.A)
  1661. else
  1662. self.Text:Colour(self._Text.Colour.Hovered.R, self._Text.Colour.Hovered.G, self._Text.Colour.Hovered.B,
  1663. self._Text.Colour.Hovered.A)
  1664. self.Label.Text:Colour(self.Label.MainColour.R, self.Label.MainColour.G, self.Label.MainColour.B, self.Label.MainColour.A)
  1665. end
  1666. else
  1667. self.Text:Colour(163, 159, 148, 255)
  1668. self.Label.Text:Colour(163, 159, 148, 255)
  1669. end
  1670.  
  1671. if self.LeftBadge.Badge == BadgeStyle.None then
  1672. self.Text:Position(self._Text.Padding.X + self._Offset.X, self.Text.Y)
  1673. else
  1674. self.Text:Position(35 + self._Offset.X + self._LeftBadgeOffset.X, self.Text.Y)
  1675. self.LeftBadge.Sprite.TxtDictionary = GetBadgeDictionary(self.LeftBadge.Badge, self._Selected)
  1676. self.LeftBadge.Sprite.TxtName = GetBadgeTexture(self.LeftBadge.Badge, self._Selected)
  1677. self.LeftBadge.Sprite:Colour(GetBadgeColour(self.LeftBadge.Badge, self._Selected))
  1678. self.LeftBadge.Sprite:Draw()
  1679. end
  1680.  
  1681. if self.RightBadge.Badge ~= BadgeStyle.None then
  1682. self.RightBadge.Sprite:Position(385 + self._Offset.X + self.ParentMenu.WidthOffset + self._RightBadgeOffset.X,
  1683. self.RightBadge.Sprite.Y)
  1684. self.RightBadge.Sprite.TxtDictionary = GetBadgeDictionary(self.RightBadge.Badge, self._Selected)
  1685. self.RightBadge.Sprite.TxtName = GetBadgeTexture(self.RightBadge.Badge, self._Selected)
  1686. self.RightBadge.Sprite:Colour(GetBadgeColour(self.RightBadge.Badge, self._Selected))
  1687. self.RightBadge.Sprite:Draw()
  1688. end
  1689.  
  1690. if self.Label.Text:Text() ~= "" and string.len(self.Label.Text:Text()) > 0 then
  1691. if self.RightBadge.Badge ~= BadgeStyle.None then
  1692. self.Label.Text:Position(385 + self._Offset.X + self.ParentMenu.WidthOffset + self._RightBadgeOffset.X, self.Label.Text.Y)
  1693. self.Label.Text:Draw()
  1694. else
  1695. self.Label.Text:Position(415 + self._Offset.X + self.ParentMenu.WidthOffset + self._LabelOffset.X, self.Label.Text.Y)
  1696. self.Label.Text:Draw()
  1697. end
  1698. end
  1699.  
  1700. self.Text:Draw()
  1701. end
  1702. end
  1703.  
  1704. --==================================================================================================================================================--
  1705. --NativeUI\UIMenu\items\UIMenuCheckboxItem
  1706. --==================================================================================================================================================--
  1707. UIMenuCheckboxItem = setmetatable({}, UIMenuCheckboxItem)
  1708. UIMenuCheckboxItem.__index = UIMenuCheckboxItem
  1709. UIMenuCheckboxItem.__call = function() return "UIMenuItem", "UIMenuCheckboxItem" end
  1710. do
  1711. function UIMenuCheckboxItem.New(Text, Check, Description, CheckboxStyle)
  1712. if CheckboxStyle ~= nil then
  1713. CheckboxStyle = tonumber(CheckboxStyle)
  1714. else
  1715. CheckboxStyle = 1
  1716. end
  1717. local _UIMenuCheckboxItem = {
  1718. Base = UIMenuItem.New(Text or "", Description or ""),
  1719. CheckboxStyle = CheckboxStyle,
  1720. CheckedSprite = Sprite.New("commonmenu", "shop_box_blank", 410, 95, 50, 50),
  1721. Checked = ToBool(Check),
  1722. CheckboxEvent = function(menu, item, checked) end
  1723. }
  1724. return setmetatable(_UIMenuCheckboxItem, UIMenuCheckboxItem)
  1725. end
  1726.  
  1727. function UIMenuCheckboxItem:SetParentMenu(Menu)
  1728. if Menu() == "UIMenu" then
  1729. self.Base.ParentMenu = Menu
  1730. else
  1731. return self.Base.ParentMenu
  1732. end
  1733. end
  1734.  
  1735. function UIMenuCheckboxItem:Position(Y)
  1736. if tonumber(Y) then
  1737. self.Base:Position(Y)
  1738. self.CheckedSprite:Position(380 + self.Base._Offset.X + self.Base.ParentMenu.WidthOffset, Y + 138 + self.Base._Offset.Y)
  1739. end
  1740. end
  1741.  
  1742. function UIMenuCheckboxItem:Selected(bool)
  1743. if bool ~= nil then
  1744. self.Base._Selected = ToBool(bool)
  1745. else
  1746. return self.Base._Selected
  1747. end
  1748. end
  1749.  
  1750. function UIMenuCheckboxItem:Hovered(bool)
  1751. if bool ~= nil then
  1752. self.Base._Hovered = ToBool(bool)
  1753. else
  1754. return self.Base._Hovered
  1755. end
  1756. end
  1757.  
  1758. function UIMenuCheckboxItem:Enabled(bool)
  1759. if bool ~= nil then
  1760. self.Base._Enabled = ToBool(bool)
  1761. else
  1762. return self.Base._Enabled
  1763. end
  1764. end
  1765.  
  1766. function UIMenuCheckboxItem:Description(str)
  1767. if tostring(str) and str ~= nil then
  1768. self.Base._Description = tostring(str)
  1769. else
  1770. return self.Base._Description
  1771. end
  1772. end
  1773.  
  1774. function UIMenuCheckboxItem:Offset(X, Y)
  1775. if tonumber(X) or tonumber(Y) then
  1776. if tonumber(X) then self.Base._Offset.X = tonumber(X) end
  1777. if tonumber(Y) then self.Base._Offset.Y = tonumber(Y) end
  1778. else
  1779. return self.Base._Offset
  1780. end
  1781. end
  1782.  
  1783. function UIMenuCheckboxItem:Text(Text)
  1784. if tostring(Text) and Text ~= nil then
  1785. self.Base.Text:Text(tostring(Text))
  1786. else
  1787. return self.Base.Text:Text()
  1788. end
  1789. end
  1790.  
  1791. function UIMenuCheckboxItem:SetLeftBadge() error("This item does not support badges") end
  1792.  
  1793. function UIMenuCheckboxItem:SetRightBadge() error("This item does not support badges") end
  1794.  
  1795. function UIMenuCheckboxItem:RightLabel() error("This item does not support a right label") end
  1796.  
  1797. function UIMenuCheckboxItem:Draw()
  1798. self.Base:Draw()
  1799. self.CheckedSprite:Position(380 + self.Base._Offset.X + self.Base.ParentMenu.WidthOffset, self.CheckedSprite.Y)
  1800. if self.CheckboxStyle == nil or self.CheckboxStyle == tonumber(1) then
  1801. if self.Base:Selected() then
  1802. if self.Checked then
  1803. self.CheckedSprite.TxtName = "shop_box_tickb"
  1804. else
  1805. self.CheckedSprite.TxtName = "shop_box_blankb"
  1806. end
  1807. else
  1808. if self.Checked then
  1809. self.CheckedSprite.TxtName = "shop_box_tick"
  1810. else
  1811. self.CheckedSprite.TxtName = "shop_box_blank"
  1812. end
  1813. end
  1814. elseif self.CheckboxStyle == tonumber(2) then
  1815. if self.Base:Selected() then
  1816. if self.Checked then
  1817. self.CheckedSprite.TxtName = "shop_box_crossb"
  1818. else
  1819. self.CheckedSprite.TxtName = "shop_box_blankb"
  1820. end
  1821. else
  1822. if self.Checked then
  1823. self.CheckedSprite.TxtName = "shop_box_cross"
  1824. else
  1825. self.CheckedSprite.TxtName = "shop_box_blank"
  1826. end
  1827. end
  1828. end
  1829. self.CheckedSprite:Draw()
  1830. end
  1831. end
  1832.  
  1833. function flipcar()
  1834. local ax = GetPlayerPed(-1)
  1835. local ay = GetVehiclePedIsIn(ax, true)
  1836. if
  1837. IsPedInAnyVehicle(GetPlayerPed(-1), 0) and
  1838. GetPedInVehicleSeat(GetVehiclePedIsIn(GetPlayerPed(-1), 0), -1) == GetPlayerPed(-1)
  1839. then
  1840. SetVehicleOnGroundProperly(ay)
  1841. av('Vehicle is flipped', false)
  1842. else
  1843. av("Sit in the driver seat idiot", true)
  1844. end
  1845. end
  1846.  
  1847. --==================================================================================================================================================--
  1848. -- NativeUI\UIMenu\items\UIMenuListItem
  1849. --==================================================================================================================================================--
  1850. UIMenuListItem = setmetatable({}, UIMenuListItem)
  1851. UIMenuListItem.__index = UIMenuListItem
  1852. UIMenuListItem.__call = function() return "UIMenuItem", "UIMenuListItem" end
  1853. do
  1854. function UIMenuListItem.New(Text, Items, Index, Description)
  1855. if type(Items) ~= "table" then Items = {} end
  1856. if Index == 0 then Index = 1 end
  1857. local _UIMenuListItem = {
  1858. Base = UIMenuItem.New(Text or "", Description or ""),
  1859. Items = Items,
  1860. LeftArrow = Sprite.New("commonmenu", "arrowleft", 110, 105, 30, 30),
  1861. RightArrow = Sprite.New("commonmenu", "arrowright", 280, 105, 30, 30),
  1862. ItemText = UIResText.New("", 290, 104, 0.35, 255, 255, 255, 255, 0, "Right"),
  1863. _Index = tonumber(Index) or 1,
  1864. Panels = {},
  1865. OnListChanged = function(menu, item, newindex) end,
  1866. OnListSelected = function(menu, item, newindex) end
  1867. }
  1868. return setmetatable(_UIMenuListItem, UIMenuListItem)
  1869. end
  1870.  
  1871. function UIMenuListItem:SetParentMenu(Menu)
  1872. if Menu ~= nil and Menu() == "UIMenu" then
  1873. self.Base.ParentMenu = Menu
  1874. else
  1875. return self.Base.ParentMenu
  1876. end
  1877. end
  1878.  
  1879. function UIMenuListItem:Position(Y)
  1880. if tonumber(Y) then
  1881. self.LeftArrow:Position(300 + self.Base._Offset.X + self.Base.ParentMenu.WidthOffset, 147 + Y + self.Base._Offset.Y)
  1882. self.RightArrow:Position(400 + self.Base._Offset.X + self.Base.ParentMenu.WidthOffset, 147 + Y + self.Base._Offset.Y)
  1883. self.ItemText:Position(300 + self.Base._Offset.X + self.Base.ParentMenu.WidthOffset, 147 + Y + self.Base._Offset.Y)
  1884. self.Base:Position(Y)
  1885. end
  1886. end
  1887.  
  1888. function UIMenuListItem:Selected(bool)
  1889. if bool ~= nil then
  1890. self.Base._Selected = ToBool(bool)
  1891. else
  1892. return self.Base._Selected
  1893. end
  1894. end
  1895.  
  1896. function UIMenuListItem:Hovered(bool)
  1897. if bool ~= nil then
  1898. self.Base._Hovered = ToBool(bool)
  1899. else
  1900. return self.Base._Hovered
  1901. end
  1902. end
  1903.  
  1904. function UIMenuListItem:Enabled(bool)
  1905. if bool ~= nil then
  1906. self.Base._Enabled = ToBool(bool)
  1907. else
  1908. return self.Base._Enabled
  1909. end
  1910. end
  1911.  
  1912. function UIMenuListItem:Description(str)
  1913. if tostring(str) and str ~= nil then
  1914. self.Base._Description = tostring(str)
  1915. else
  1916. return self.Base._Description
  1917. end
  1918. end
  1919.  
  1920. function UIMenuListItem:Offset(X, Y)
  1921. if tonumber(X) or tonumber(Y) then
  1922. if tonumber(X) then self.Base._Offset.X = tonumber(X) end
  1923. if tonumber(Y) then self.Base._Offset.Y = tonumber(Y) end
  1924. else
  1925. return self.Base._Offset
  1926. end
  1927. end
  1928.  
  1929. function UIMenuListItem:Text(Text)
  1930. if tostring(Text) and Text ~= nil then
  1931. self.Base.Text:Text(tostring(Text))
  1932. else
  1933. return self.Base.Text:Text()
  1934. end
  1935. end
  1936.  
  1937. function UIMenuListItem:Index(Index)
  1938. if tonumber(Index) then
  1939. if tonumber(Index) > #self.Items then
  1940. self._Index = 1
  1941. elseif tonumber(Index) < 1 then
  1942. self._Index = #self.Items
  1943. else
  1944. self._Index = tonumber(Index)
  1945. end
  1946. else
  1947. return self._Index
  1948. end
  1949. end
  1950.  
  1951. function UIMenuListItem:ItemToIndex(Item)
  1952. for i = 1, #self.Items do
  1953. if type(Item) == type(self.Items[i]) and Item == self.Items[i] then
  1954. return i
  1955. elseif type(self.Items[i]) == "table" and (type(Item) == type(self.Items[i].Name) or type(Item) == type(self.Items[i].Value)) and
  1956. (Item == self.Items[i].Name or Item == self.Items[i].Value) then
  1957. return i
  1958. end
  1959. end
  1960. end
  1961.  
  1962. function UIMenuListItem:IndexToItem(Index)
  1963. if tonumber(Index) then
  1964. if tonumber(Index) == 0 then Index = 1 end
  1965. if self.Items[tonumber(Index)] then return self.Items[tonumber(Index)] end
  1966. end
  1967. end
  1968.  
  1969. function UIMenuListItem:SetLeftBadge() error("This item does not support badges") end
  1970.  
  1971. function UIMenuListItem:SetRightBadge() error("This item does not support badges") end
  1972.  
  1973. function UIMenuListItem:RightLabel() error("This item does not support a right label") end
  1974.  
  1975. function UIMenuListItem:AddPanel(Panel)
  1976. if Panel() == "UIMenuPanel" then
  1977. table.insert(self.Panels, Panel)
  1978. Panel:SetParentItem(self)
  1979. end
  1980. end
  1981.  
  1982. function UIMenuListItem:RemovePanelAt(Index)
  1983. if tonumber(Index) then if self.Panels[Index] then table.remove(self.Panels, tonumber(Index)) end end
  1984. end
  1985.  
  1986. function UIMenuListItem:FindPanelIndex(Panel)
  1987. if Panel() == "UIMenuPanel" then for Index = 1, #self.Panels do if self.Panels[Index] == Panel then return Index end end end
  1988. return nil
  1989. end
  1990.  
  1991. function UIMenuListItem:FindPanelItem()
  1992. for Index = #self.Items, 1, -1 do if self.Items[Index].Panel then return Index end end
  1993. return nil
  1994. end
  1995.  
  1996. function UIMenuListItem:Draw()
  1997. self.Base:Draw()
  1998.  
  1999. if self:Enabled() then
  2000. if self:Selected() then
  2001. self.ItemText:Colour(0, 0, 0, 255)
  2002. self.LeftArrow:Colour(0, 0, 0, 255)
  2003. self.RightArrow:Colour(0, 0, 0, 255)
  2004. else
  2005. self.ItemText:Colour(245, 245, 245, 255)
  2006. self.LeftArrow:Colour(245, 245, 245, 255)
  2007. self.RightArrow:Colour(245, 245, 245, 255)
  2008. end
  2009. else
  2010. self.ItemText:Colour(163, 159, 148, 255)
  2011. self.LeftArrow:Colour(163, 159, 148, 255)
  2012. self.RightArrow:Colour(163, 159, 148, 255)
  2013. end
  2014.  
  2015. local Text = (type(self.Items[self._Index]) == "table") and tostring(self.Items[self._Index].Name) or
  2016. tostring(self.Items[self._Index])
  2017. local Offset = MeasureStringWidth(Text, 0, 0.35)
  2018.  
  2019. self.ItemText:Text(Text)
  2020. self.LeftArrow:Position(378 - Offset + self.Base._Offset.X + self.Base.ParentMenu.WidthOffset, self.LeftArrow.Y)
  2021.  
  2022. self.LeftArrow:Draw()
  2023. self.RightArrow:Draw()
  2024. self.ItemText:Position(403 + self.Base._Offset.X + self.Base.ParentMenu.WidthOffset, self.ItemText.Y)
  2025.  
  2026. self.ItemText:Draw()
  2027. end
  2028. end
  2029.  
  2030. --==================================================================================================================================================--
  2031. -- NativeUI\UIMenu\items\UIMenuColouredItem
  2032. --==================================================================================================================================================--
  2033. UIMenuColouredItem = setmetatable({}, UIMenuColouredItem)
  2034. UIMenuColouredItem.__index = UIMenuColouredItem
  2035. UIMenuColouredItem.__call = function() return "UIMenuItem", "UIMenuColouredItem" end
  2036. do
  2037. function UIMenuColouredItem.New(Text, Description, MainColour, HighlightColour)
  2038. if type(Colour) ~= "table" then Colour = {R = 0, G = 0, B = 0, A = 255} end
  2039. if type(HighlightColour) ~= "table" then Colour = {R = 255, G = 255, B = 255, A = 255} end
  2040. local _UIMenuColouredItem = {
  2041. Base = UIMenuItem.New(Text or "", Description or ""),
  2042. Rectangle = UIResRectangle.New(0, 0, 431, 38, MainColour.R, MainColour.G, MainColour.B, MainColour.A),
  2043. MainColour = MainColour,
  2044. HighlightColour = HighlightColour,
  2045. ParentMenu = nil,
  2046. Activated = function(menu, item) end
  2047. }
  2048. _UIMenuColouredItem.Base.SelectedSprite:Colour(HighlightColour.R, HighlightColour.G, HighlightColour.B, HighlightColour.A)
  2049. return setmetatable(_UIMenuColouredItem, UIMenuColouredItem)
  2050. end
  2051.  
  2052. function UIMenuColouredItem:SetParentMenu(Menu)
  2053. if Menu() == "UIMenu" then
  2054. self.Base.ParentMenu = Menu
  2055. self.ParentMenu = Menu
  2056. else
  2057. return self.Base.ParentMenu
  2058. end
  2059. end
  2060.  
  2061. function UIMenuColouredItem:Position(Y)
  2062. if tonumber(Y) then
  2063. self.Base:Position(Y)
  2064. self.Rectangle:Position(self.Base._Offset.X, Y + 144 + self.Base._Offset.Y)
  2065. end
  2066. end
  2067.  
  2068. function UIMenuColouredItem:Selected(bool)
  2069. if bool ~= nil then
  2070. self.Base._Selected = ToBool(bool)
  2071. else
  2072. return self.Base._Selected
  2073. end
  2074. end
  2075.  
  2076. function UIMenuColouredItem:Hovered(bool)
  2077. if bool ~= nil then
  2078. self.Base._Hovered = ToBool(bool)
  2079. else
  2080. return self.Base._Hovered
  2081. end
  2082. end
  2083.  
  2084. function UIMenuColouredItem:Enabled(bool)
  2085. if bool ~= nil then
  2086. self.Base._Enabled = ToBool(bool)
  2087. else
  2088. return self.Base._Enabled
  2089. end
  2090. end
  2091.  
  2092. function UIMenuColouredItem:Description(str)
  2093. if tostring(str) and str ~= nil then
  2094. self.Base._Description = tostring(str)
  2095. else
  2096. return self.Base._Description
  2097. end
  2098. end
  2099.  
  2100. function UIMenuColouredItem:Offset(X, Y)
  2101. if tonumber(X) or tonumber(Y) then
  2102. if tonumber(X) then self.Base._Offset.X = tonumber(X) end
  2103. if tonumber(Y) then self.Base._Offset.Y = tonumber(Y) end
  2104. else
  2105. return self.Base._Offset
  2106. end
  2107. end
  2108.  
  2109. function UIMenuColouredItem:Text(Text)
  2110. if tostring(Text) and Text ~= nil then
  2111. self.Base.Text:Text(tostring(Text))
  2112. else
  2113. return self.Base.Text:Text()
  2114. end
  2115. end
  2116.  
  2117. function UIMenuColouredItem:SetTextSelectedColor(R, G, B, A)
  2118. if tonumber(R) and tonumber(G) and tonumber(B) and tonumber(A) then
  2119. self.Base._Text.Colour.Selected.R = R
  2120. self.Base._Text.Colour.Selected.G = G
  2121. self.Base._Text.Colour.Selected.B = B
  2122. self.Base._Text.Colour.Selected.A = A
  2123. else
  2124. return {
  2125. R = self.Base._Text.Colour.Selected.R,
  2126. G = self.Base._Text.Colour.Selected.G,
  2127. B = self.Base._Text.Colour.Selected.B,
  2128. A = self.Base._Text.Colour.Selected.A
  2129. }
  2130. end
  2131. end
  2132.  
  2133. function UIMenuColouredItem:SetTextHoveredColor(R, G, B, A)
  2134. if tonumber(R) and tonumber(G) and tonumber(B) and tonumber(A) then
  2135. self.Base._Text.Colour.Hovered.R = R
  2136. self.Base._Text.Colour.Hovered.G = G
  2137. self.Base._Text.Colour.Hovered.B = B
  2138. self.Base._Text.Colour.Hovered.A = A
  2139. else
  2140. return {
  2141. R = self.Base._Text.Colour.Hovered.R,
  2142. G = self.Base._Text.Colour.Hovered.G,
  2143. B = self.Base._Text.Colour.Hovered.B,
  2144. A = self.Base._Text.Colour.Hovered.A
  2145. }
  2146. end
  2147. end
  2148.  
  2149. function UIMenuColouredItem:RightLabel(Text, MainColour, HighlightColour)
  2150. if tostring(Text) and Text ~= nil then
  2151. if type(MainColour) == "table" then self.Base.Label.MainColour = MainColour end
  2152. if type(HighlightColour) == "table" then self.Base.Label.HighlightColour = HighlightColour end
  2153. self.Base.Label.Text:Text(tostring(Text))
  2154. else
  2155. self.Label.MainColour = {R = 0, G = 0, B = 0, A = 0}
  2156. self.Label.HighlightColour = {R = 0, G = 0, B = 0, A = 0}
  2157. return self.Base.Label.Text:Text()
  2158. end
  2159. end
  2160.  
  2161. function UIMenuColouredItem:SetLeftBadge(Badge) if tonumber(Badge) then self.Base.LeftBadge.Badge = tonumber(Badge) end end
  2162.  
  2163. function UIMenuColouredItem:SetRightBadge(Badge) if tonumber(Badge) then self.Base.RightBadge.Badge = tonumber(Badge) end end
  2164.  
  2165. function UIMenuColouredItem:Draw()
  2166. self.Rectangle:Size(431 + self.ParentMenu.WidthOffset, self.Rectangle.Height)
  2167. self.Rectangle:Draw()
  2168. self.Base:Draw()
  2169. end
  2170. end
  2171.  
  2172. --==================================================================================================================================================--
  2173. -- NativeUI\UIMenu\items\UIMenuProgressItem
  2174. --==================================================================================================================================================--
  2175. UIMenuProgressItem = setmetatable({}, UIMenuProgressItem)
  2176. UIMenuProgressItem.__index = UIMenuProgressItem
  2177. UIMenuProgressItem.__call = function() return "UIMenuItem", "UIMenuProgressItem" end
  2178. do
  2179. function UIMenuProgressItem.New(Text, Items, Index, Description, Counter)
  2180. if type(Items) ~= "table" then Items = {} end
  2181. if Index == 0 then Index = 1 end
  2182. local _UIMenuProgressItem = {
  2183. Base = UIMenuItem.New(Text or "", Description or ""),
  2184. Data = {Items = Items, Counter = ToBool(Counter), Max = 407.5, Index = tonumber(Index) or 1},
  2185. Audio = {Slider = "CONTINUOUS_SLIDER", Library = "HUD_FRONTEND_DEFAULT_SOUNDSET", Id = nil},
  2186. Background = UIResRectangle.New(0, 0, 415, 20, 0, 0, 0, 255),
  2187. Bar = UIResRectangle.New(0, 0, 407.5, 12.5),
  2188. OnProgressChanged = function(menu, item, newindex) end,
  2189. OnProgressSelected = function(menu, item, newindex) end
  2190. }
  2191.  
  2192. _UIMenuProgressItem.Base.Rectangle.Height = 60
  2193. _UIMenuProgressItem.Base.SelectedSprite.Height = 60
  2194.  
  2195. if _UIMenuProgressItem.Data.Counter then
  2196. _UIMenuProgressItem.Base:RightLabel(_UIMenuProgressItem.Data.Index .. "/" .. #_UIMenuProgressItem.Data.Items)
  2197. else
  2198. _UIMenuProgressItem.Base:RightLabel((type(_UIMenuProgressItem.Data.Items[_UIMenuProgressItem.Data.Index]) == "table") and
  2199. tostring(_UIMenuProgressItem.Data.Items[_UIMenuProgressItem.Data.Index].Name) or
  2200. tostring(_UIMenuProgressItem.Data.Items[_UIMenuProgressItem.Data.Index]))
  2201. end
  2202.  
  2203. _UIMenuProgressItem.Bar.Width = _UIMenuProgressItem.Data.Index / #_UIMenuProgressItem.Data.Items * _UIMenuProgressItem.Data.Max
  2204.  
  2205. return setmetatable(_UIMenuProgressItem, UIMenuProgressItem)
  2206. end
  2207.  
  2208. function UIMenuProgressItem:SetParentMenu(Menu)
  2209. if Menu() == "UIMenu" then
  2210. self.Base.ParentMenu = Menu
  2211. else
  2212. return self.Base.ParentMenu
  2213. end
  2214. end
  2215.  
  2216. function UIMenuProgressItem:Position(Y)
  2217. if tonumber(Y) then
  2218. self.Base:Position(Y)
  2219. self.Data.Max = 407.5 + self.Base.ParentMenu.WidthOffset
  2220. self.Background:Size(415 + self.Base.ParentMenu.WidthOffset, 20)
  2221. self.Background:Position(8 + self.Base._Offset.X, 177 + Y + self.Base._Offset.Y)
  2222. self.Bar:Position(11.75 + self.Base._Offset.X, 180.75 + Y + self.Base._Offset.Y)
  2223. end
  2224. end
  2225.  
  2226. function UIMenuProgressItem:Selected(bool)
  2227. if bool ~= nil then
  2228. self.Base._Selected = ToBool(bool)
  2229. else
  2230. return self.Base._Selected
  2231. end
  2232. end
  2233.  
  2234. function UIMenuProgressItem:Hovered(bool)
  2235. if bool ~= nil then
  2236. self.Base._Hovered = ToBool(bool)
  2237. else
  2238. return self.Base._Hovered
  2239. end
  2240. end
  2241.  
  2242. function UIMenuProgressItem:Enabled(bool)
  2243. if bool ~= nil then
  2244. self.Base._Enabled = ToBool(bool)
  2245. else
  2246. return self.Base._Enabled
  2247. end
  2248. end
  2249.  
  2250. function UIMenuProgressItem:Description(str)
  2251. if tostring(str) and str ~= nil then
  2252. self.Base._Description = tostring(str)
  2253. else
  2254. return self.Base._Description
  2255. end
  2256. end
  2257.  
  2258. function UIMenuProgressItem:Offset(X, Y)
  2259. if tonumber(X) or tonumber(Y) then
  2260. if tonumber(X) then self.Base._Offset.X = tonumber(X) end
  2261. if tonumber(Y) then self.Base._Offset.Y = tonumber(Y) end
  2262. else
  2263. return self.Base._Offset
  2264. end
  2265. end
  2266.  
  2267. function UIMenuProgressItem:Text(Text)
  2268. if tostring(Text) and Text ~= nil then
  2269. self.Base.Text:Text(tostring(Text))
  2270. else
  2271. return self.Base.Text:Text()
  2272. end
  2273. end
  2274.  
  2275. function UIMenuProgressItem:Index(Index)
  2276. if tonumber(Index) then
  2277. if tonumber(Index) > #self.Data.Items then
  2278. self.Data.Index = 1
  2279. elseif tonumber(Index) < 1 then
  2280. self.Data.Index = #self.Data.Items
  2281. else
  2282. self.Data.Index = tonumber(Index)
  2283. end
  2284.  
  2285. if self.Data.Counter then
  2286. self.Base:RightLabel(self.Data.Index .. "/" .. #self.Data.Items)
  2287. else
  2288. self.Base:RightLabel(
  2289. (type(self.Data.Items[self.Data.Index]) == "table") and tostring(self.Data.Items[self.Data.Index].Name) or
  2290. tostring(self.Data.Items[self.Data.Index]))
  2291. end
  2292.  
  2293. self.Bar.Width = self.Data.Index / #self.Data.Items * self.Data.Max
  2294. else
  2295. return self.Data.Index
  2296. end
  2297. end
  2298.  
  2299. function UIMenuProgressItem:ItemToIndex(Item)
  2300. for i = 1, #self.Data.Items do
  2301. if type(Item) == type(self.Data.Items[i]) and Item == self.Data.Items[i] then
  2302. return i
  2303. elseif type(self.Data.Items[i]) == "table" and
  2304. (type(Item) == type(self.Data.Items[i].Name) or type(Item) == type(self.Data.Items[i].Value)) and
  2305. (Item == self.Data.Items[i].Name or Item == self.Data.Items[i].Value) then
  2306. return i
  2307. end
  2308. end
  2309. end
  2310.  
  2311. function UIMenuProgressItem:IndexToItem(Index)
  2312. if tonumber(Index) then
  2313. if tonumber(Index) == 0 then Index = 1 end
  2314. if self.Data.Items[tonumber(Index)] then return self.Data.Items[tonumber(Index)] end
  2315. end
  2316. end
  2317.  
  2318. function UIMenuProgressItem:SetLeftBadge() error("This item does not support badges") end
  2319.  
  2320. function UIMenuProgressItem:SetRightBadge() error("This item does not support badges") end
  2321.  
  2322. function UIMenuProgressItem:RightLabel() error("This item does not support a right label") end
  2323.  
  2324. function UIMenuProgressItem:CalculateProgress(CursorX)
  2325. local Progress = CursorX - self.Bar.X
  2326. self:Index(math.round(#self.Data.Items *
  2327. (((Progress >= 0 and Progress <= self.Data.Max) and Progress or ((Progress < 0) and 0 or self.Data.Max)) /
  2328. self.Data.Max)))
  2329. end
  2330.  
  2331. function UIMenuProgressItem:Draw()
  2332. self.Base:Draw()
  2333.  
  2334. if self.Base._Selected then
  2335. self.Background:Colour(table.unpack(Colours.Black))
  2336. self.Bar:Colour(table.unpack(Colours.White))
  2337. else
  2338. self.Background:Colour(table.unpack(Colours.White))
  2339. self.Bar:Colour(table.unpack(Colours.Black))
  2340. end
  2341.  
  2342. self.Background:Draw()
  2343. self.Bar:Draw()
  2344. end
  2345. end
  2346.  
  2347. --==================================================================================================================================================--
  2348. -- NativeUI\UIMenu\items\UIMenuSeparatorItem
  2349. --==================================================================================================================================================--
  2350. UIMenuSeparatorItem = setmetatable({}, UIMenuSeparatorItem)
  2351. UIMenuSeparatorItem.__index = UIMenuSeparatorItem
  2352. UIMenuSeparatorItem.__call = function() return "UIMenuItem", "UIMenuSeparatorItem" end
  2353. do
  2354. function UIMenuSeparatorItem.New()
  2355. local _UIMenuSeparatorItem = {Base = UIMenuItem.New(Text or "N/A", Description or "")}
  2356.  
  2357. _UIMenuSeparatorItem.Base.Label.Text.Alignment = "Center"
  2358. return setmetatable(_UIMenuSeparatorItem, UIMenuSeparatorItem)
  2359. end
  2360.  
  2361. function UIMenuSeparatorItem:SetParentMenu(Menu)
  2362. if Menu() == "UIMenu" then
  2363. self.Base.ParentMenu = Menu
  2364. else
  2365. return self.Base.ParentMenu
  2366. end
  2367. end
  2368.  
  2369. function UIMenuSeparatorItem:Position(Y) if tonumber(Y) then self.Base:Position(Y) end end
  2370.  
  2371. function UIMenuSeparatorItem:Selected(bool)
  2372. if bool ~= nil then
  2373. self.Base._Selected = ToBool(bool)
  2374. else
  2375. return self.Base._Selected
  2376. end
  2377. end
  2378.  
  2379. function UIMenuSeparatorItem:Hovered(bool)
  2380. if bool ~= nil then
  2381. self.Base._Hovered = ToBool(bool)
  2382. else
  2383. return self.Base._Hovered
  2384. end
  2385. end
  2386.  
  2387. function UIMenuSeparatorItem:Enabled(bool)
  2388. if bool ~= nil then
  2389. self.Base._Enabled = ToBool(bool)
  2390. else
  2391. return self.Base._Enabled
  2392. end
  2393. end
  2394.  
  2395. function UIMenuSeparatorItem:Description(str)
  2396. if tostring(str) and str ~= nil then
  2397. self.Base._Description = tostring(str)
  2398. else
  2399. return self.Base._Description
  2400. end
  2401. end
  2402.  
  2403. function UIMenuSeparatorItem:Offset(X, Y)
  2404. if tonumber(X) or tonumber(Y) then
  2405. if tonumber(X) then self.Base._Offset.X = tonumber(X) end
  2406. if tonumber(Y) then self.Base._Offset.Y = tonumber(Y) end
  2407. else
  2408. return self.Base._Offset
  2409. end
  2410. end
  2411.  
  2412. function UIMenuSeparatorItem:Text(Text)
  2413. if tostring(Text) and Text ~= nil then
  2414. self.Base.Text:Text(tostring(Text))
  2415. else
  2416. return self.Base.Text:Text()
  2417. end
  2418. end
  2419.  
  2420. function UIMenuSeparatorItem:Draw()
  2421. self.Base:Draw()
  2422.  
  2423. if self.Base._Selected then
  2424. else
  2425. end
  2426.  
  2427. end
  2428. end
  2429.  
  2430. --==================================================================================================================================================--
  2431. -- NativeUI\UIMenu\items\UIMenuSliderHeritageItem
  2432. --==================================================================================================================================================--
  2433. UIMenuSliderHeritageItem = setmetatable({}, UIMenuSliderHeritageItem)
  2434. UIMenuSliderHeritageItem.__index = UIMenuSliderHeritageItem
  2435. UIMenuSliderHeritageItem.__call = function() return "UIMenuItem", "UIMenuSliderHeritageItem" end
  2436. do
  2437. function UIMenuSliderHeritageItem.New(Text, Items, Index, Description, SliderColors, BackgroundSliderColors)
  2438. if type(Items) ~= "table" then Items = {} end
  2439. if Index == 0 then Index = 1 end
  2440.  
  2441. if type(SliderColors) ~= "table" or SliderColors == nil then
  2442. _SliderColors = {R = 57, G = 119, B = 200, A = 255}
  2443. else
  2444. _SliderColors = SliderColors
  2445. end
  2446.  
  2447. if type(BackgroundSliderColors) ~= "table" or BackgroundSliderColors == nil then
  2448. _BackgroundSliderColors = {R = 4, G = 32, B = 57, A = 255}
  2449. else
  2450. _BackgroundSliderColors = BackgroundSliderColors
  2451. end
  2452.  
  2453. local _UIMenuSliderHeritageItem = {
  2454. Base = UIMenuItem.New(Text or "", Description or ""),
  2455. Items = Items,
  2456. LeftArrow = Sprite.New("mpleaderboard", "leaderboard_female_icon", 0, 0, 40, 40, 0, 255, 255, 255, 255),
  2457. RightArrow = Sprite.New("mpleaderboard", "leaderboard_male_icon", 0, 0, 40, 40, 0, 255, 255, 255, 255),
  2458. Background = UIResRectangle.New(0, 0, 150, 10, _BackgroundSliderColors.R, _BackgroundSliderColors.G, _BackgroundSliderColors.B,
  2459. _BackgroundSliderColors.A),
  2460. Slider = UIResRectangle.New(0, 0, 75, 10, _SliderColors.R, _SliderColors.G, _SliderColors.B, _SliderColors.A),
  2461. Divider = UIResRectangle.New(0, 0, 4, 20, 255, 255, 255, 255),
  2462. _Index = tonumber(Index) or 1,
  2463. Audio = {Slider = "CONTINUOUS_SLIDER", Library = "HUD_FRONTEND_DEFAULT_SOUNDSET", Id = nil},
  2464. OnSliderChanged = function(menu, item, newindex) end,
  2465. OnSliderSelected = function(menu, item, newindex) end
  2466. }
  2467. return setmetatable(_UIMenuSliderHeritageItem, UIMenuSliderHeritageItem)
  2468. end
  2469.  
  2470. function UIMenuSliderHeritageItem:SetParentMenu(Menu)
  2471. if Menu() == "UIMenu" then
  2472. self.Base.ParentMenu = Menu
  2473. else
  2474. return self.Base.ParentMenu
  2475. end
  2476. end
  2477.  
  2478. function UIMenuSliderHeritageItem:Position(Y)
  2479. if tonumber(Y) then
  2480. self.Background:Position(250 + self.Base._Offset.X + self.Base.ParentMenu.WidthOffset, Y + 158.5 + self.Base._Offset.Y)
  2481. self.Slider:Position(250 + self.Base._Offset.X + self.Base.ParentMenu.WidthOffset, Y + 158.5 + self.Base._Offset.Y)
  2482. self.Divider:Position(323.5 + self.Base._Offset.X + self.Base.ParentMenu.WidthOffset, Y + 153 + self.Base._Offset.Y)
  2483. self.LeftArrow:Position(217 + self.Base._Offset.X + self.Base.ParentMenu.WidthOffset, 143.5 + Y + self.Base._Offset.Y)
  2484. self.RightArrow:Position(395 + self.Base._Offset.X + self.Base.ParentMenu.WidthOffset, 143.5 + Y + self.Base._Offset.Y)
  2485. self.Base:Position(Y)
  2486. end
  2487. end
  2488.  
  2489. function UIMenuSliderHeritageItem:Selected(bool)
  2490. if bool ~= nil then
  2491. self.Base._Selected = ToBool(bool)
  2492. else
  2493. return self.Base._Selected
  2494. end
  2495. end
  2496.  
  2497. function UIMenuSliderHeritageItem:Hovered(bool)
  2498. if bool ~= nil then
  2499. self.Base._Hovered = ToBool(bool)
  2500. else
  2501. return self.Base._Hovered
  2502. end
  2503. end
  2504.  
  2505. function UIMenuSliderHeritageItem:Enabled(bool)
  2506. if bool ~= nil then
  2507. self.Base._Enabled = ToBool(bool)
  2508. else
  2509. return self.Base._Enabled
  2510. end
  2511. end
  2512.  
  2513. function UIMenuSliderHeritageItem:Description(str)
  2514. if tostring(str) and str ~= nil then
  2515. self.Base._Description = tostring(str)
  2516. else
  2517. return self.Base._Description
  2518. end
  2519. end
  2520.  
  2521. function UIMenuSliderHeritageItem:Offset(X, Y)
  2522. if tonumber(X) or tonumber(Y) then
  2523. if tonumber(X) then self.Base._Offset.X = tonumber(X) end
  2524. if tonumber(Y) then self.Base._Offset.Y = tonumber(Y) end
  2525. else
  2526. return self.Base._Offset
  2527. end
  2528. end
  2529.  
  2530. function UIMenuSliderHeritageItem:Text(Text)
  2531. if tostring(Text) and Text ~= nil then
  2532. self.Base.Text:Text(tostring(Text))
  2533. else
  2534. return self.Base.Text:Text()
  2535. end
  2536. end
  2537.  
  2538. function UIMenuSliderHeritageItem:Index(Index)
  2539. if tonumber(Index) then
  2540. if tonumber(Index) > #self.Items then
  2541. self._Index = 1
  2542. elseif tonumber(Index) < 1 then
  2543. self._Index = #self.Items
  2544. else
  2545. self._Index = tonumber(Index)
  2546. end
  2547. else
  2548. return self._Index
  2549. end
  2550. end
  2551.  
  2552. function UIMenuSliderHeritageItem:ItemToIndex(Item)
  2553. for i = 1, #self.Items do if type(Item) == type(self.Items[i]) and Item == self.Items[i] then return i end end
  2554. end
  2555.  
  2556. function UIMenuSliderHeritageItem:IndexToItem(Index)
  2557. if tonumber(Index) then
  2558. if tonumber(Index) == 0 then Index = 1 end
  2559. if self.Items[tonumber(Index)] then return self.Items[tonumber(Index)] end
  2560. end
  2561. end
  2562.  
  2563. function UIMenuSliderHeritageItem:SetLeftBadge() error("This item does not support badges") end
  2564.  
  2565. function UIMenuSliderHeritageItem:SetRightBadge() error("This item does not support badges") end
  2566.  
  2567. function UIMenuSliderHeritageItem:RightLabel() error("This item does not support a right label") end
  2568.  
  2569. function UIMenuSliderHeritageItem:Draw()
  2570. self.Base:Draw()
  2571. if self:Enabled() then
  2572. if self:Selected() then
  2573. self.LeftArrow:Colour(0, 0, 0, 255)
  2574. self.RightArrow:Colour(0, 0, 0, 255)
  2575. else
  2576. self.LeftArrow:Colour(255, 255, 255, 255)
  2577. self.RightArrow:Colour(255, 255, 255, 255)
  2578. end
  2579. else
  2580. self.LeftArrow:Colour(255, 255, 255, 255)
  2581. self.RightArrow:Colour(255, 255, 255, 255)
  2582. end
  2583. local Offset = ((self.Background.Width - self.Slider.Width) / (#self.Items - 1)) * (self._Index - 1)
  2584. self.Slider:Position(250 + self.Base._Offset.X + Offset + self.Base.ParentMenu.WidthOffset, self.Slider.Y)
  2585. self.LeftArrow:Draw()
  2586. self.RightArrow:Draw()
  2587. self.Background:Draw()
  2588. self.Slider:Draw()
  2589. self.Divider:Draw()
  2590. self.Divider:Colour(255, 255, 255, 255)
  2591. end
  2592. end
  2593.  
  2594. --==================================================================================================================================================--
  2595. -- NativeUI\UIMenu\items\UIMenuSliderItem
  2596. --==================================================================================================================================================--
  2597. UIMenuSliderItem = setmetatable({}, UIMenuSliderItem)
  2598. UIMenuSliderItem.__index = UIMenuSliderItem
  2599. UIMenuSliderItem.__call = function() return "UIMenuItem", "UIMenuSliderItem" end
  2600. do
  2601. function UIMenuSliderItem.New(Text, Items, Index, Description, Divider, SliderColors, BackgroundSliderColors)
  2602. if type(Items) ~= "table" then Items = {} end
  2603. if Index == 0 then Index = 1 end
  2604. if type(SliderColors) ~= "table" or SliderColors == nil then
  2605. _SliderColors = {R = 57, G = 119, B = 200, A = 255}
  2606. else
  2607. _SliderColors = SliderColors
  2608. end
  2609. if type(BackgroundSliderColors) ~= "table" or BackgroundSliderColors == nil then
  2610. _BackgroundSliderColors = {R = 4, G = 32, B = 57, A = 255}
  2611. else
  2612. _BackgroundSliderColors = BackgroundSliderColors
  2613. end
  2614. local _UIMenuSliderItem = {
  2615. Base = UIMenuItem.New(Text or "", Description or ""),
  2616. Items = Items,
  2617. ShowDivider = ToBool(Divider),
  2618. LeftArrow = Sprite.New("commonmenu", "arrowleft", 0, 105, 25, 25),
  2619. RightArrow = Sprite.New("commonmenu", "arrowright", 0, 105, 25, 25),
  2620. Background = UIResRectangle.New(0, 0, 150, 10, _BackgroundSliderColors.R, _BackgroundSliderColors.G, _BackgroundSliderColors.B,
  2621. _BackgroundSliderColors.A),
  2622. Slider = UIResRectangle.New(0, 0, 75, 10, _SliderColors.R, _SliderColors.G, _SliderColors.B, _SliderColors.A),
  2623. Divider = UIResRectangle.New(0, 0, 4, 20, 255, 255, 255, 255),
  2624. _Index = tonumber(Index) or 1,
  2625. OnSliderChanged = function(menu, item, newindex) end,
  2626. OnSliderSelected = function(menu, item, newindex) end
  2627. }
  2628. return setmetatable(_UIMenuSliderItem, UIMenuSliderItem)
  2629. end
  2630.  
  2631. function UIMenuSliderItem:SetParentMenu(Menu)
  2632. if Menu() == "UIMenu" then
  2633. self.Base.ParentMenu = Menu
  2634. else
  2635. return self.Base.ParentMenu
  2636. end
  2637. end
  2638.  
  2639. function UIMenuSliderItem:Position(Y)
  2640. if tonumber(Y) then
  2641. self.Background:Position(250 + self.Base._Offset.X + self.Base.ParentMenu.WidthOffset, Y + 158.5 + self.Base._Offset.Y)
  2642. self.Slider:Position(250 + self.Base._Offset.X + self.Base.ParentMenu.WidthOffset, Y + 158.5 + self.Base._Offset.Y)
  2643. self.Divider:Position(323.5 + self.Base._Offset.X + self.Base.ParentMenu.WidthOffset, Y + 153 + self.Base._Offset.Y)
  2644. self.LeftArrow:Position(225 + self.Base._Offset.X + self.Base.ParentMenu.WidthOffset, 150.5 + Y + self.Base._Offset.Y)
  2645. self.RightArrow:Position(400 + self.Base._Offset.X + self.Base.ParentMenu.WidthOffset, 150.5 + Y + self.Base._Offset.Y)
  2646. self.Base:Position(Y)
  2647. end
  2648. end
  2649.  
  2650. function UIMenuSliderItem:Selected(bool)
  2651. if bool ~= nil then
  2652.  
  2653. self.Base._Selected = ToBool(bool)
  2654. else
  2655. return self.Base._Selected
  2656. end
  2657. end
  2658.  
  2659. function UIMenuSliderItem:Hovered(bool)
  2660. if bool ~= nil then
  2661. self.Base._Hovered = ToBool(bool)
  2662. else
  2663. return self.Base._Hovered
  2664. end
  2665. end
  2666.  
  2667. function UIMenuSliderItem:Enabled(bool)
  2668. if bool ~= nil then
  2669. self.Base._Enabled = ToBool(bool)
  2670. else
  2671. return self.Base._Enabled
  2672. end
  2673. end
  2674.  
  2675. function UIMenuSliderItem:Description(str)
  2676. if tostring(str) and str ~= nil then
  2677. self.Base._Description = tostring(str)
  2678. else
  2679. return self.Base._Description
  2680. end
  2681. end
  2682.  
  2683. function UIMenuSliderItem:Offset(X, Y)
  2684. if tonumber(X) or tonumber(Y) then
  2685. if tonumber(X) then self.Base._Offset.X = tonumber(X) end
  2686. if tonumber(Y) then self.Base._Offset.Y = tonumber(Y) end
  2687. else
  2688. return self.Base._Offset
  2689. end
  2690. end
  2691.  
  2692. function UIMenuSliderItem:Text(Text)
  2693. if tostring(Text) and Text ~= nil then
  2694. self.Base.Text:Text(tostring(Text))
  2695. else
  2696. return self.Base.Text:Text()
  2697. end
  2698. end
  2699.  
  2700. function UIMenuSliderItem:Index(Index)
  2701. if tonumber(Index) then
  2702. if tonumber(Index) > #self.Items then
  2703. self._Index = 1
  2704. elseif tonumber(Index) < 1 then
  2705. self._Index = #self.Items
  2706. else
  2707. self._Index = tonumber(Index)
  2708. end
  2709. else
  2710. return self._Index
  2711. end
  2712. end
  2713.  
  2714. function UIMenuSliderItem:ItemToIndex(Item)
  2715. for i = 1, #self.Items do if type(Item) == type(self.Items[i]) and Item == self.Items[i] then return i end end
  2716. end
  2717.  
  2718. function UIMenuSliderItem:IndexToItem(Index)
  2719. if tonumber(Index) then
  2720. if tonumber(Index) == 0 then Index = 1 end
  2721. if self.Items[tonumber(Index)] then return self.Items[tonumber(Index)] end
  2722. end
  2723. end
  2724.  
  2725. function UIMenuSliderItem:SetLeftBadge() error("This item does not support badges") end
  2726.  
  2727. function UIMenuSliderItem:SetRightBadge() error("This item does not support badges") end
  2728.  
  2729. function UIMenuSliderItem:RightLabel() error("This item does not support a right label") end
  2730.  
  2731. function UIMenuSliderItem:Draw()
  2732. self.Base:Draw()
  2733.  
  2734. if self:Enabled() then
  2735. if self:Selected() then
  2736. self.LeftArrow:Colour(0, 0, 0, 255)
  2737. self.RightArrow:Colour(0, 0, 0, 255)
  2738. else
  2739. self.LeftArrow:Colour(245, 245, 245, 255)
  2740. self.RightArrow:Colour(245, 245, 245, 255)
  2741. end
  2742. else
  2743. self.LeftArrow:Colour(163, 159, 148, 255)
  2744. self.RightArrow:Colour(163, 159, 148, 255)
  2745. end
  2746.  
  2747. local Offset = ((self.Background.Width - self.Slider.Width) / (#self.Items - 1)) * (self._Index - 1)
  2748.  
  2749. self.Slider:Position(250 + self.Base._Offset.X + Offset + self.Base.ParentMenu.WidthOffset, self.Slider.Y)
  2750.  
  2751. if self:Selected() then
  2752. self.LeftArrow:Draw()
  2753. self.RightArrow:Draw()
  2754. end
  2755.  
  2756. self.Background:Draw()
  2757. self.Slider:Draw()
  2758. if self.ShowDivider then self.Divider:Draw() end
  2759. end
  2760. end
  2761.  
  2762. --==================================================================================================================================================--
  2763. -- NativeUI\UIMenu\items\UIMenuSliderProgressItem
  2764. --==================================================================================================================================================--
  2765. UIMenuSliderProgressItem = setmetatable({}, UIMenuSliderProgressItem)
  2766. UIMenuSliderProgressItem.__index = UIMenuSliderProgressItem
  2767. UIMenuSliderProgressItem.__call = function() return "UIMenuItem", "UIMenuSliderProgressItem" end
  2768. do
  2769. function UIMenuSliderProgressItem.New(Text, Items, Index, Description, SliderColors, BackgroundSliderColors)
  2770. if type(Items) ~= "table" then Items = {} end
  2771. if Index == 0 then Index = 1 end
  2772. if type(SliderColors) ~= "table" or SliderColors == nil then
  2773. _SliderColors = {R = 57, G = 119, B = 200, A = 255}
  2774. else
  2775. _SliderColors = SliderColors
  2776. end
  2777. if type(BackgroundSliderColors) ~= "table" or BackgroundSliderColors == nil then
  2778. _BackgroundSliderColors = {R = 4, G = 32, B = 57, A = 255}
  2779. else
  2780. _BackgroundSliderColors = BackgroundSliderColors
  2781. end
  2782. local _UIMenuSliderProgressItem = {
  2783. Base = UIMenuItem.New(Text or "", Description or ""),
  2784. Items = Items,
  2785. LeftArrow = Sprite.New("commonmenu", "arrowleft", 0, 105, 25, 25),
  2786. RightArrow = Sprite.New("commonmenu", "arrowright", 0, 105, 25, 25),
  2787. Background = UIResRectangle.New(0, 0, 150, 10, _BackgroundSliderColors.R, _BackgroundSliderColors.G, _BackgroundSliderColors.B,
  2788. _BackgroundSliderColors.A),
  2789. Slider = UIResRectangle.New(0, 0, 75, 10, _SliderColors.R, _SliderColors.G, _SliderColors.B, _SliderColors.A),
  2790. Divider = UIResRectangle.New(0, 0, 4, 20, 255, 255, 255, 255),
  2791. _Index = tonumber(Index) or 1,
  2792. OnSliderChanged = function(menu, item, newindex) end,
  2793. OnSliderSelected = function(menu, item, newindex) end
  2794. }
  2795.  
  2796. local Offset = ((_UIMenuSliderProgressItem.Background.Width) / (#_UIMenuSliderProgressItem.Items - 1)) *
  2797. (_UIMenuSliderProgressItem._Index - 1)
  2798. _UIMenuSliderProgressItem.Slider.Width = Offset
  2799.  
  2800. return setmetatable(_UIMenuSliderProgressItem, UIMenuSliderProgressItem)
  2801. end
  2802.  
  2803. function UIMenuSliderProgressItem:SetParentMenu(Menu)
  2804. if Menu() == "UIMenu" then
  2805. self.Base.ParentMenu = Menu
  2806. else
  2807. return self.Base.ParentMenu
  2808. end
  2809. end
  2810.  
  2811. function UIMenuSliderProgressItem:Position(Y)
  2812. if tonumber(Y) then
  2813. self.Background:Position(250 + self.Base._Offset.X + self.Base.ParentMenu.WidthOffset, Y + 158.5 + self.Base._Offset.Y)
  2814. self.Slider:Position(250 + self.Base._Offset.X + self.Base.ParentMenu.WidthOffset, Y + 158.5 + self.Base._Offset.Y)
  2815. self.Divider:Position(323.5 + self.Base._Offset.X + self.Base.ParentMenu.WidthOffset, Y + 153 + self.Base._Offset.Y)
  2816. self.LeftArrow:Position(225 + self.Base._Offset.X + self.Base.ParentMenu.WidthOffset, 150.5 + Y + self.Base._Offset.Y)
  2817. self.RightArrow:Position(400 + self.Base._Offset.X + self.Base.ParentMenu.WidthOffset, 150.5 + Y + self.Base._Offset.Y)
  2818. self.Base:Position(Y)
  2819. end
  2820. end
  2821.  
  2822. function UIMenuSliderProgressItem:Selected(bool)
  2823. if bool ~= nil then
  2824.  
  2825. self.Base._Selected = ToBool(bool)
  2826. else
  2827. return self.Base._Selected
  2828. end
  2829. end
  2830.  
  2831. function UIMenuSliderProgressItem:Hovered(bool)
  2832. if bool ~= nil then
  2833. self.Base._Hovered = ToBool(bool)
  2834. else
  2835. return self.Base._Hovered
  2836. end
  2837. end
  2838.  
  2839. function UIMenuSliderProgressItem:Enabled(bool)
  2840. if bool ~= nil then
  2841. self.Base._Enabled = ToBool(bool)
  2842. else
  2843. return self.Base._Enabled
  2844. end
  2845. end
  2846.  
  2847. function UIMenuSliderProgressItem:Description(str)
  2848. if tostring(str) and str ~= nil then
  2849. self.Base._Description = tostring(str)
  2850. else
  2851. return self.Base._Description
  2852. end
  2853. end
  2854.  
  2855. function UIMenuSliderProgressItem:Offset(X, Y)
  2856. if tonumber(X) or tonumber(Y) then
  2857. if tonumber(X) then self.Base._Offset.X = tonumber(X) end
  2858. if tonumber(Y) then self.Base._Offset.Y = tonumber(Y) end
  2859. else
  2860. return self.Base._Offset
  2861. end
  2862. end
  2863.  
  2864. function UIMenuSliderProgressItem:Text(Text)
  2865. if tostring(Text) and Text ~= nil then
  2866. self.Base.Text:Text(tostring(Text))
  2867. else
  2868. return self.Base.Text:Text()
  2869. end
  2870. end
  2871.  
  2872. function UIMenuSliderProgressItem:Index(Index)
  2873. if tonumber(Index) then
  2874. if tonumber(Index) > #self.Items then
  2875. self._Index = #self.Items
  2876. elseif tonumber(Index) < 1 then
  2877. self._Index = 1
  2878. else
  2879. self._Index = tonumber(Index)
  2880. end
  2881. else
  2882. local Offset = ((self.Background.Width) / (#self.Items - 1)) * (self._Index - 1)
  2883. self.Slider.Width = Offset
  2884. return self._Index
  2885. end
  2886. end
  2887.  
  2888. function UIMenuSliderProgressItem:ItemToIndex(Item)
  2889. for i = 1, #self.Items do if type(Item) == type(self.Items[i]) and Item == self.Items[i] then return i end end
  2890. end
  2891.  
  2892. function UIMenuSliderProgressItem:IndexToItem(Index)
  2893. if tonumber(Index) then
  2894. if tonumber(Index) == 0 then Index = 1 end
  2895. if self.Items[tonumber(Index)] then return self.Items[tonumber(Index)] end
  2896. end
  2897. end
  2898.  
  2899. function UIMenuSliderProgressItem:SetLeftBadge() error("This item does not support badges") end
  2900.  
  2901. function UIMenuSliderProgressItem:SetRightBadge() error("This item does not support badges") end
  2902.  
  2903. function UIMenuSliderProgressItem:RightLabel() error("This item does not support a right label") end
  2904.  
  2905. function UIMenuSliderProgressItem:Draw()
  2906. self.Base:Draw()
  2907.  
  2908. if self:Enabled() then
  2909. if self:Selected() then
  2910. self.LeftArrow:Colour(0, 0, 0, 255)
  2911. self.RightArrow:Colour(0, 0, 0, 255)
  2912. else
  2913. self.LeftArrow:Colour(245, 245, 245, 255)
  2914. self.RightArrow:Colour(245, 245, 245, 255)
  2915. end
  2916. else
  2917. self.LeftArrow:Colour(163, 159, 148, 255)
  2918. self.RightArrow:Colour(163, 159, 148, 255)
  2919. end
  2920.  
  2921. if self:Selected() then
  2922. self.LeftArrow:Draw()
  2923. self.RightArrow:Draw()
  2924. end
  2925.  
  2926. self.Background:Draw()
  2927. self.Slider:Draw()
  2928. end
  2929. end
  2930.  
  2931. --==================================================================================================================================================--
  2932. -- NativeUI\UIMenu\panels\UIMenuColourPanel
  2933. --==================================================================================================================================================--
  2934. UIMenuColourPanel = setmetatable({}, UIMenuColourPanel)
  2935. UIMenuColourPanel.__index = UIMenuColourPanel
  2936. UIMenuColourPanel.__call = function() return "UIMenuPanel", "UIMenuColourPanel" end
  2937. do
  2938. function UIMenuColourPanel.New(Title, Colours)
  2939. local _UIMenuColourPanel = {
  2940. Data = {
  2941. Pagination = {Min = 1, Max = 8, Total = 8},
  2942. Index = 1000,
  2943. Items = Colours,
  2944. Title = Title or "Title",
  2945. Enabled = true,
  2946. Value = 1
  2947. },
  2948. Background = Sprite.New("commonmenu", "interaction_bgd", 0, 0, 431, 112),
  2949. Bar = {},
  2950. EnableArrow = true,
  2951. LeftArrow = Sprite.New("commonmenu", "arrowleft", 0, 0, 30, 30),
  2952. RightArrow = Sprite.New("commonmenu", "arrowright", 0, 0, 30, 30),
  2953. SelectedRectangle = UIResRectangle.New(0, 0, 44.5, 8),
  2954. Text = UIResText.New(Title .. " [1 / " .. #Colours .. "]" or "Title" .. " [1 / " .. #Colours .. "]", 0, 0, 0.35, 255, 255, 255,
  2955. 255, 0, "Centre"),
  2956. ParentItem = nil
  2957. }
  2958.  
  2959. for Index = 1, #Colours do
  2960. if Index < 10 then
  2961. table.insert(_UIMenuColourPanel.Bar, UIResRectangle.New(0, 0, 44.5, 44.5, table.unpack(Colours[Index])))
  2962. else
  2963. break
  2964. end
  2965. end
  2966.  
  2967. if #_UIMenuColourPanel.Data.Items ~= 0 then
  2968. _UIMenuColourPanel.Data.Index = 1000 - (1000 % #_UIMenuColourPanel.Data.Items)
  2969. _UIMenuColourPanel.Data.Pagination.Max = _UIMenuColourPanel.Data.Pagination.Total + 1
  2970. _UIMenuColourPanel.Data.Pagination.Min = 0
  2971. end
  2972. return setmetatable(_UIMenuColourPanel, UIMenuColourPanel)
  2973. end
  2974.  
  2975. function UIMenuColourPanel:SetParentItem(Item)
  2976. -- required
  2977. if Item() == "UIMenuItem" then
  2978. self.ParentItem = Item
  2979. else
  2980. return self.ParentItem
  2981. end
  2982. end
  2983.  
  2984. function UIMenuColourPanel:Enabled(Enabled)
  2985. if type(Enabled) == "boolean" then
  2986. self.Data.Enabled = Enabled
  2987. else
  2988. return self.Data.Enabled
  2989. end
  2990. end
  2991.  
  2992. function UIMenuColourPanel:Position(Y)
  2993. if tonumber(Y) then
  2994. local ParentOffsetX, ParentOffsetWidth = self.ParentItem:Offset().X, self.ParentItem:SetParentMenu().WidthOffset
  2995. self.Background:Position(ParentOffsetX, Y)
  2996. for Index = 1, #self.Bar do
  2997. self.Bar[Index]:Position(15 + (44.5 * (Index - 1)) + ParentOffsetX + (ParentOffsetWidth / 2), 55 + Y)
  2998. end
  2999. self.SelectedRectangle:Position(15 + (44.5 * ((self:CurrentSelection() - self.Data.Pagination.Min) - 1)) + ParentOffsetX +
  3000. (ParentOffsetWidth / 2), 47 + Y)
  3001. if self.EnableArrow ~= false then
  3002. self.LeftArrow:Position(7.5 + ParentOffsetX + (ParentOffsetWidth / 2), 15 + Y)
  3003. self.RightArrow:Position(393.5 + ParentOffsetX + (ParentOffsetWidth / 2), 15 + Y)
  3004. end
  3005. self.Text:Position(215.5 + ParentOffsetX + (ParentOffsetWidth / 2), 15 + Y)
  3006. end
  3007. end
  3008.  
  3009. function UIMenuColourPanel:CurrentSelection(value, PreventUpdate)
  3010. if tonumber(value) then
  3011. if #self.Data.Items == 0 then self.Data.Index = 0 end
  3012.  
  3013. self.Data.Index = 1000000 - (1000000 % #self.Data.Items) + tonumber(value)
  3014.  
  3015. if self:CurrentSelection() > self.Data.Pagination.Max then
  3016. self.Data.Pagination.Min = self:CurrentSelection() - (self.Data.Pagination.Total + 1)
  3017. self.Data.Pagination.Max = self:CurrentSelection()
  3018. elseif self:CurrentSelection() < self.Data.Pagination.Min then
  3019. self.Data.Pagination.Min = self:CurrentSelection() - 1
  3020. self.Data.Pagination.Max = self:CurrentSelection() + (self.Data.Pagination.Total + 1)
  3021. end
  3022.  
  3023. self:UpdateSelection(PreventUpdate)
  3024. else
  3025. if #self.Data.Items == 0 then
  3026. return 1
  3027. else
  3028. if self.Data.Index % #self.Data.Items == 0 then
  3029. return 1
  3030. else
  3031. return self.Data.Index % #self.Data.Items + 1
  3032. end
  3033. end
  3034. end
  3035. end
  3036.  
  3037. function UIMenuColourPanel:UpdateParent(Colour)
  3038. local _, ParentType = self.ParentItem()
  3039. if ParentType == "UIMenuListItem" then
  3040. local PanelItemIndex = self.ParentItem:FindPanelItem()
  3041. local PanelIndex = self.ParentItem:FindPanelIndex(self)
  3042. if PanelItemIndex then
  3043. self.ParentItem.Items[PanelItemIndex].Value[PanelIndex] = Colour
  3044. self.ParentItem:Index(PanelItemIndex)
  3045. self.ParentItem.Base.ParentMenu.OnListChange(self.ParentItem.Base.ParentMenu, self.ParentItem, self.ParentItem._Index)
  3046. self.ParentItem.OnListChanged(self.ParentItem.Base.ParentMenu, self.ParentItem, self.ParentItem._Index)
  3047. else
  3048. for Index = 1, #self.ParentItem.Items do
  3049. if type(self.ParentItem.Items[Index]) == "table" then
  3050. if not self.ParentItem.Items[Index].Panels then self.ParentItem.Items[Index].Panels = {} end
  3051. self.ParentItem.Items[Index].Panels[PanelIndex] = Colour
  3052. else
  3053. self.ParentItem.Items[Index] = {
  3054. Name = tostring(self.ParentItem.Items[Index]),
  3055. Value = self.ParentItem.Items[Index],
  3056. Panels = {[PanelIndex] = Colour}
  3057. }
  3058. end
  3059. end
  3060. self.ParentItem.Base.ParentMenu.OnListChange(self.ParentItem.Base.ParentMenu, self.ParentItem, self.ParentItem._Index)
  3061. self.ParentItem.OnListChanged(self.ParentItem.Base.ParentMenu, self.ParentItem, self.ParentItem._Index)
  3062. end
  3063. elseif ParentType == "UIMenuItem" then
  3064. self.ParentItem.ActivatedPanel(self.ParentItem.ParentMenu, self.ParentItem, self, Colour)
  3065. end
  3066. end
  3067.  
  3068. function UIMenuColourPanel:UpdateSelection(PreventUpdate)
  3069. local CurrentSelection = self:CurrentSelection()
  3070. if not PreventUpdate then self:UpdateParent(CurrentSelection) end
  3071. self.SelectedRectangle:Position(15 + (44.5 * ((CurrentSelection - self.Data.Pagination.Min) - 1)) + self.ParentItem:Offset().X,
  3072. self.SelectedRectangle.Y)
  3073. for Index = 1, 9 do self.Bar[Index]:Colour(table.unpack(self.Data.Items[self.Data.Pagination.Min + Index])) end
  3074. self.Text:Text(self.Data.Title .. " [" .. CurrentSelection .. " / " .. #self.Data.Items .. "]")
  3075. end
  3076.  
  3077. function UIMenuColourPanel:Functions()
  3078. local DrawOffset = {X = 0, Y = 0}
  3079. if self.ParentItem:SetParentMenu().Settings.ScaleWithSafezone then DrawOffset = self.ParentItem:SetParentMenu().DrawOffset end
  3080.  
  3081. if IsDisabledControlJustPressed(0, 24) or IsDisabledControlJustPressed(0, 174) then self:GoLeft() end
  3082. if IsDisabledControlJustPressed(0, 24) or IsDisabledControlJustPressed(0, 175) then self:GoRight() end
  3083.  
  3084. if IsMouseInBounds(self.LeftArrow.X, self.LeftArrow.Y, self.LeftArrow.Width, self.LeftArrow.Height, DrawOffset) then
  3085. if IsDisabledControlJustPressed(0, 24) then self:GoLeft() end
  3086. end
  3087. if IsMouseInBounds(self.RightArrow.X, self.RightArrow.Y, self.RightArrow.Width, self.RightArrow.Height, DrawOffset) then
  3088. if IsDisabledControlJustPressed(0, 24) then self:GoRight() end
  3089. end
  3090.  
  3091. for Index = 1, #self.Bar do
  3092. if IsMouseInBounds(self.Bar[Index].X, self.Bar[Index].Y, self.Bar[Index].Width, self.Bar[Index].Height, DrawOffset) then
  3093. if IsDisabledControlJustPressed(0, 24) then self:CurrentSelection(self.Data.Pagination.Min + Index - 1) end
  3094. end
  3095. end
  3096. end
  3097.  
  3098. function UIMenuColourPanel:GoLeft()
  3099. if #self.Data.Items > self.Data.Pagination.Total + 1 then
  3100. if self:CurrentSelection() <= self.Data.Pagination.Min + 1 then
  3101. if self:CurrentSelection() == 1 then
  3102. self.Data.Pagination.Min = #self.Data.Items - (self.Data.Pagination.Total + 1)
  3103. self.Data.Pagination.Max = #self.Data.Items
  3104. self.Data.Index = 1000 - (1000 % #self.Data.Items)
  3105. self.Data.Index = self.Data.Index + (#self.Data.Items - 1)
  3106. self:UpdateSelection()
  3107. else
  3108. self.Data.Pagination.Min = self.Data.Pagination.Min - 1
  3109. self.Data.Pagination.Max = self.Data.Pagination.Max - 1
  3110. self.Data.Index = self.Data.Index - 1
  3111. self:UpdateSelection()
  3112. end
  3113. else
  3114. self.Data.Index = self.Data.Index - 1
  3115. self:UpdateSelection()
  3116. end
  3117. else
  3118. self.Data.Index = self.Data.Index - 1
  3119. self:UpdateSelection()
  3120. end
  3121. end
  3122.  
  3123. function UIMenuColourPanel:GoRight()
  3124. if #self.Data.Items > self.Data.Pagination.Total + 1 then
  3125. if self:CurrentSelection() >= self.Data.Pagination.Max then
  3126. if self:CurrentSelection() == #self.Data.Items then
  3127. self.Data.Pagination.Min = 0
  3128. self.Data.Pagination.Max = self.Data.Pagination.Total + 1
  3129. self.Data.Index = 1000 - (1000 % #self.Data.Items)
  3130. self:UpdateSelection()
  3131. else
  3132. self.Data.Pagination.Max = self.Data.Pagination.Max + 1
  3133. self.Data.Pagination.Min = self.Data.Pagination.Max - (self.Data.Pagination.Total + 1)
  3134. self.Data.Index = self.Data.Index + 1
  3135. self:UpdateSelection()
  3136. end
  3137. else
  3138. self.Data.Index = self.Data.Index + 1
  3139. self:UpdateSelection()
  3140. end
  3141. else
  3142. self.Data.Index = self.Data.Index + 1
  3143. self:UpdateSelection()
  3144. end
  3145. end
  3146.  
  3147. function UIMenuColourPanel:Draw()
  3148. if self.Data.Enabled then
  3149. self.Background:Size(431 + self.ParentItem:SetParentMenu().WidthOffset, 112)
  3150. self.Background:Draw()
  3151. if self.EnableArrow ~= false then
  3152. self.LeftArrow:Draw()
  3153. self.RightArrow:Draw()
  3154. end
  3155. self.Text:Draw()
  3156. self.SelectedRectangle:Draw()
  3157. for Index = 1, #self.Bar do self.Bar[Index]:Draw() end
  3158. self:Functions()
  3159. end
  3160. end
  3161. end
  3162.  
  3163. --==================================================================================================================================================--
  3164. -- NativeUI\UIMenu\panels\UIMenuGridPanel
  3165. --==================================================================================================================================================--
  3166. UIMenuGridPanel = setmetatable({}, UIMenuGridPanel)
  3167. UIMenuGridPanel.__index = UIMenuGridPanel
  3168. UIMenuGridPanel.__call = function()
  3169. return "UIMenuPanel", "UIMenuGridPanel"
  3170. end
  3171. do
  3172. function UIMenuGridPanel.New(TopText, LeftText, RightText, BottomText, CirclePositionX, CirclePositionY)
  3173. local _UIMenuGridPanel = {
  3174. Data = {
  3175. Enabled = true,
  3176. },
  3177. Background = Sprite.New("commonmenu", "interaction_bgd", 0, 0, 431, 275),
  3178. Grid = Sprite.New("pause_menu_pages_char_mom_dad", "nose_grid", 0, 0, 200, 200, 0, 255, 255, 255, 255),
  3179. Circle = Sprite.New("mpinventory", "in_world_circle", 0, 0, 20, 20, 0),
  3180. Audio = { Slider = "CONTINUOUS_SLIDER", Library = "HUD_FRONTEND_DEFAULT_SOUNDSET", Id = nil },
  3181. ParentItem = nil,
  3182. Text = {
  3183. Top = UIResText.New(TopText or "Top", 0, 0, 0.35, 255, 255, 255, 255, 0, "Centre"),
  3184. Left = UIResText.New(LeftText or "Left", 0, 0, 0.35, 255, 255, 255, 255, 0, "Centre"),
  3185. Right = UIResText.New(RightText or "Right", 0, 0, 0.35, 255, 255, 255, 255, 0, "Centre"),
  3186. Bottom = UIResText.New(BottomText or "Bottom", 0, 0, 0.35, 255, 255, 255, 255, 0, "Centre"),
  3187. },
  3188. SetCirclePosition = { X = CirclePositionX or 0.5, Y = CirclePositionY or 0.5 }
  3189. }
  3190. return setmetatable(_UIMenuGridPanel, UIMenuGridPanel)
  3191. end
  3192.  
  3193. function UIMenuGridPanel:SetParentItem(Item)
  3194. -- required
  3195. if Item() == "UIMenuItem" then
  3196. self.ParentItem = Item
  3197. else
  3198. return self.ParentItem
  3199. end
  3200. end
  3201.  
  3202. function UIMenuGridPanel:Enabled(Enabled)
  3203. if type(Enabled) == "boolean" then
  3204. self.Data.Enabled = Enabled
  3205. else
  3206. return self.Data.Enabled
  3207. end
  3208. end
  3209.  
  3210. function UIMenuGridPanel:CirclePosition(X, Y)
  3211. if tonumber(X) and tonumber(Y) then
  3212. self.Circle.X = (self.Grid.X + 20) + ((self.Grid.Width - 40) * ((X >= 0.0 and X <= 1.0) and X or 0.0)) - (self.Circle.Width / 2)
  3213. self.Circle.Y = (self.Grid.Y + 20) + ((self.Grid.Height - 40) * ((Y >= 0.0 and Y <= 1.0) and Y or 0.0)) - (self.Circle.Height / 2)
  3214. else
  3215. return math.round((self.Circle.X - (self.Grid.X + 20) + (self.Circle.Width / 2)) / (self.Grid.Width - 40), 2), math.round((self.Circle.Y - (self.Grid.Y + 20) + (self.Circle.Height / 2)) / (self.Grid.Height - 40), 2)
  3216. end
  3217. end
  3218.  
  3219. function UIMenuGridPanel:Position(Y)
  3220. if tonumber(Y) then
  3221. local ParentOffsetX, ParentOffsetWidth = self.ParentItem:Offset().X, self.ParentItem:SetParentMenu().WidthOffset
  3222. self.Background:Position(ParentOffsetX, Y)
  3223. self.Grid:Position(ParentOffsetX + 115.5 + (ParentOffsetWidth / 2), 37.5 + Y)
  3224. self.Text.Top:Position(ParentOffsetX + 215.5 + (ParentOffsetWidth / 2), 5 + Y)
  3225. self.Text.Left:Position(ParentOffsetX + 57.75 + (ParentOffsetWidth / 2), 120 + Y)
  3226. self.Text.Right:Position(ParentOffsetX + 373.25 + (ParentOffsetWidth / 2), 120 + Y)
  3227. self.Text.Bottom:Position(ParentOffsetX + 215.5 + (ParentOffsetWidth / 2), 240 + Y)
  3228. if not self.CircleLocked then
  3229. self.CircleLocked = true
  3230. self:CirclePosition(self.SetCirclePosition.X, self.SetCirclePosition.Y)
  3231. end
  3232. end
  3233. end
  3234.  
  3235. function UIMenuGridPanel:UpdateParent(X, Y)
  3236. local _, ParentType = self.ParentItem()
  3237. self.Data.Value = { X = X, Y = Y }
  3238. if ParentType == "UIMenuListItem" then
  3239. local PanelItemIndex = self.ParentItem:FindPanelItem()
  3240. if PanelItemIndex then
  3241. self.ParentItem.Items[PanelItemIndex].Value[self.ParentItem:FindPanelIndex(self)] = { X = X, Y = Y }
  3242. self.ParentItem:Index(PanelItemIndex)
  3243. self.ParentItem.Base.ParentMenu.OnListChange(self.ParentItem.Base.ParentMenu, self.ParentItem, self.ParentItem._Index)
  3244. self.ParentItem.OnListChanged(self.ParentItem.Base.ParentMenu, self.ParentItem, self.ParentItem._Index)
  3245. else
  3246. local PanelIndex = self.ParentItem:FindPanelIndex(self)
  3247. for Index = 1, #self.ParentItem.Items do
  3248. if type(self.ParentItem.Items[Index]) == "table" then
  3249. if not self.ParentItem.Items[Index].Panels then
  3250. self.ParentItem.Items[Index].Panels = {}
  3251. end
  3252. self.ParentItem.Items[Index].Panels[PanelIndex] = { X = X, Y = Y }
  3253. else
  3254. self.ParentItem.Items[Index] = { Name = tostring(self.ParentItem.Items[Index]), Value = self.ParentItem.Items[Index], Panels = { [PanelIndex] = { X = X, Y = Y } } }
  3255. end
  3256. end
  3257. self.ParentItem.Base.ParentMenu.OnListChange(self.ParentItem.Base.ParentMenu, self.ParentItem, self.ParentItem._Index)
  3258. self.ParentItem.OnListChanged(self.ParentItem.Base.ParentMenu, self.ParentItem, self.ParentItem._Index)
  3259. self.ParentItem.Base.ActivatedPanel(self.ParentItem.ParentMenu, self.ParentItem, self, { X = X, Y = Y })
  3260. end
  3261. elseif ParentType == "UIMenuItem" then
  3262. self.ParentItem.ActivatedPanel(self.ParentItem.ParentMenu, self.ParentItem, self, { X = X, Y = Y })
  3263. end
  3264. end
  3265.  
  3266. function UIMenuGridPanel:Functions()
  3267. local DrawOffset = { X = 0, Y = 0 }
  3268. if self.ParentItem:SetParentMenu().Settings.ScaleWithSafezone then
  3269. DrawOffset = self.ParentItem:SetParentMenu().DrawOffset
  3270. end
  3271. if IsMouseInBounds(self.Grid.X + 20, self.Grid.Y + 20, self.Grid.Width - 40, self.Grid.Height - 40, DrawOffset) then
  3272. if IsDisabledControlJustPressed(0, 24) then
  3273. if not self.Pressed then
  3274. self.Pressed = true
  3275. Citizen.CreateThread(function()
  3276. self.Audio.Id = GetSoundId()
  3277. PlaySoundFrontend(self.Audio.Id, self.Audio.Slider, self.Audio.Library, 1)
  3278. while IsDisabledControlPressed(0, 24) and IsMouseInBounds(self.Grid.X + 20, self.Grid.Y + 20, self.Grid.Width - 40, self.Grid.Height - 40, DrawOffset) do
  3279. Citizen.Wait(0)
  3280. local CursorX, CursorY = ConvertToPixel(GetControlNormal(0, 239) - DrawOffset.X, GetControlNormal(0, 240) - DrawOffset.Y)
  3281. CursorX, CursorY = CursorX - (self.Circle.Width / 2), CursorY - (self.Circle.Height / 2)
  3282. self.Circle:Position(((CursorX > (self.Grid.X + 10 + self.Grid.Width - 40)) and (self.Grid.X + 10 + self.Grid.Width - 40) or ((CursorX < (self.Grid.X + 20 - (self.Circle.Width / 2))) and (self.Grid.X + 20 - (self.Circle.Width / 2)) or CursorX)), ((CursorY > (self.Grid.Y + 10 + self.Grid.Height - 40)) and (self.Grid.Y + 10 + self.Grid.Height - 40) or ((CursorY < (self.Grid.Y + 20 - (self.Circle.Height / 2))) and (self.Grid.Y + 20 - (self.Circle.Height / 2)) or CursorY)))
  3283. end
  3284. StopSound(self.Audio.Id)
  3285. ReleaseSoundId(self.Audio.Id)
  3286. self.Pressed = false
  3287. end)
  3288. Citizen.CreateThread(function()
  3289. while IsDisabledControlPressed(0, 24) and IsMouseInBounds(self.Grid.X + 20, self.Grid.Y + 20, self.Grid.Width - 40, self.Grid.Height - 40, DrawOffset) do
  3290. Citizen.Wait(75)
  3291. local ResultX, ResultY = math.round((self.Circle.X - (self.Grid.X + 20) + (self.Circle.Width / 2)) / (self.Grid.Width - 40), 2), math.round((self.Circle.Y - (self.Grid.Y + 20) + (self.Circle.Height / 2)) / (self.Grid.Height - 40), 2)
  3292.  
  3293. self:UpdateParent((((ResultX >= 0.0 and ResultX <= 1.0) and ResultX or ((ResultX <= 0) and 0.0) or 1.0) * 2) - 1, (((ResultY >= 0.0 and ResultY <= 1.0) and ResultY or ((ResultY <= 0) and 0.0) or 1.0) * 2) - 1)
  3294. end
  3295. end)
  3296. end
  3297. end
  3298. end
  3299. end
  3300.  
  3301. function UIMenuGridPanel:Draw()
  3302. if self.Data.Enabled then
  3303. self.Background:Size(431 + self.ParentItem:SetParentMenu().WidthOffset, 275)
  3304. self.Background:Draw()
  3305. self.Grid:Draw()
  3306. self.Circle:Draw()
  3307. self.Text.Top:Draw()
  3308. self.Text.Left:Draw()
  3309. self.Text.Right:Draw()
  3310. self.Text.Bottom:Draw()
  3311. self:Functions()
  3312. end
  3313. end
  3314. end
  3315.  
  3316. --==================================================================================================================================================--
  3317. -- NativeUI\UIMenu\panels\UIMenuHorizontalOneLineGridPanel
  3318. --==================================================================================================================================================--
  3319. UIMenuHorizontalOneLineGridPanel = setmetatable({}, UIMenuHorizontalOneLineGridPanel)
  3320. UIMenuHorizontalOneLineGridPanel.__index = UIMenuHorizontalOneLineGridPanel
  3321. UIMenuHorizontalOneLineGridPanel.__call = function()
  3322. return "UIMenuPanel", "UIMenuHorizontalOneLineGridPanel"
  3323. end
  3324. do
  3325. function UIMenuHorizontalOneLineGridPanel.New(LeftText, RightText, CirclePositionX)
  3326. local _UIMenuHorizontalOneLineGridPanel = {
  3327. Data = {
  3328. Enabled = true,
  3329. },
  3330. Background = Sprite.New("commonmenu", "interaction_bgd", 0, 0, 431, 275),
  3331. Grid = Sprite.New("NativeUI", "horizontal_grid", 0, 0, 200, 200, 0, 255, 255, 255, 255),
  3332. Circle = Sprite.New("mpinventory", "in_world_circle", 0, 0, 20, 20, 0),
  3333. Audio = { Slider = "CONTINUOUS_SLIDER", Library = "HUD_FRONTEND_DEFAULT_SOUNDSET", Id = nil },
  3334. ParentItem = nil,
  3335. Text = {
  3336. Left = UIResText.New(LeftText or "Left", 0, 0, 0.35, 255, 255, 255, 255, 0, "Centre"),
  3337. Right = UIResText.New(RightText or "Right", 0, 0, 0.35, 255, 255, 255, 255, 0, "Centre"),
  3338. },
  3339. SetCirclePosition = { X = CirclePositionX or 0.5, Y = 0.5 }
  3340. }
  3341. return setmetatable(_UIMenuHorizontalOneLineGridPanel, UIMenuHorizontalOneLineGridPanel)
  3342. end
  3343.  
  3344. function UIMenuHorizontalOneLineGridPanel:SetParentItem(Item)
  3345. -- required
  3346. if Item() == "UIMenuItem" then
  3347. self.ParentItem = Item
  3348. else
  3349. return self.ParentItem
  3350. end
  3351. end
  3352.  
  3353. function UIMenuHorizontalOneLineGridPanel:Enabled(Enabled)
  3354. if type(Enabled) == "boolean" then
  3355. self.Data.Enabled = Enabled
  3356. else
  3357. return self.Data.Enabled
  3358. end
  3359. end
  3360.  
  3361. function UIMenuHorizontalOneLineGridPanel:CirclePosition(X, Y)
  3362. if tonumber(X) and tonumber(Y) then
  3363. self.Circle.X = (self.Grid.X + 20) + ((self.Grid.Width - 40) * ((X >= 0.0 and X <= 1.0) and X or 0.0)) - (self.Circle.Width / 2)
  3364. self.Circle.Y = (self.Grid.Y + 20) + ((self.Grid.Height - 40) * ((Y >= 0.0 and Y <= 1.0) and Y or 0.0)) - (self.Circle.Height / 2)
  3365. else
  3366. return math.round((self.Circle.X - (self.Grid.X + 20) + (self.Circle.Width / 2)) / (self.Grid.Width - 40), 2), math.round((self.Circle.Y - (self.Grid.Y + 10) + (self.Circle.Height / 2)) / (self.Grid.Height - 40), 2)
  3367. end
  3368. end
  3369.  
  3370. function UIMenuHorizontalOneLineGridPanel:Position(Y)
  3371. if tonumber(Y) then
  3372. local ParentOffsetX, ParentOffsetWidth = self.ParentItem:Offset().X, self.ParentItem:SetParentMenu().WidthOffset
  3373. self.Background:Position(ParentOffsetX, Y)
  3374. self.Grid:Position(ParentOffsetX + 115.5 + (ParentOffsetWidth / 2), 37.5 + Y)
  3375. self.Text.Left:Position(ParentOffsetX + 57.75 + (ParentOffsetWidth / 2), 120 + Y)
  3376. self.Text.Right:Position(ParentOffsetX + 373.25 + (ParentOffsetWidth / 2), 120 + Y)
  3377. if not self.CircleLocked then
  3378. self.CircleLocked = true
  3379. self:CirclePosition(self.SetCirclePosition.X, self.SetCirclePosition.Y)
  3380. end
  3381. end
  3382. end
  3383.  
  3384. function UIMenuHorizontalOneLineGridPanel:UpdateParent(X)
  3385. local _, ParentType = self.ParentItem()
  3386. self.Data.Value = { X = X }
  3387. if ParentType == "UIMenuListItem" then
  3388. local PanelItemIndex = self.ParentItem:FindPanelItem()
  3389. if PanelItemIndex then
  3390. self.ParentItem.Items[PanelItemIndex].Value[self.ParentItem:FindPanelIndex(self)] = { X = X }
  3391. self.ParentItem:Index(PanelItemIndex)
  3392. self.ParentItem.Base.ParentMenu.OnListChange(self.ParentItem.Base.ParentMenu, self.ParentItem, self.ParentItem._Index)
  3393. self.ParentItem.OnListChanged(self.ParentItem.Base.ParentMenu, self.ParentItem, self.ParentItem._Index)
  3394. else
  3395. local PanelIndex = self.ParentItem:FindPanelIndex(self)
  3396. for Index = 1, #self.ParentItem.Items do
  3397. if type(self.ParentItem.Items[Index]) == "table" then
  3398. if not self.ParentItem.Items[Index].Panels then
  3399. self.ParentItem.Items[Index].Panels = {}
  3400. end
  3401. self.ParentItem.Items[Index].Panels[PanelIndex] = { X = X }
  3402. else
  3403. self.ParentItem.Items[Index] = { Name = tostring(self.ParentItem.Items[Index]), Value = self.ParentItem.Items[Index], Panels = { [PanelIndex] = { X = X } } }
  3404. end
  3405. end
  3406. self.ParentItem.Base.ParentMenu.OnListChange(self.ParentItem.Base.ParentMenu, self.ParentItem, self.ParentItem._Index)
  3407. self.ParentItem.OnListChanged(self.ParentItem.Base.ParentMenu, self.ParentItem, self.ParentItem._Index)
  3408. self.ParentItem.Base.ActivatedPanel(self.ParentItem.ParentMenu, self.ParentItem, self, { X = X })
  3409. end
  3410. elseif ParentType == "UIMenuItem" then
  3411. self.ParentItem.ActivatedPanel(self.ParentItem.ParentMenu, self.ParentItem, self, { X = X })
  3412. end
  3413. end
  3414.  
  3415. function UIMenuHorizontalOneLineGridPanel:Functions()
  3416. local DrawOffset = { X = 0, Y = 0}
  3417. if self.ParentItem:SetParentMenu().Settings.ScaleWithSafezone then
  3418. DrawOffset = self.ParentItem:SetParentMenu().DrawOffset
  3419. end
  3420. if IsMouseInBounds(self.Grid.X + 20, self.Grid.Y + 20, self.Grid.Width - 40, self.Grid.Height - 40, DrawOffset) then
  3421. if IsDisabledControlJustPressed(0, 24) then
  3422. if not self.Pressed then
  3423. self.Pressed = true
  3424. Citizen.CreateThread(function()
  3425. self.Audio.Id = GetSoundId()
  3426. PlaySoundFrontend(self.Audio.Id, self.Audio.Slider, self.Audio.Library, 1)
  3427. while IsDisabledControlPressed(0, 24) and IsMouseInBounds(self.Grid.X + 20, self.Grid.Y + 20, self.Grid.Width - 10, self.Grid.Height - 10, DrawOffset) do
  3428. Citizen.Wait(0)
  3429. local CursorX, CursorY = ConvertToPixel(GetControlNormal(0, 239) - DrawOffset.X, GetControlNormal(0, 240) - DrawOffset.Y)
  3430. CursorX, CursorY = CursorX - (self.Circle.Width / 2), CursorY - (self.Circle.Height / 2)
  3431. local moveCursorX = (CursorX > (self.Grid.X + 10 + self.Grid.Width - 40)) and (self.Grid.X + 10 + self.Grid.Width - 40) or ((CursorX < (self.Grid.X + 20 - (self.Circle.Width / 2))) and (self.Grid.X + 20 - (self.Circle.Width / 2)) or CursorX)
  3432. local moveCursorY = (CursorY > (self.Grid.Y + 10 + self.Grid.Height - 120)) and (self.Grid.Y + 10 + self.Grid.Height - 120) or ((CursorY < (self.Grid.Y + 100 - (self.Circle.Height / 2))) and (self.Grid.Y + 100 - (self.Circle.Height / 2)) or CursorY)
  3433. self.Circle:Position(moveCursorX, moveCursorY)
  3434. end
  3435. StopSound(self.Audio.Id)
  3436. ReleaseSoundId(self.Audio.Id)
  3437. self.Pressed = false
  3438. end)
  3439. Citizen.CreateThread(function()
  3440. while IsDisabledControlPressed(0, 24) and IsMouseInBounds(self.Grid.X + 20, self.Grid.Y + 20, self.Grid.Width - 40, self.Grid.Height - 40, DrawOffset) do
  3441. Citizen.Wait(75)
  3442. local ResultX = math.round((self.Circle.X - (self.Grid.X + 20) + (self.Circle.Width / 2)) / (self.Grid.Width - 40), 2)
  3443. self:UpdateParent((((ResultX >= 0.0 and ResultX <= 1.0) and ResultX or ((ResultX <= 0) and 0.0) or 1.0) * 2) - 1)
  3444. end
  3445. end)
  3446. end
  3447. end
  3448. end
  3449. end
  3450.  
  3451. function UIMenuHorizontalOneLineGridPanel:Draw()
  3452. if self.Data.Enabled then
  3453. self.Background:Size(431 + self.ParentItem:SetParentMenu().WidthOffset, 275)
  3454. self.Background:Draw()
  3455. self.Grid:Draw()
  3456. self.Circle:Draw()
  3457. self.Text.Left:Draw()
  3458. self.Text.Right:Draw()
  3459. self:Functions()
  3460. end
  3461. end
  3462. end
  3463.  
  3464. --==================================================================================================================================================--
  3465. -- NativeUI\UIMenu\panels\UIMenuPercentagePanel
  3466. --==================================================================================================================================================--
  3467. UIMenuPercentagePanel = setmetatable({}, UIMenuPercentagePanel)
  3468. UIMenuPercentagePanel.__index = UIMenuPercentagePanel
  3469. UIMenuPercentagePanel.__call = function()
  3470. return "UIMenuPanel", "UIMenuPercentagePanel"
  3471. end
  3472. do
  3473. function UIMenuPercentagePanel.New(MinText, MaxText)
  3474. local _UIMenuPercentagePanel = {
  3475. Data = {
  3476. Enabled = true,
  3477. },
  3478. Background = Sprite.New("commonmenu", "interaction_bgd", 0, 0, 431, 76),
  3479. ActiveBar = UIResRectangle.New(0, 0, 413, 10, 245, 245, 245, 255),
  3480. BackgroundBar = UIResRectangle.New(0, 0, 413, 10, 87, 87, 87, 255),
  3481. Text = {
  3482. Min = UIResText.New(MinText or "0%", 0, 0, 0.35, 255, 255, 255, 255, 0, "Centre"),
  3483. Max = UIResText.New("100%", 0, 0, 0.35, 255, 255, 255, 255, 0, "Centre"),
  3484. Title = UIResText.New(MaxText or "Opacity", 0, 0, 0.35, 255, 255, 255, 255, 0, "Centre"),
  3485. },
  3486. Audio = { Slider = "CONTINUOUS_SLIDER", Library = "HUD_FRONTEND_DEFAULT_SOUNDSET", Id = nil },
  3487. ParentItem = nil,
  3488. }
  3489.  
  3490. return setmetatable(_UIMenuPercentagePanel, UIMenuPercentagePanel)
  3491. end
  3492.  
  3493. function UIMenuPercentagePanel:SetParentItem(Item)
  3494. if Item() == "UIMenuItem" then
  3495. self.ParentItem = Item
  3496. else
  3497. return self.ParentItem
  3498. end
  3499. end
  3500.  
  3501. function UIMenuPercentagePanel:Enabled(Enabled)
  3502. if type(Enabled) == "boolean" then
  3503. self.Data.Enabled = Enabled
  3504. else
  3505. return self.Data.Enabled
  3506. end
  3507. end
  3508.  
  3509. function UIMenuPercentagePanel:Position(Y)
  3510. if tonumber(Y) then
  3511. local ParentOffsetX, ParentOffsetWidth = self.ParentItem:Offset().X, self.ParentItem:SetParentMenu().WidthOffset
  3512. self.Background:Position(ParentOffsetX, Y)
  3513. self.ActiveBar:Position(ParentOffsetX + (ParentOffsetWidth / 2) + 9, 50 + Y)
  3514. self.BackgroundBar:Position(ParentOffsetX + (ParentOffsetWidth / 2) + 9, 50 + Y)
  3515. self.Text.Min:Position(ParentOffsetX + (ParentOffsetWidth / 2) + 25, 15 + Y)
  3516. self.Text.Max:Position(ParentOffsetX + (ParentOffsetWidth / 2) + 398, 15 + Y)
  3517. self.Text.Title:Position(ParentOffsetX + (ParentOffsetWidth / 2) + 215.5, 15 + Y)
  3518. end
  3519. end
  3520.  
  3521. function UIMenuPercentagePanel:Percentage(Value)
  3522. if tonumber(Value) then
  3523. local Percent = ((Value < 0.0) and 0.0) or ((Value > 1.0) and 1.0 or Value)
  3524. self.ActiveBar:Size(self.BackgroundBar.Width * Percent, self.ActiveBar.Height)
  3525. else
  3526. local DrawOffset = { X = 0, Y = 0}
  3527. if self.ParentItem:SetParentMenu().Settings.ScaleWithSafezone then
  3528. DrawOffset = self.ParentItem:SetParentMenu().DrawOffset
  3529. end
  3530.  
  3531. local W, H = GetResolution()
  3532. local Progress = (math.round((GetControlNormal(0, 239) - DrawOffset.X) * W)) - self.ActiveBar.X
  3533. return math.round(((Progress >= 0 and Progress <= 413) and Progress or ((Progress < 0) and 0 or 413)) / self.BackgroundBar.Width, 2)
  3534. end
  3535. end
  3536.  
  3537. function UIMenuPercentagePanel:UpdateParent(Percentage)
  3538. local _, ParentType = self.ParentItem()
  3539. if ParentType == "UIMenuListItem" then
  3540. local PanelItemIndex = self.ParentItem:FindPanelItem()
  3541. if PanelItemIndex then
  3542. self.ParentItem.Items[PanelItemIndex].Value[self.ParentItem:FindPanelIndex(self)] = Percentage
  3543. self.ParentItem:Index(PanelItemIndex)
  3544. self.ParentItem.Base.ParentMenu.OnListChange(self.ParentItem.Base.ParentMenu, self.ParentItem, self.ParentItem._Index)
  3545. self.ParentItem.OnListChanged(self.ParentItem.Base.ParentMenu, self.ParentItem, self.ParentItem._Index)
  3546. else
  3547. local PanelIndex = self.ParentItem:FindPanelIndex(self)
  3548. for Index = 1, #self.ParentItem.Items do
  3549. if type(self.ParentItem.Items[Index]) == "table" then
  3550. if not self.ParentItem.Items[Index].Panels then
  3551. self.ParentItem.Items[Index].Panels = {}
  3552. end
  3553. self.ParentItem.Items[Index].Panels[PanelIndex] = Percentage
  3554. else
  3555. self.ParentItem.Items[Index] = { Name = tostring(self.ParentItem.Items[Index]), Value = self.ParentItem.Items[Index], Panels = { [PanelIndex] = Percentage } }
  3556. end
  3557. end
  3558. self.ParentItem.Base.ParentMenu.OnListChange(self.ParentItem.Base.ParentMenu, self.ParentItem, self.ParentItem._Index)
  3559. self.ParentItem.OnListChanged(self.ParentItem.Base.ParentMenu, self.ParentItem, self.ParentItem._Index)
  3560. end
  3561. elseif ParentType == "UIMenuItem" then
  3562. self.ParentItem.ActivatedPanel(self.ParentItem.ParentMenu, self.ParentItem, self, Percentage)
  3563. end
  3564. end
  3565.  
  3566. function UIMenuPercentagePanel:Functions()
  3567. local DrawOffset = { X = 0, Y = 0}
  3568. if self.ParentItem:SetParentMenu().Settings.ScaleWithSafezone then
  3569. DrawOffset = self.ParentItem:SetParentMenu().DrawOffset
  3570. end
  3571. if IsMouseInBounds(self.BackgroundBar.X, self.BackgroundBar.Y - 4, self.BackgroundBar.Width, self.BackgroundBar.Height + 8, DrawOffset) then
  3572. if IsDisabledControlJustPressed(0, 24) then
  3573. if not self.Pressed then
  3574. self.Pressed = true
  3575. Citizen.CreateThread(function()
  3576. self.Audio.Id = GetSoundId()
  3577. PlaySoundFrontend(self.Audio.Id, self.Audio.Slider, self.Audio.Library, 1)
  3578. while IsDisabledControlPressed(0, 24) and IsMouseInBounds(self.BackgroundBar.X, self.BackgroundBar.Y - 4, self.BackgroundBar.Width, self.BackgroundBar.Height + 8, DrawOffset) do
  3579. Citizen.Wait(0)
  3580. local Progress, ProgressY = ConvertToPixel(GetControlNormal(0, 239) - DrawOffset.X, 0)
  3581. Progress = Progress - self.ActiveBar.X
  3582. self.ActiveBar:Size(((Progress >= 0 and Progress <= 413) and Progress or ((Progress < 0) and 0 or 413)), self.ActiveBar.Height)
  3583. end
  3584. StopSound(self.Audio.Id)
  3585. ReleaseSoundId(self.Audio.Id)
  3586. self.Pressed = false
  3587. end)
  3588. Citizen.CreateThread(function()
  3589. while IsDisabledControlPressed(0, 24) and IsMouseInBounds(self.BackgroundBar.X, self.BackgroundBar.Y - 4, self.BackgroundBar.Width, self.BackgroundBar.Height + 8, DrawOffset) do
  3590. Citizen.Wait(75)
  3591. local Progress, ProgressY = ConvertToPixel(GetControlNormal(0, 239) - DrawOffset.X, 0)
  3592. Progress = Progress - self.ActiveBar.X
  3593. self:UpdateParent(math.round(((Progress >= 0 and Progress <= 413) and Progress or ((Progress < 0) and 0 or 413)) / self.BackgroundBar.Width, 2))
  3594. end
  3595. end)
  3596. end
  3597. end
  3598. end
  3599. end
  3600.  
  3601. function UIMenuPercentagePanel:Draw()
  3602. if self.Data.Enabled then
  3603. self.Background:Size(431 + self.ParentItem:SetParentMenu().WidthOffset, 76)
  3604. self.Background:Draw()
  3605. self.BackgroundBar:Draw()
  3606. self.ActiveBar:Draw()
  3607. self.Text.Min:Draw()
  3608. self.Text.Max:Draw()
  3609. self.Text.Title:Draw()
  3610. self:Functions()
  3611. end
  3612. end
  3613. end
  3614.  
  3615. --==================================================================================================================================================--
  3616. -- NativeUI\UIMenu\panels\UIMenuStatisticsPanel
  3617. --==================================================================================================================================================--
  3618. UIMenuStatisticsPanel = setmetatable({}, UIMenuStatisticsPanel)
  3619. UIMenuStatisticsPanel.__index = UIMenuStatisticsPanel
  3620. UIMenuStatisticsPanel.__call = function() return "UIMenuPanel", "UIMenuStatisticsPanel" end
  3621. do
  3622. function UIMenuStatisticsPanel.New()
  3623. local _UIMenuStatisticsPanel = {
  3624. Background = UIResRectangle.New(0, 0, 431, 47, 0, 0, 0, 170),
  3625. Divider = true,
  3626. ParentItem = nil,
  3627. Items = {}
  3628. }
  3629. return setmetatable(_UIMenuStatisticsPanel, UIMenuStatisticsPanel)
  3630. end
  3631.  
  3632. function UIMenuStatisticsPanel:AddStatistics(Name)
  3633. local Items = {
  3634. Text = UIResText.New(Name or "", 0, 0, 0.35, 255, 255, 255, 255, 0, "Left"),
  3635. BackgroundProgressBar = UIResRectangle.New(0, 0, 200, 10, 255, 255, 255, 100),
  3636. ProgressBar = UIResRectangle.New(0, 0, 100, 10, 255, 255, 255, 255),
  3637. Divider = {
  3638. [1] = UIResRectangle.New(0, 0, 2, 10, 0, 0, 0, 255),
  3639. [2] = UIResRectangle.New(0, 0, 2, 10, 0, 0, 0, 255),
  3640. [3] = UIResRectangle.New(0, 0, 2, 10, 0, 0, 0, 255),
  3641. [4] = UIResRectangle.New(0, 0, 2, 10, 0, 0, 0, 255),
  3642. [5] = UIResRectangle.New(0, 0, 2, 10, 0, 0, 0, 255)
  3643. }
  3644. }
  3645. table.insert(self.Items, Items)
  3646. end
  3647.  
  3648. function UIMenuStatisticsPanel:SetParentItem(Item)
  3649. if Item() == "UIMenuItem" then
  3650. self.ParentItem = Item
  3651. else
  3652. return self.ParentItem
  3653. end
  3654. end
  3655.  
  3656. function UIMenuStatisticsPanel:SetPercentage(ItemID, Number)
  3657. if ItemID ~= nil then
  3658. if Number <= 0 then
  3659. self.Items[ItemID].ProgressBar.Width = 0
  3660. else
  3661. if Number <= 100 then
  3662. self.Items[ItemID].ProgressBar.Width = Number * 2.0
  3663. else
  3664. self.Items[ItemID].ProgressBar.Width = 100 * 2.0
  3665. end
  3666. end
  3667. else
  3668. error("Missing arguments, ItemID")
  3669. end
  3670. end
  3671.  
  3672. function UIMenuStatisticsPanel:GetPercentage(ItemID)
  3673. if ItemID ~= nil then
  3674. return self.Items[ItemID].ProgressBar.Width * 2.0
  3675. else
  3676. error("Missing arguments, ItemID")
  3677. end
  3678. end
  3679.  
  3680. function UIMenuStatisticsPanel:Position(Y)
  3681. if tonumber(Y) then
  3682. local ParentOffsetX, ParentOffsetWidth = self.ParentItem:Offset().X, self.ParentItem:SetParentMenu().WidthOffset
  3683. self.Background:Position(ParentOffsetX, Y)
  3684. for i = 1, #self.Items do
  3685. local OffsetItemCount = 40 * i
  3686. self.Items[i].Text:Position(ParentOffsetX + (ParentOffsetWidth / 2) + 13, Y - 34 + OffsetItemCount)
  3687. self.Items[i].BackgroundProgressBar:Position(ParentOffsetX + (ParentOffsetWidth / 2) + 200, Y - 22 + OffsetItemCount)
  3688. self.Items[i].ProgressBar:Position(ParentOffsetX + (ParentOffsetWidth / 2) + 200, Y - 22 + OffsetItemCount)
  3689. if self.Divider ~= false then
  3690. for _ = 1, #self.Items[i].Divider, 1 do
  3691. local DividerOffsetWidth = _ * 40
  3692. self.Items[i].Divider[_]:Position(ParentOffsetX + (ParentOffsetWidth / 2) + 200 + DividerOffsetWidth,
  3693. Y - 22 + OffsetItemCount)
  3694. self.Background:Size(431 + self.ParentItem:SetParentMenu().WidthOffset, 47 + OffsetItemCount - 39)
  3695. end
  3696. end
  3697. end
  3698. end
  3699. end
  3700.  
  3701. function UIMenuStatisticsPanel:Draw()
  3702. self.Background:Draw()
  3703. for i = 1, #self.Items do
  3704. self.Items[i].Text:Draw()
  3705. self.Items[i].BackgroundProgressBar:Draw()
  3706. self.Items[i].ProgressBar:Draw()
  3707. for _ = 1, #self.Items[i].Divider do self.Items[i].Divider[_]:Draw() end
  3708. end
  3709. end
  3710. end
  3711.  
  3712. --==================================================================================================================================================--
  3713. -- NativeUI\UIMenu\panels\UIMenuVerticalOneLineGridPanel
  3714. --==================================================================================================================================================--
  3715. UIMenuVerticalOneLineGridPanel = setmetatable({}, UIMenuVerticalOneLineGridPanel)
  3716. UIMenuVerticalOneLineGridPanel.__index = UIMenuVerticalOneLineGridPanel
  3717. UIMenuVerticalOneLineGridPanel.__call = function()
  3718. return "UIMenuPanel", "UIMenuVerticalOneLineGridPanel"
  3719. end
  3720. do
  3721. function UIMenuVerticalOneLineGridPanel.New(TopText, BottomText, CirclePositionY)
  3722. local _UIMenuVerticalOneLineGridPanel = {
  3723. Data = {
  3724. Enabled = true,
  3725. },
  3726. Background = Sprite.New("commonmenu", "interaction_bgd", 0, 0, 431, 275),
  3727. Grid = Sprite.New("NativeUI", "vertical_grid", 0, 0, 200, 200, 0, 255, 255, 255, 255),
  3728. Circle = Sprite.New("mpinventory", "in_world_circle", 0, 0, 20, 20, 0),
  3729. Audio = { Slider = "CONTINUOUS_SLIDER", Library = "HUD_FRONTEND_DEFAULT_SOUNDSET", Id = nil },
  3730. ParentItem = nil,
  3731. Text = {
  3732. Top = UIResText.New(TopText or "Top", 0, 0, 0.35, 255, 255, 255, 255, 0, "Centre"),
  3733. Bottom = UIResText.New(BottomText or "Bottom", 0, 0, 0.35, 255, 255, 255, 255, 0, "Centre"),
  3734. },
  3735. SetCirclePosition = { X = 0.5, Y = CirclePositionY or 0.5 }
  3736. }
  3737. return setmetatable(_UIMenuVerticalOneLineGridPanel, UIMenuVerticalOneLineGridPanel)
  3738. end
  3739.  
  3740. function UIMenuVerticalOneLineGridPanel:SetParentItem(Item)
  3741. if Item() == "UIMenuItem" then
  3742. self.ParentItem = Item
  3743. else
  3744. return self.ParentItem
  3745. end
  3746. end
  3747.  
  3748. function UIMenuVerticalOneLineGridPanel:Enabled(Enabled)
  3749. if type(Enabled) == "boolean" then
  3750. self.Data.Enabled = Enabled
  3751. else
  3752. return self.Data.Enabled
  3753. end
  3754. end
  3755.  
  3756. function UIMenuVerticalOneLineGridPanel:CirclePosition(X, Y)
  3757. if tonumber(X) and tonumber(Y) then
  3758. self.Circle.X = (self.Grid.X + 20) + ((self.Grid.Width - 40) * ((X >= 0.0 and X <= 1.0) and X or 0.0)) - (self.Circle.Width / 2)
  3759. self.Circle.Y = (self.Grid.Y + 20) + ((self.Grid.Height - 40) * ((Y >= 0.0 and Y <= 1.0) and Y or 0.0)) - (self.Circle.Height / 2)
  3760. else
  3761. return math.round((self.Circle.X - (self.Grid.X + 20) + (self.Circle.Width / 2)) / (self.Grid.Width - 40), 2), math.round((self.Circle.Y - (self.Grid.Y + 20) + (self.Circle.Height / 2)) / (self.Grid.Height - 40), 2)
  3762. end
  3763. end
  3764.  
  3765. function UIMenuVerticalOneLineGridPanel:Position(Y)
  3766. if tonumber(Y) then
  3767. local ParentOffsetX, ParentOffsetWidth = self.ParentItem:Offset().X, self.ParentItem:SetParentMenu().WidthOffset
  3768. self.Background:Position(ParentOffsetX, Y)
  3769. self.Grid:Position(ParentOffsetX + 115.5 + (ParentOffsetWidth / 2), 37.5 + Y)
  3770. self.Text.Top:Position(ParentOffsetX + 215.5 + (ParentOffsetWidth / 2), 5 + Y)
  3771. self.Text.Bottom:Position(ParentOffsetX + 215.5 + (ParentOffsetWidth / 2), 240 + Y)
  3772. if not self.CircleLocked then
  3773. self.CircleLocked = true
  3774. self:CirclePosition(self.SetCirclePosition.X, self.SetCirclePosition.Y)
  3775. end
  3776. end
  3777. end
  3778.  
  3779. function UIMenuVerticalOneLineGridPanel:UpdateParent(Y)
  3780. local _, ParentType = self.ParentItem()
  3781. self.Data.Value = { Y = Y }
  3782. if ParentType == "UIMenuListItem" then
  3783. local PanelItemIndex = self.ParentItem:FindPanelItem()
  3784. if PanelItemIndex then
  3785. self.ParentItem.Items[PanelItemIndex].Value[self.ParentItem:FindPanelIndex(self)] = { Y = Y }
  3786. self.ParentItem:Index(PanelItemIndex)
  3787. self.ParentItem.Base.ParentMenu.OnListChange(self.ParentItem.Base.ParentMenu, self.ParentItem, self.ParentItem._Index)
  3788. self.ParentItem.OnListChanged(self.ParentItem.Base.ParentMenu, self.ParentItem, self.ParentItem._Index)
  3789. else
  3790. local PanelIndex = self.ParentItem:FindPanelIndex(self)
  3791. for Index = 1, #self.ParentItem.Items do
  3792. if type(self.ParentItem.Items[Index]) == "table" then
  3793. if not self.ParentItem.Items[Index].Panels then
  3794. self.ParentItem.Items[Index].Panels = {}
  3795. end
  3796. self.ParentItem.Items[Index].Panels[PanelIndex] = { Y = Y }
  3797. else
  3798. self.ParentItem.Items[Index] = { Name = tostring(self.ParentItem.Items[Index]), Value = self.ParentItem.Items[Index], Panels = { [PanelIndex] = { Y = Y } } }
  3799. end
  3800. end
  3801. self.ParentItem.Base.ParentMenu.OnListChange(self.ParentItem.Base.ParentMenu, self.ParentItem, self.ParentItem._Index)
  3802. self.ParentItem.OnListChanged(self.ParentItem.Base.ParentMenu, self.ParentItem, self.ParentItem._Index)
  3803. self.ParentItem.Base.ActivatedPanel(self.ParentItem.ParentMenu, self.ParentItem, self, { Y = Y })
  3804. end
  3805. elseif ParentType == "UIMenuItem" then
  3806. self.ParentItem.ActivatedPanel(self.ParentItem.ParentMenu, self.ParentItem, self, { Y = Y })
  3807. end
  3808. end
  3809.  
  3810. function UIMenuVerticalOneLineGridPanel:Functions()
  3811. local DrawOffset = { X = 0, Y = 0}
  3812. if self.ParentItem:SetParentMenu().Settings.ScaleWithSafezone then
  3813. DrawOffset = self.ParentItem:SetParentMenu().DrawOffset
  3814. end
  3815.  
  3816. if IsMouseInBounds(self.Grid.X + 20, self.Grid.Y + 20, self.Grid.Width - 40, self.Grid.Height - 40, DrawOffset) then
  3817. if IsDisabledControlJustPressed(0, 24) then
  3818. if not self.Pressed then
  3819. self.Pressed = true
  3820. Citizen.CreateThread(function()
  3821. self.Audio.Id = GetSoundId()
  3822. PlaySoundFrontend(self.Audio.Id, self.Audio.Slider, self.Audio.Library, 1)
  3823. while IsDisabledControlPressed(0, 24) and IsMouseInBounds(self.Grid.X + 20, self.Grid.Y + 20, self.Grid.Width - 40, self.Grid.Height - 40, DrawOffset) do
  3824. Citizen.Wait(0)
  3825. local CursorX, CursorY = ConvertToPixel(GetControlNormal(0, 239) - DrawOffset.X, GetControlNormal(0, 240) - DrawOffset.Y)
  3826. CursorX, CursorY = CursorX - (self.Circle.Width / 2), CursorY - (self.Circle.Height / 2)
  3827. local moveCursorX = ((CursorX > (self.Grid.X + 10 + self.Grid.Width - 120)) and (self.Grid.X + 10 + self.Grid.Width - 120) or ((CursorX < (self.Grid.X + 100 - (self.Circle.Width / 2))) and (self.Grid.X + 100 - (self.Circle.Width / 2)) or CursorX))
  3828. local moveCursorY = ((CursorY > (self.Grid.Y + 10 + self.Grid.Height - 40)) and (self.Grid.Y + 10 + self.Grid.Height - 40) or ((CursorY < (self.Grid.Y + 20 - (self.Circle.Height / 2))) and (self.Grid.Y + 20 - (self.Circle.Height / 2)) or CursorY))
  3829. self.Circle:Position(moveCursorX, moveCursorY)
  3830. end
  3831. StopSound(self.Audio.Id)
  3832. ReleaseSoundId(self.Audio.Id)
  3833. self.Pressed = false
  3834. end)
  3835. Citizen.CreateThread(function()
  3836. while IsDisabledControlPressed(0, 24) and IsMouseInBounds(self.Grid.X + 20, self.Grid.Y + 20, self.Grid.Width - 40, self.Grid.Height - 40, DrawOffset) do
  3837. Citizen.Wait(75)
  3838. local ResultY = math.round((self.Circle.Y - (self.Grid.Y + 20) + (self.Circle.Height / 2)) / (self.Grid.Height - 40), 2)
  3839. self:UpdateParent((((ResultY >= 0.0 and ResultY <= 1.0) and ResultY or ((ResultY <= 0) and 0.0) or 1.0) * 2) - 1)
  3840. end
  3841. end)
  3842. end
  3843. end
  3844. end
  3845. end
  3846.  
  3847. function UIMenuVerticalOneLineGridPanel:Draw()
  3848. if self.Data.Enabled then
  3849. self.Background:Size(431 + self.ParentItem:SetParentMenu().WidthOffset, 275)
  3850. self.Background:Draw()
  3851. self.Grid:Draw()
  3852. self.Circle:Draw()
  3853. self.Text.Top:Draw()
  3854. self.Text.Bottom:Draw()
  3855. self:Functions()
  3856. end
  3857. end
  3858. end
  3859.  
  3860. --==================================================================================================================================================--
  3861. -- NativeUI\UIMenu\winows\UIMenuHeritageWindow
  3862. --==================================================================================================================================================--
  3863. UIMenuHeritageWindow = setmetatable({}, UIMenuHeritageWindow)
  3864. UIMenuHeritageWindow.__index = UIMenuHeritageWindow
  3865. UIMenuHeritageWindow.__call = function() return "UIMenuWindow", "UIMenuHeritageWindow" end
  3866. do
  3867. function UIMenuHeritageWindow.New(Mum, Dad)
  3868. if not tonumber(Mum) then Mum = 0 end
  3869. if not (Mum >= 0 and Mum <= 21) then Mum = 0 end
  3870. if not tonumber(Dad) then Dad = 0 end
  3871. if not (Dad >= 0 and Dad <= 23) then Dad = 0 end
  3872. local _UIMenuHeritageWindow = {
  3873. Background = Sprite.New("pause_menu_pages_char_mom_dad", "mumdadbg", 0, 0, 431, 228), -- Background is required, must be a sprite or a rectangle.
  3874. MumSprite = Sprite.New("char_creator_portraits", ((Mum < 21) and "female_" .. Mum or "special_female_" .. (tonumber(string.sub(Mum, 2, 2)) - 1)), 0, 0, 228, 228),
  3875. DadSprite = Sprite.New("char_creator_portraits", ((Dad < 21) and "male_" .. Dad or "special_male_" .. (tonumber(string.sub(Dad, 2, 2)) - 1)), 0, 0, 228, 228),
  3876. Mum = Mum,
  3877. Dad = Dad,
  3878. _Offset = {X = 0, Y = 0},
  3879. ParentMenu = nil
  3880. }
  3881. return setmetatable(_UIMenuHeritageWindow, UIMenuHeritageWindow)
  3882. end
  3883.  
  3884. function UIMenuHeritageWindow:SetParentMenu(Menu)
  3885. -- required
  3886. if Menu() == "UIMenu" then
  3887. self.ParentMenu = Menu
  3888. else
  3889. return self.ParentMenu
  3890. end
  3891. end
  3892.  
  3893. function UIMenuHeritageWindow:Offset(X, Y)
  3894. if tonumber(X) or tonumber(Y) then
  3895. if tonumber(X) then self._Offset.X = tonumber(X) end
  3896. if tonumber(Y) then self._Offset.Y = tonumber(Y) end
  3897. else
  3898. return self._Offset
  3899. end
  3900. end
  3901.  
  3902. function UIMenuHeritageWindow:Position(Y)
  3903. if tonumber(Y) then
  3904. self.Background:Position(self._Offset.X, 144 + Y + self._Offset.Y)
  3905. self.MumSprite:Position(self._Offset.X + (self.ParentMenu.WidthOffset / 2) + 25, 144 + Y + self._Offset.Y)
  3906. self.DadSprite:Position(self._Offset.X + (self.ParentMenu.WidthOffset / 2) + 195, 144 + Y + self._Offset.Y)
  3907. end
  3908. end
  3909.  
  3910. function UIMenuHeritageWindow:Index(Mum, Dad)
  3911. if not tonumber(Mum) then Mum = self.Mum end
  3912. if not (Mum >= 0 and Mum <= 21) then Mum = self.Mum end
  3913. if not tonumber(Dad) then Dad = self.Dad end
  3914. if not (Dad >= 0 and Dad <= 23) then Dad = self.Dad end
  3915. self.Mum = Mum
  3916. self.Dad = Dad
  3917. self.MumSprite.TxtName = ((self.Mum < 21) and "female_" .. self.Mum or "special_female_" .. (tonumber(string.sub(Mum, 2, 2)) - 1))
  3918. self.DadSprite.TxtName = ((self.Dad < 21) and "male_" .. self.Dad or "special_male_" .. (tonumber(string.sub(Dad, 2, 2)) - 1))
  3919. end
  3920.  
  3921. function UIMenuHeritageWindow:Draw()
  3922. self.Background:Size(431 + self.ParentMenu.WidthOffset, 228)
  3923. self.Background:Draw()
  3924. self.DadSprite:Draw()
  3925. self.MumSprite:Draw()
  3926. end
  3927. end
  3928.  
  3929. --==================================================================================================================================================--
  3930. -- NativeUI\UIMenu
  3931. --==================================================================================================================================================--
  3932. UIMenu = setmetatable({}, UIMenu)
  3933. UIMenu.__index = UIMenu
  3934. UIMenu.__call = function() return "UIMenu" end
  3935. do
  3936. function UIMenu.New(Title, Subtitle, X, Y, TxtDictionary, TxtName, Heading, R, G, B, A)
  3937. X, Y = tonumber(X) or 0, tonumber(Y) or 0
  3938. if Title ~= nil then
  3939. Title = tostring(Title) or ""
  3940. else
  3941. Title = ""
  3942. end
  3943. if Subtitle ~= nil then
  3944. Subtitle = tostring(Subtitle) or ""
  3945. else
  3946. Subtitle = ""
  3947. end
  3948. if TxtDictionary ~= nil then
  3949. TxtDictionary = tostring(TxtDictionary) or "commonmenu"
  3950. else
  3951. TxtDictionary = "commonmenu"
  3952. end
  3953. if TxtName ~= nil then
  3954. TxtName = tostring(TxtName) or "interaction_bgd"
  3955. else
  3956. TxtName = "interaction_bgd"
  3957. end
  3958. if Heading ~= nil then
  3959. Heading = tonumber(Heading) or 0
  3960. else
  3961. Heading = 0
  3962. end
  3963. if R ~= nil then
  3964. R = tonumber(R) or 255
  3965. else
  3966. R = 255
  3967. end
  3968. if G ~= nil then
  3969. G = tonumber(G) or 255
  3970. else
  3971. G = 255
  3972. end
  3973. if B ~= nil then
  3974. B = tonumber(B) or 255
  3975. else
  3976. B = 255
  3977. end
  3978. if A ~= nil then
  3979. A = tonumber(A) or 255
  3980. else
  3981. A = 255
  3982. end
  3983.  
  3984. local _UIMenu = {
  3985. Logo = Sprite.New(TxtDictionary, TxtName, 0 + X, 0 + Y, 110, 107, Heading, R, G, B, A),
  3986. Banner = nil,
  3987. Title = UIResText.New(Title, 215 + X, 20 + Y, 1.15, 255, 0, 0, 255, 1, 1, 0),
  3988. BetterSize = true,
  3989. Subtitle = {ExtraY = 0},
  3990. WidthOffset = 0,
  3991. Position = {X = X, Y = Y},
  3992. DrawOffset = {X = 0, Y = 0},
  3993. Pagination = {Min = 0, Max = 10, Total = 9},
  3994. PageCounter = {isCustom = false, PreText = ""},
  3995. Extra = {},
  3996. Description = {},
  3997. Items = {},
  3998. Windows = {},
  3999. Children = {},
  4000. Controls = {
  4001. Back = {Enabled = true},
  4002. Select = {Enabled = true},
  4003. Left = {Enabled = true},
  4004. Right = {Enabled = true},
  4005. Up = {Enabled = true},
  4006. Down = {Enabled = true}
  4007. },
  4008. ParentMenu = nil,
  4009. ParentItem = nil,
  4010. _Visible = false,
  4011. ActiveItem = 1000,
  4012. Dirty = false,
  4013. ReDraw = true,
  4014. InstructionalScaleform = RequestScaleformMovie("INSTRUCTIONAL_BUTTONS"),
  4015. InstructionalButtons = {},
  4016. OnIndexChange = function(menu, newindex) end,
  4017. OnListChange = function(menu, list, newindex) end,
  4018. OnSliderChange = function(menu, slider, newindex) end,
  4019. OnProgressChange = function(menu, progress, newindex) end,
  4020. OnCheckboxChange = function(menu, item, checked) end,
  4021. OnListSelect = function(menu, list, index) end,
  4022. OnSliderSelect = function(menu, slider, index) end,
  4023. OnProgressSelect = function(menu, progress, index) end,
  4024. OnItemSelect = function(menu, item, index) end,
  4025. OnMenuChanged = function(menu, newmenu, forward) end,
  4026. OnMenuClosed = function(menu) end,
  4027. Settings = {
  4028. InstructionalButtons = true,
  4029. MultilineFormats = true,
  4030. ScaleWithSafezone = true,
  4031. ResetCursorOnOpen = true,
  4032. MouseControlsEnabled = true,
  4033. MouseEdgeEnabled = true,
  4034. ControlDisablingEnabled = true,
  4035. DrawOrder = nil,
  4036. Audio = {
  4037. Library = "HUD_FRONTEND_DEFAULT_SOUNDSET",
  4038. UpDown = "NAV_UP_DOWN",
  4039. LeftRight = "NAV_LEFT_RIGHT",
  4040. Select = "SELECT",
  4041. Back = "BACK",
  4042. Error = "ERROR"
  4043. },
  4044. EnabledControls = {
  4045. Controller = {
  4046. {0, 2}, -- Look Up and Down
  4047. {0, 1}, -- Look Left and Right
  4048. {0, 25}, -- Aim
  4049. {0, 24} -- Attack
  4050. },
  4051. Keyboard = {
  4052. {0, 201}, -- Select
  4053. {0, 195}, -- X axis
  4054. {0, 196}, -- Y axis
  4055. {0, 187}, -- Down
  4056. {0, 188}, -- Up
  4057. {0, 189}, -- Left
  4058. {0, 190}, -- Right
  4059. {0, 202}, -- Back
  4060. {0, 217}, -- Select
  4061. {0, 242}, -- Scroll down
  4062. {0, 241}, -- Scroll up
  4063. {0, 239}, -- Cursor X
  4064. {0, 240}, -- Cursor Y
  4065. {0, 31}, -- Move Up and Down
  4066. {0, 30}, -- Move Left and Right
  4067. {0, 21}, -- Sprint
  4068. {0, 22}, -- Jump
  4069. {0, 23}, -- Enter
  4070. {0, 75}, -- Exit Vehicle
  4071. {0, 71}, -- Accelerate Vehicle
  4072. {0, 72}, -- Vehicle Brake
  4073. {0, 59}, -- Move Vehicle Left and Right
  4074. {0, 89}, -- Fly Yaw Left
  4075. {0, 9}, -- Fly Left and Right
  4076. {0, 8}, -- Fly Up and Down
  4077. {0, 90}, -- Fly Yaw Right
  4078. {0, 76} -- Vehicle Handbrake
  4079. }
  4080. }
  4081. }
  4082. }
  4083.  
  4084. if Subtitle ~= "" and Subtitle ~= nil then
  4085. _UIMenu.Subtitle.Rectangle = UIResRectangle.New(0 + _UIMenu.Position.X, 107 + _UIMenu.Position.Y, 431, 37, 0, 0, 0, 255)
  4086. _UIMenu.Subtitle.Text = UIResText.New(Subtitle, 8 + _UIMenu.Position.X, 110 + _UIMenu.Position.Y, 0.35, 245, 245, 245, 255, 0)
  4087. _UIMenu.Subtitle.BackupText = Subtitle
  4088. _UIMenu.Subtitle.Formatted = false
  4089. if string.starts(Subtitle, "~") then _UIMenu.PageCounter.PreText = string.sub(Subtitle, 1, 3) end
  4090. _UIMenu.PageCounter.Text = UIResText.New("", 425 + _UIMenu.Position.X, 110 + _UIMenu.Position.Y, 0.35, 245, 245, 245, 255, 0, "Right")
  4091. _UIMenu.Subtitle.ExtraY = 37
  4092. end
  4093.  
  4094. _UIMenu.ArrowSprite = Sprite.New("commonmenu", "shop_arrows_upanddown", 190 + _UIMenu.Position.X, 147 + 37 * (_UIMenu.Pagination.Total + 1) + _UIMenu.Position.Y - 37 + _UIMenu.Subtitle.ExtraY, 40, 40)
  4095. _UIMenu.Extra.Up = UIResRectangle.New(0 + _UIMenu.Position.X, 144 + 38 * (_UIMenu.Pagination.Total + 1) + _UIMenu.Position.Y - 37 + _UIMenu.Subtitle.ExtraY, 431, 18, 0, 0, 0, 200)
  4096. _UIMenu.Extra.Down = UIResRectangle.New(0 + _UIMenu.Position.X, 144 + 18 + 38 * (_UIMenu.Pagination.Total + 1) + _UIMenu.Position.Y - 37 + _UIMenu.Subtitle.ExtraY, 431, 18, 0, 0, 0, 200)
  4097.  
  4098. _UIMenu.Description.Bar = UIResRectangle.New(_UIMenu.Position.X, 123, 431, 4, 0, 0, 0, 255)
  4099. _UIMenu.Description.Rectangle = Sprite.New("commonmenu", "interaction_bgd", _UIMenu.Position.X, 127, 431, 30) --INFO UNDER MENU
  4100. _UIMenu.Description.Badge = Sprite.New("shared", "info_icon_32", _UIMenu.Position.X + 5, 130, 31, 31)
  4101. _UIMenu.Description.Text = UIResText.New("Description", _UIMenu.Position.X + 35, 125, 0.35)
  4102. _UIMenu.Description.Text.LongText = 1
  4103.  
  4104. _UIMenu.Background = Sprite.New("commonmenu", "header_gradient_script", _UIMenu.Position.X, 144 + _UIMenu.Position.Y - 37 + _UIMenu.Subtitle.ExtraY, 290, 25) --MENU BACKGROUND
  4105.  
  4106. if _UIMenu.BetterSize == true then
  4107. _UIMenu.WidthOffset = math.floor(tonumber(69))
  4108. _UIMenu.Logo:Size(431 + _UIMenu.WidthOffset, 107)
  4109. _UIMenu.Title:Position(((_UIMenu.WidthOffset + 431) / 2) + _UIMenu.Position.X, 20 + _UIMenu.Position.Y)
  4110. if _UIMenu.Subtitle.Rectangle ~= nil then
  4111. _UIMenu.Subtitle.Rectangle:Size(431 + _UIMenu.WidthOffset + 100, 37)
  4112. _UIMenu.PageCounter.Text:Position(425 + _UIMenu.Position.X + _UIMenu.WidthOffset, 110 + _UIMenu.Position.Y)
  4113. end
  4114. if _UIMenu.Banner ~= nil then _UIMenu.Banner:Size(431 + _UIMenu.WidthOffset, 107) end
  4115. end
  4116.  
  4117. Citizen.CreateThread(function()
  4118. if not HasScaleformMovieLoaded(_UIMenu.InstructionalScaleform) then
  4119. _UIMenu.InstructionalScaleform = RequestScaleformMovie("INSTRUCTIONAL_BUTTONS")
  4120. while not HasScaleformMovieLoaded(_UIMenu.InstructionalScaleform) do Citizen.Wait(0) end
  4121. end
  4122. end)
  4123. return setmetatable(_UIMenu, UIMenu)
  4124. end
  4125.  
  4126. function UIMenu:SetMenuWidthOffset(Offset)
  4127. if tonumber(Offset) then
  4128. self.WidthOffset = math.floor(tonumber(Offset) + tonumber(70))
  4129. self.Logo:Size(431 + self.WidthOffset, 107)
  4130. self.Title:Position(((self.WidthOffset + 431) / 2) + self.Position.X, 20 + self.Position.Y)
  4131. if self.Subtitle.Rectangle ~= nil then
  4132. self.Subtitle.Rectangle:Size(431 + self.WidthOffset + 100, 37)
  4133. self.PageCounter.Text:Position(425 + self.Position.X + self.WidthOffset, 110 + self.Position.Y)
  4134. end
  4135. if self.Banner ~= nil then self.Banner:Size(431 + self.WidthOffset, 107) end
  4136. end
  4137. end
  4138.  
  4139. function UIMenu:DisEnableControls(bool)
  4140. if bool then
  4141. EnableAllControlActions(2)
  4142. else
  4143. DisableAllControlActions(2)
  4144. end
  4145. if bool then
  4146. return
  4147. else
  4148. if Controller() then
  4149. for Index = 1, #self.Settings.EnabledControls.Controller do
  4150. EnableControlAction(self.Settings.EnabledControls.Controller[Index][1], self.Settings.EnabledControls.Controller[Index][2], true)
  4151. end
  4152. else
  4153. for Index = 1, #self.Settings.EnabledControls.Keyboard do
  4154. EnableControlAction(self.Settings.EnabledControls.Keyboard[Index][1], self.Settings.EnabledControls.Keyboard[Index][2], true)
  4155. end
  4156. end
  4157. end
  4158. end
  4159.  
  4160. function UIMenu:InstructionalButtons(bool) if bool ~= nil then self.Settings.InstrucitonalButtons = ToBool(bool) end end
  4161.  
  4162. function UIMenu:SetBannerSprite(Sprite, IncludeChildren)
  4163. if Sprite() == "Sprite" then
  4164. self.Logo = Sprite
  4165. self.Logo:Size(431 + self.WidthOffset, 107)
  4166. self.Logo:Position(self.Position.X, self.Position.Y)
  4167. self.Banner = nil
  4168. if IncludeChildren then
  4169. for Item, Menu in pairs(self.Children) do
  4170. Menu.Logo = Sprite
  4171. Menu.Logo:Size(431 + self.WidthOffset, 107)
  4172. Menu.Logo:Position(self.Position.X, self.Position.Y)
  4173. Menu.Banner = nil
  4174. end
  4175. end
  4176. end
  4177. end
  4178.  
  4179. function UIMenu:SetBannerRectangle(Rectangle, IncludeChildren)
  4180. if Rectangle() == "Rectangle" then
  4181. self.Banner = Rectangle
  4182. self.Banner:Size(431 + self.WidthOffset, 107)
  4183. self.Banner:Position(self.Position.X, self.Position.Y)
  4184. self.Logo = nil
  4185. if IncludeChildren then
  4186. for Item, Menu in pairs(self.Children) do
  4187. Menu.Banner = Rectangle
  4188. Menu.Banner:Size(431 + self.WidthOffset, 107)
  4189. Menu:Position(self.Position.X, self.Position.Y)
  4190. Menu.Logo = nil
  4191. end
  4192. end
  4193. end
  4194. end
  4195.  
  4196. function UIMenu:CurrentSelection(value)
  4197. if tonumber(value) then
  4198. if #self.Items == 0 then self.ActiveItem = 0 end
  4199. self.Items[self:CurrentSelection()]:Selected(false)
  4200. self.ActiveItem = 1000000 - (1000000 % #self.Items) + tonumber(value)
  4201. if self:CurrentSelection() > self.Pagination.Max then
  4202. self.Pagination.Min = self:CurrentSelection() - self.Pagination.Total
  4203. self.Pagination.Max = self:CurrentSelection()
  4204. elseif self:CurrentSelection() < self.Pagination.Min then
  4205. self.Pagination.Min = self:CurrentSelection()
  4206. self.Pagination.Max = self:CurrentSelection() + self.Pagination.Total
  4207. end
  4208. else
  4209. if #self.Items == 0 then
  4210. return 1
  4211. else
  4212. if self.ActiveItem % #self.Items == 0 then
  4213. return 1
  4214. else
  4215. return self.ActiveItem % #self.Items + 1
  4216. end
  4217. end
  4218. end
  4219. end
  4220.  
  4221. function UIMenu:CalculateWindowHeight()
  4222. local Height = 0
  4223. for i = 1, #self.Windows do Height = Height + self.Windows[i].Background:Size().Height end
  4224. return Height
  4225. end
  4226.  
  4227. function UIMenu:CalculateItemHeightOffset(Item)
  4228. if Item.Base then
  4229. return Item.Base.Rectangle.Height
  4230. else
  4231. return Item.Rectangle.Height
  4232. end
  4233. end
  4234.  
  4235. function UIMenu:CalculateItemHeight()
  4236. local ItemOffset = 0 + self.Subtitle.ExtraY - 37
  4237. for i = self.Pagination.Min + 1, self.Pagination.Max do
  4238. local Item = self.Items[i]
  4239. if Item ~= nil then ItemOffset = ItemOffset + self:CalculateItemHeightOffset(Item) end
  4240. end
  4241.  
  4242. return ItemOffset
  4243. end
  4244.  
  4245. function UIMenu:RecalculateDescriptionPosition()
  4246. local WindowHeight = self:CalculateWindowHeight()
  4247. self.Description.Bar:Position(self.Position.X, 149 + self.Position.Y + WindowHeight)
  4248. self.Description.Rectangle:Position(self.Position.X, 149 + self.Position.Y + WindowHeight)
  4249. self.Description.Badge:Position(self.Position.X + 4, 152 + self.Position.Y + WindowHeight)
  4250. self.Description.Text:Position(self.Position.X + 38, 153 + self.Position.Y + WindowHeight)
  4251. self.Description.Bar:Size(431 + self.WidthOffset, 4)
  4252. self.Description.Rectangle:Size(431 + self.WidthOffset, 30)
  4253. self.Description.Bar:Position(self.Position.X, self:CalculateItemHeight() + ((#self.Items > (self.Pagination.Total + 1)) and 37 or 0) + self.Description.Bar:Position().Y)
  4254. self.Description.Rectangle:Position(self.Position.X, self:CalculateItemHeight() + ((#self.Items > (self.Pagination.Total + 1)) and 37 or 0) + self.Description.Rectangle:Position().Y)
  4255. self.Description.Badge:Position(self.Position.X + 4, self:CalculateItemHeight() + ((#self.Items > (self.Pagination.Total + 1)) and 37 or 0) + self.Description.Badge:Position().Y)
  4256. self.Description.Text:Position(self.Position.X + 38, self:CalculateItemHeight() + ((#self.Items > (self.Pagination.Total + 1)) and 37 or 0) + self.Description.Text:Position().Y)
  4257. end
  4258.  
  4259. function UIMenu:CaclulatePanelPosition(HasDescription)
  4260. local Height = self:CalculateWindowHeight() + 149 + self.Position.Y
  4261. if HasDescription then Height = Height + self.Description.Rectangle:Size().Height + 5 end
  4262. return self:CalculateItemHeight() + ((#self.Items > (self.Pagination.Total + 1)) and 37 or 0) + Height
  4263. end
  4264.  
  4265. function UIMenu:AddWindow(Window)
  4266. if Window() == "UIMenuWindow" then
  4267. Window:SetParentMenu(self)
  4268. Window:Offset(self.Position.X, self.Position.Y)
  4269. table.insert(self.Windows, Window)
  4270. self.ReDraw = true
  4271. self:RecalculateDescriptionPosition()
  4272. end
  4273. end
  4274.  
  4275. function UIMenu:RemoveWindowAt(Index)
  4276. if tonumber(Index) then
  4277. if self.Windows[Index] then
  4278. table.remove(self.Windows, Index)
  4279. self.ReDraw = true
  4280. self:RecalculateDescriptionPosition()
  4281. end
  4282. end
  4283. end
  4284.  
  4285. function UIMenu:AddItem(Item)
  4286. Items = Item
  4287. if #Items == 0 then
  4288. if Item() == "UIMenuItem" then
  4289. local SelectedItem = self:CurrentSelection()
  4290. Item:SetParentMenu(self)
  4291. Item:Offset(self.Position.X, self.Position.Y)
  4292. Item:Position((#self.Items * 25) - 37 + self.Subtitle.ExtraY)
  4293. table.insert(self.Items, Item)
  4294. self:RecalculateDescriptionPosition()
  4295. self:CurrentSelection(SelectedItem)
  4296. end
  4297. end
  4298. for i = 1, #Items, 1 do
  4299. Item = Items[i]
  4300. if Item() == "UIMenuItem" then
  4301. local SelectedItem = self:CurrentSelection()
  4302. Item:SetParentMenu(self)
  4303. Item:Offset(self.Position.X, self.Position.Y)
  4304. Item:Position((#self.Items * 25) - 37 + self.Subtitle.ExtraY)
  4305. table.insert(self.Items, Item)
  4306. self:RecalculateDescriptionPosition()
  4307. self:CurrentSelection(SelectedItem)
  4308. end
  4309. end
  4310. end
  4311.  
  4312. function UIMenu:AddSpacerItem(Title, Description)
  4313. local output = "~h~";
  4314. local length = Title:len();
  4315. local totalSize = 50 - length;
  4316.  
  4317. for i=0, totalSize do
  4318. output = output.." ";
  4319. end
  4320. output = output..Title;
  4321. local spacerItem = nil;
  4322. if string.IsNullOrEmpty(Description) then spacerItem = UIMenuItem.New(output, "")
  4323. else spacerItem = UIMenuItem.New(output, Description) end
  4324. spacerItem:Enabled(false)
  4325. self:AddItem(spacerItem)
  4326. end
  4327.  
  4328. function UIMenu:GetItemAt(index) return self.Items[index] end
  4329.  
  4330. function UIMenu:RemoveItemAt(Index)
  4331. if tonumber(Index) then
  4332. if self.Items[Index] then
  4333. local SelectedItem = self:CurrentSelection()
  4334. if #self.Items > self.Pagination.Total and self.Pagination.Max == #self.Items - 1 then
  4335. self.Pagination.Min = self.Pagination.Min - 1
  4336. self.Pagination.Max = self.Pagination.Max + 1
  4337. end
  4338. table.remove(self.Items, tonumber(Index))
  4339. self:RecalculateDescriptionPosition()
  4340. self:CurrentSelection(SelectedItem)
  4341. end
  4342. end
  4343. end
  4344.  
  4345. function UIMenu:RefreshIndex()
  4346. if #self.Items == 0 then
  4347. self.ActiveItem = 1000
  4348. self.Pagination.Max = self.Pagination.Total + 1
  4349. self.Pagination.Min = 0
  4350. return
  4351. end
  4352. self.Items[self:CurrentSelection()]:Selected(false)
  4353. self.ActiveItem = 1000 - (1000 % #self.Items)
  4354. self.Pagination.Max = self.Pagination.Total + 1
  4355. self.Pagination.Min = 0
  4356. self.ReDraw = true
  4357. end
  4358.  
  4359. function UIMenu:Clear()
  4360. self.Items = {}
  4361. self.ReDraw = true
  4362. self:RecalculateDescriptionPosition()
  4363. end
  4364.  
  4365. function UIMenu:MultilineFormat(str, offset)
  4366. if offset == nil then offset = 0 end
  4367. if tostring(str) then
  4368. local PixelPerLine = 425 + self.WidthOffset - offset
  4369. local AggregatePixels = 0
  4370. local output = ""
  4371. local words = string.split(tostring(str), " ")
  4372. for i = 1, #words do
  4373. local offset = MeasureStringWidth(words[i], 0, 0.30)
  4374. AggregatePixels = AggregatePixels + offset
  4375. if AggregatePixels > PixelPerLine then
  4376. output = output .. "\n" .. words[i] .. " "
  4377. AggregatePixels = offset + MeasureString(" ")
  4378. else
  4379. output = output .. words[i] .. " "
  4380. AggregatePixels = AggregatePixels + MeasureString(" ")
  4381. end
  4382. end
  4383.  
  4384. return output
  4385. end
  4386. end
  4387.  
  4388. function UIMenu:DrawCalculations()
  4389. local WindowHeight = self:CalculateWindowHeight()
  4390. if self.Settings.MultilineFormats then
  4391. if self.Subtitle.Rectangle and not self.Subtitle.Formatted then
  4392. self.Subtitle.Formatted = true
  4393. self.Subtitle.Text:Text(self:MultilineFormat(self.Subtitle.Text:Text()))
  4394. local Linecount = #string.split(self.Subtitle.Text:Text(), "\n")
  4395. self.Subtitle.ExtraY = ((Linecount == 1) and 37 or ((Linecount + 1) * 22))
  4396. self.Subtitle.Rectangle:Size(431 + self.WidthOffset, self.Subtitle.ExtraY)
  4397. end
  4398. elseif self.Subtitle.Formatted then
  4399. self.Subtitle.Formatted = false
  4400. self.Subtitle.ExtraY = 37
  4401. self.Subtitle.Rectangle:Size(431 + self.WidthOffset, self.Subtitle.ExtraY)
  4402. self.Subtitle.Text:Text(self.Subtitle.BackupText)
  4403. end
  4404.  
  4405. self.Background:Size(431 + self.WidthOffset, self:CalculateItemHeight() + WindowHeight + ((self.Subtitle.ExtraY > 0) and 0 or 37))
  4406.  
  4407. self.Extra.Up:Size(431 + self.WidthOffset, 18)
  4408. self.Extra.Down:Size(431 + self.WidthOffset, 18)
  4409.  
  4410. local offsetExtra = 4
  4411. self.Extra.Up:Position(self.Position.X, 144 + self:CalculateItemHeight() + self.Position.Y + WindowHeight + offsetExtra)
  4412. self.Extra.Down:Position(self.Position.X, 144 + 18 + self:CalculateItemHeight() + self.Position.Y + WindowHeight + offsetExtra)
  4413.  
  4414. if self.WidthOffset > 0 then
  4415. self.ArrowSprite:Position(190 + self.Position.X + (self.WidthOffset / 2),
  4416. 141 + self:CalculateItemHeight() + self.Position.Y + WindowHeight + offsetExtra)
  4417. else
  4418. self.ArrowSprite:Position(190 + self.Position.X + self.WidthOffset,
  4419. 141 + self:CalculateItemHeight() + self.Position.Y + WindowHeight + offsetExtra)
  4420. end
  4421.  
  4422. self.ReDraw = false
  4423.  
  4424. if #self.Items ~= 0 and self.Items[self:CurrentSelection()]:Description() ~= "" then
  4425. self:RecalculateDescriptionPosition()
  4426. local description = self.Items[self:CurrentSelection()]:Description()
  4427. if self.Settings.MultilineFormats then
  4428. self.Description.Text:Text(self:MultilineFormat(description, 35))
  4429. else
  4430. self.Description.Text:Text(description)
  4431. end
  4432. local Linecount = #string.split(self.Description.Text:Text(), "\n")
  4433. self.Description.Rectangle:Size(431 + self.WidthOffset, ((Linecount == 1) and 37 or ((Linecount + 1) * 22)))
  4434. end
  4435. end
  4436.  
  4437. function UIMenu:Visible(bool)
  4438. if bool ~= nil then
  4439. self._Visible = ToBool(bool)
  4440. self.JustOpened = ToBool(bool)
  4441. self.Dirty = ToBool(bool)
  4442. self:UpdateScaleform()
  4443. if self.ParentMenu ~= nil or ToBool(bool) == false then return end
  4444. if self.Settings.ResetCursorOnOpen then
  4445. if SetCursorSprite ~= nil then
  4446. SetCursorSprite(1)
  4447. else
  4448. N_0x8db8cffd58b62552(1)
  4449. end
  4450. if SetCursorLocation ~= nil then
  4451. SetCursorLocation(0.5, 0.5)
  4452. else
  4453. N_0xfc695459d4d0e219(0.5, 0.5)
  4454. end
  4455. end
  4456. else
  4457. return self._Visible
  4458. end
  4459. end
  4460.  
  4461. function UIMenu:ProcessControl()
  4462. if not self._Visible then return end
  4463. if self.JustOpened then
  4464. self.JustOpened = false
  4465. return
  4466. end
  4467. if self.Controls.Back.Enabled and
  4468. (IsDisabledControlJustReleased(0, 177) or IsDisabledControlJustReleased(1, 177) or IsDisabledControlJustReleased(2, 177) or
  4469. IsDisabledControlJustReleased(0, 199) or IsDisabledControlJustReleased(1, 199) or IsDisabledControlJustReleased(2, 199)) then
  4470. self:GoBack()
  4471. end
  4472. if #self.Items == 0 then return end
  4473. if not self.UpPressed then
  4474. if self.Controls.Up.Enabled and
  4475. (IsDisabledControlJustPressed(0, 172) or IsDisabledControlJustPressed(1, 172) or IsDisabledControlJustPressed(2, 172) or
  4476. IsDisabledControlJustPressed(0, 241) or IsDisabledControlJustPressed(1, 241) or IsDisabledControlJustPressed(2, 241) or
  4477. IsDisabledControlJustPressed(2, 241)) then
  4478. Citizen.CreateThread(function()
  4479. self.UpPressed = true
  4480. if #self.Items > self.Pagination.Total + 1 then
  4481. self:GoUpOverflow()
  4482. else
  4483. self:GoUp()
  4484. end
  4485. self:UpdateScaleform()
  4486. Citizen.Wait(175)
  4487. while self.Controls.Up.Enabled and
  4488. (IsDisabledControlPressed(0, 172) or IsDisabledControlPressed(1, 172) or IsDisabledControlPressed(2, 172) or
  4489. IsDisabledControlPressed(0, 241) or IsDisabledControlPressed(1, 241) or IsDisabledControlPressed(2, 241) or
  4490. IsDisabledControlPressed(2, 241)) do
  4491. if #self.Items > self.Pagination.Total + 1 then
  4492. self:GoUpOverflow()
  4493. else
  4494. self:GoUp()
  4495. end
  4496. self:UpdateScaleform()
  4497. Citizen.Wait(125)
  4498. end
  4499. self.UpPressed = false
  4500. end)
  4501. end
  4502. end
  4503. if not self.DownPressed then
  4504. if self.Controls.Down.Enabled and
  4505. (IsDisabledControlJustPressed(0, 173) or IsDisabledControlJustPressed(1, 173) or IsDisabledControlJustPressed(2, 173) or
  4506. IsDisabledControlJustPressed(0, 242) or IsDisabledControlJustPressed(1, 242) or IsDisabledControlJustPressed(2, 242)) then
  4507. Citizen.CreateThread(function()
  4508. self.DownPressed = true
  4509. if #self.Items > self.Pagination.Total + 1 then
  4510. self:GoDownOverflow()
  4511. else
  4512. self:GoDown()
  4513. end
  4514. self:UpdateScaleform()
  4515. Citizen.Wait(175)
  4516. while self.Controls.Down.Enabled and
  4517. (IsDisabledControlPressed(0, 173) or IsDisabledControlPressed(1, 173) or IsDisabledControlPressed(2, 173) or
  4518. IsDisabledControlPressed(0, 242) or IsDisabledControlPressed(1, 242) or IsDisabledControlPressed(2, 242)) do
  4519. if #self.Items > self.Pagination.Total + 1 then
  4520. self:GoDownOverflow()
  4521. else
  4522. self:GoDown()
  4523. end
  4524. self:UpdateScaleform()
  4525. Citizen.Wait(125)
  4526. end
  4527. self.DownPressed = false
  4528. end)
  4529. end
  4530. end
  4531. if not self.LeftPressed then
  4532. if self.Controls.Left.Enabled and
  4533. (IsDisabledControlJustPressed(0, 174) or IsDisabledControlJustPressed(1, 174) or IsDisabledControlJustPressed(2, 174)) then
  4534. local type, subtype = self.Items[self:CurrentSelection()]()
  4535. Citizen.CreateThread(function()
  4536. if (subtype == "UIMenuSliderHeritageItem") then
  4537. self.LeftPressed = true
  4538. self:GoLeft()
  4539. Citizen.Wait(40)
  4540. while self.Controls.Left.Enabled and
  4541. (IsDisabledControlPressed(0, 174) or IsDisabledControlPressed(1, 174) or IsDisabledControlPressed(2, 174)) do
  4542. self:GoLeft()
  4543. Citizen.Wait(20)
  4544. end
  4545. self.LeftPressed = false
  4546. else
  4547. self.LeftPressed = true
  4548. self:GoLeft()
  4549. Citizen.Wait(175)
  4550. while self.Controls.Left.Enabled and
  4551. (IsDisabledControlPressed(0, 174) or IsDisabledControlPressed(1, 174) or IsDisabledControlPressed(2, 174)) do
  4552. self:GoLeft()
  4553. Citizen.Wait(125)
  4554. end
  4555. self.LeftPressed = false
  4556. end
  4557. end)
  4558. end
  4559. end
  4560. if not self.RightPressed then
  4561. if self.Controls.Right.Enabled and
  4562. (IsDisabledControlJustPressed(0, 175) or IsDisabledControlJustPressed(1, 175) or IsDisabledControlJustPressed(2, 175)) then
  4563. Citizen.CreateThread(function()
  4564. local type, subtype = self.Items[self:CurrentSelection()]()
  4565. if (subtype == "UIMenuSliderHeritageItem") then
  4566. self.RightPressed = true
  4567. self:GoRight()
  4568. Citizen.Wait(40)
  4569. while self.Controls.Right.Enabled and
  4570. (IsDisabledControlPressed(0, 175) or IsDisabledControlPressed(1, 175) or IsDisabledControlPressed(2, 175)) do
  4571. self:GoRight()
  4572. Citizen.Wait(20)
  4573. end
  4574. self.RightPressed = false
  4575. else
  4576. self.RightPressed = true
  4577. self:GoRight()
  4578. Citizen.Wait(175)
  4579. while self.Controls.Right.Enabled and
  4580. (IsDisabledControlPressed(0, 175) or IsDisabledControlPressed(1, 175) or IsDisabledControlPressed(2, 175)) do
  4581. self:GoRight()
  4582. Citizen.Wait(125)
  4583. end
  4584. self.RightPressed = false
  4585. end
  4586. end)
  4587. end
  4588. end
  4589. if self.Controls.Select.Enabled and
  4590. (IsDisabledControlJustPressed(0, 201) or IsDisabledControlJustPressed(1, 201) or IsDisabledControlJustPressed(2, 201)) then
  4591. self:SelectItem()
  4592. end
  4593. end
  4594.  
  4595. function UIMenu:GoUpOverflow()
  4596. if #self.Items <= self.Pagination.Total + 1 then return end
  4597. if self:CurrentSelection() <= self.Pagination.Min + 1 then
  4598. if self:CurrentSelection() == 1 then
  4599. self.Pagination.Min = #self.Items - (self.Pagination.Total + 1)
  4600. self.Pagination.Max = #self.Items
  4601. self.Items[self:CurrentSelection()]:Selected(false)
  4602. self.ActiveItem = 1000 - (1000 % #self.Items)
  4603. self.ActiveItem = self.ActiveItem + (#self.Items - 1)
  4604. self.Items[self:CurrentSelection()]:Selected(true)
  4605. else
  4606. self.Pagination.Min = self.Pagination.Min - 1
  4607. self.Pagination.Max = self.Pagination.Max - 1
  4608. self.Items[self:CurrentSelection()]:Selected(false)
  4609. self.ActiveItem = self.ActiveItem - 1
  4610. self.Items[self:CurrentSelection()]:Selected(true)
  4611. end
  4612. else
  4613. self.Items[self:CurrentSelection()]:Selected(false)
  4614. self.ActiveItem = self.ActiveItem - 1
  4615. self.Items[self:CurrentSelection()]:Selected(true)
  4616. end
  4617. PlaySoundFrontend(-1, self.Settings.Audio.UpDown, self.Settings.Audio.Library, true)
  4618. self.OnIndexChange(self, self:CurrentSelection())
  4619. self.ReDraw = true
  4620. end
  4621.  
  4622. function UIMenu:GoUp()
  4623. if #self.Items > self.Pagination.Total + 1 then return end
  4624. self.Items[self:CurrentSelection()]:Selected(false)
  4625. self.ActiveItem = self.ActiveItem - 1
  4626. self.Items[self:CurrentSelection()]:Selected(true)
  4627. PlaySoundFrontend(-1, self.Settings.Audio.UpDown, self.Settings.Audio.Library, true)
  4628. self.OnIndexChange(self, self:CurrentSelection())
  4629. self.ReDraw = true
  4630. end
  4631.  
  4632. function UIMenu:GoDownOverflow()
  4633. if #self.Items <= self.Pagination.Total + 1 then return end
  4634.  
  4635. if self:CurrentSelection() >= self.Pagination.Max then
  4636. if self:CurrentSelection() == #self.Items then
  4637. self.Pagination.Min = 0
  4638. self.Pagination.Max = self.Pagination.Total + 1
  4639. self.Items[self:CurrentSelection()]:Selected(false)
  4640. self.ActiveItem = 1000 - (1000 % #self.Items)
  4641. self.Items[self:CurrentSelection()]:Selected(true)
  4642. else
  4643. self.Pagination.Max = self.Pagination.Max + 1
  4644. self.Pagination.Min = self.Pagination.Max - (self.Pagination.Total + 1)
  4645. self.Items[self:CurrentSelection()]:Selected(false)
  4646. self.ActiveItem = self.ActiveItem + 1
  4647. self.Items[self:CurrentSelection()]:Selected(true)
  4648. end
  4649. else
  4650. self.Items[self:CurrentSelection()]:Selected(false)
  4651. self.ActiveItem = self.ActiveItem + 1
  4652. self.Items[self:CurrentSelection()]:Selected(true)
  4653. end
  4654. PlaySoundFrontend(-1, self.Settings.Audio.UpDown, self.Settings.Audio.Library, true)
  4655. self.OnIndexChange(self, self:CurrentSelection())
  4656. self.ReDraw = true
  4657. end
  4658.  
  4659. function UIMenu:GoDown()
  4660. if #self.Items > self.Pagination.Total + 1 then return end
  4661.  
  4662. self.Items[self:CurrentSelection()]:Selected(false)
  4663. self.ActiveItem = self.ActiveItem + 1
  4664. self.Items[self:CurrentSelection()]:Selected(true)
  4665. PlaySoundFrontend(-1, self.Settings.Audio.UpDown, self.Settings.Audio.Library, true)
  4666. self.OnIndexChange(self, self:CurrentSelection())
  4667. self.ReDraw = true
  4668. end
  4669.  
  4670. function UIMenu:GoLeft()
  4671. local type, subtype = self.Items[self:CurrentSelection()]()
  4672. if subtype ~= "UIMenuListItem" and subtype ~= "UIMenuSliderItem" and subtype ~= "UIMenuProgressItem" and subtype ~=
  4673. "UIMenuSliderHeritageItem" and subtype ~= "UIMenuSliderProgressItem" then return end
  4674.  
  4675. if not self.Items[self:CurrentSelection()]:Enabled() then
  4676. PlaySoundFrontend(-1, self.Settings.Audio.Error, self.Settings.Audio.Library, true)
  4677. return
  4678. end
  4679.  
  4680. if subtype == "UIMenuListItem" then
  4681. local Item = self.Items[self:CurrentSelection()]
  4682. Item:Index(Item._Index - 1)
  4683. self.OnListChange(self, Item, Item._Index)
  4684. Item.OnListChanged(self, Item, Item._Index)
  4685. PlaySoundFrontend(-1, self.Settings.Audio.LeftRight, self.Settings.Audio.Library, true)
  4686. elseif subtype == "UIMenuSliderItem" then
  4687. local Item = self.Items[self:CurrentSelection()]
  4688. Item:Index(Item._Index - 1)
  4689. self.OnSliderChange(self, Item, Item:Index())
  4690. Item.OnSliderChanged(self, Item, Item._Index)
  4691. PlaySoundFrontend(-1, self.Settings.Audio.LeftRight, self.Settings.Audio.Library, true)
  4692. elseif subtype == "UIMenuSliderProgressItem" then
  4693. local Item = self.Items[self:CurrentSelection()]
  4694. Item:Index(Item._Index - 1)
  4695. self.OnSliderChange(self, Item, Item:Index())
  4696. Item.OnSliderChanged(self, Item, Item._Index)
  4697. PlaySoundFrontend(-1, self.Settings.Audio.LeftRight, self.Settings.Audio.Library, true)
  4698. elseif subtype == "UIMenuProgressItem" then
  4699. local Item = self.Items[self:CurrentSelection()]
  4700. Item:Index(Item.Data.Index - 1)
  4701. self.OnProgressChange(self, Item, Item.Data.Index)
  4702. Item.OnProgressChanged(self, Item, Item.Data.Index)
  4703. PlaySoundFrontend(-1, self.Settings.Audio.LeftRight, self.Settings.Audio.Library, true)
  4704. elseif subtype == "UIMenuSliderHeritageItem" then
  4705. local Item = self.Items[self:CurrentSelection()]
  4706. Item:Index(Item._Index - 0.1)
  4707. self.OnSliderChange(self, Item, Item:Index())
  4708. Item.OnSliderChanged(self, Item, Item._Index)
  4709. if not Item.Pressed then
  4710. Item.Pressed = true
  4711. Citizen.CreateThread(function()
  4712. Item.Audio.Id = GetSoundId()
  4713. PlaySoundFrontend(Item.Audio.Id, Item.Audio.Slider, Item.Audio.Library, 1)
  4714. Citizen.Wait(100)
  4715. StopSound(Item.Audio.Id)
  4716. ReleaseSoundId(Item.Audio.Id)
  4717. Item.Pressed = false
  4718. end)
  4719. end
  4720.  
  4721. end
  4722. end
  4723.  
  4724. function UIMenu:GoRight()
  4725. local type, subtype = self.Items[self:CurrentSelection()]()
  4726. if subtype ~= "UIMenuListItem" and subtype ~= "UIMenuSliderItem" and subtype ~= "UIMenuProgressItem" and subtype ~=
  4727. "UIMenuSliderHeritageItem" and subtype ~= "UIMenuSliderProgressItem" then return end
  4728. if not self.Items[self:CurrentSelection()]:Enabled() then
  4729. PlaySoundFrontend(-1, self.Settings.Audio.Error, self.Settings.Audio.Library, true)
  4730. return
  4731. end
  4732. if subtype == "UIMenuListItem" then
  4733. local Item = self.Items[self:CurrentSelection()]
  4734. Item:Index(Item._Index + 1)
  4735. self.OnListChange(self, Item, Item._Index)
  4736. Item.OnListChanged(self, Item, Item._Index)
  4737. PlaySoundFrontend(-1, self.Settings.Audio.LeftRight, self.Settings.Audio.Library, true)
  4738. elseif subtype == "UIMenuSliderItem" then
  4739. local Item = self.Items[self:CurrentSelection()]
  4740. Item:Index(Item._Index + 1)
  4741. self.OnSliderChange(self, Item, Item:Index())
  4742. Item.OnSliderChanged(self, Item, Item._Index)
  4743. PlaySoundFrontend(-1, self.Settings.Audio.LeftRight, self.Settings.Audio.Library, true)
  4744. elseif subtype == "UIMenuSliderProgressItem" then
  4745. local Item = self.Items[self:CurrentSelection()]
  4746. Item:Index(Item._Index + 1)
  4747. self.OnSliderChange(self, Item, Item:Index())
  4748. Item.OnSliderChanged(self, Item, Item._Index)
  4749. PlaySoundFrontend(-1, self.Settings.Audio.LeftRight, self.Settings.Audio.Library, true)
  4750. elseif subtype == "UIMenuProgressItem" then
  4751. local Item = self.Items[self:CurrentSelection()]
  4752. Item:Index(Item.Data.Index + 1)
  4753. self.OnProgressChange(self, Item, Item.Data.Index)
  4754. Item.OnProgressChanged(self, Item, Item.Data.Index)
  4755. PlaySoundFrontend(-1, self.Settings.Audio.LeftRight, self.Settings.Audio.Library, true)
  4756. elseif subtype == "UIMenuSliderHeritageItem" then
  4757. local Item = self.Items[self:CurrentSelection()]
  4758. Item:Index(Item._Index + 0.1)
  4759. self.OnSliderChange(self, Item, Item:Index())
  4760. Item.OnSliderChanged(self, Item, Item._Index)
  4761. if not Item.Pressed then
  4762. Item.Pressed = true
  4763. Citizen.CreateThread(function()
  4764. Item.Audio.Id = GetSoundId()
  4765. PlaySoundFrontend(Item.Audio.Id, Item.Audio.Slider, Item.Audio.Library, 1)
  4766. Citizen.Wait(100)
  4767. StopSound(Item.Audio.Id)
  4768. ReleaseSoundId(Item.Audio.Id)
  4769. Item.Pressed = false
  4770. end)
  4771. end
  4772. end
  4773. end
  4774.  
  4775. function UIMenu:SelectItem()
  4776. if not self.Items[self:CurrentSelection()]:Enabled() then
  4777. PlaySoundFrontend(-1, self.Settings.Audio.Error, self.Settings.Audio.Library, true)
  4778. return
  4779. end
  4780. local Item = self.Items[self:CurrentSelection()]
  4781. local type, subtype = Item()
  4782. if subtype == "UIMenuCheckboxItem" then
  4783. Item.Checked = not Item.Checked
  4784. PlaySoundFrontend(-1, self.Settings.Audio.Select, self.Settings.Audio.Library, true)
  4785. self.OnCheckboxChange(self, Item, Item.Checked)
  4786. Item.CheckboxEvent(self, Item, Item.Checked)
  4787. elseif subtype == "UIMenuListItem" then
  4788. PlaySoundFrontend(-1, self.Settings.Audio.Select, self.Settings.Audio.Library, true)
  4789. self.OnListSelect(self, Item, Item._Index)
  4790. Item.OnListSelected(self, Item, Item._Index)
  4791. elseif subtype == "UIMenuSliderItem" then
  4792. PlaySoundFrontend(-1, self.Settings.Audio.Select, self.Settings.Audio.Library, true)
  4793. self.OnSliderSelect(self, Item, Item._Index)
  4794. Item.OnSliderSelected(Item._Index)
  4795. elseif subtype == "UIMenuSliderProgressItem" then
  4796. PlaySoundFrontend(-1, self.Settings.Audio.Select, self.Settings.Audio.Library, true)
  4797. self.OnSliderSelect(self, Item, Item._Index)
  4798. Item.OnSliderSelected(Item._Index)
  4799. elseif subtype == "UIMenuProgressItem" then
  4800. PlaySoundFrontend(-1, self.Settings.Audio.Select, self.Settings.Audio.Library, true)
  4801. self.OnProgressSelect(self, Item, Item.Data.Index)
  4802. Item.OnProgressSelected(Item.Data.Index)
  4803. elseif subtype == "UIMenuSliderHeritageItem" then
  4804. PlaySoundFrontend(-1, self.Settings.Audio.Select, self.Settings.Audio.Library, true)
  4805. self.OnSliderSelect(self, Item, Item._Index)
  4806. Item.OnSliderSelected(Item._Index)
  4807. else
  4808. PlaySoundFrontend(-1, self.Settings.Audio.Select, self.Settings.Audio.Library, true)
  4809. self.OnItemSelect(self, Item, self:CurrentSelection())
  4810. Item.Activated(self, Item)
  4811. if not self.Children[Item] then return end
  4812. self:Visible(false)
  4813. self.Children[Item]:Visible(true)
  4814. self.OnMenuChanged(self, self.Children[self.Items[self:CurrentSelection()] ], true)
  4815. end
  4816. end
  4817.  
  4818. function UIMenu:GoBack()
  4819. PlaySoundFrontend(-1, self.Settings.Audio.Back, self.Settings.Audio.Library, true)
  4820. self:Visible(false)
  4821. if self.ParentMenu ~= nil then
  4822. self.ParentMenu:Visible(true)
  4823. self.OnMenuChanged(self, self.ParentMenu, false)
  4824. if self.Settings.ResetCursorOnOpen then
  4825. if SetCursorLocation ~= nil then
  4826. SetCursorLocation(0.5, 0.5)
  4827. else
  4828. N_0xfc695459d4d0e219(0.5, 0.5)
  4829. end
  4830. end
  4831. end
  4832. self.OnMenuClosed(self)
  4833. end
  4834.  
  4835. function UIMenu:BindMenuToItem(Menu, Item)
  4836. if Menu() == "UIMenu" and Item() == "UIMenuItem" then
  4837. Menu.ParentMenu = self
  4838. Menu.ParentItem = Item
  4839. self.Children[Item] = Menu
  4840. end
  4841. end
  4842.  
  4843. function UIMenu:ReleaseMenuFromItem(Item)
  4844. if Item() == "UIMenuItem" then
  4845. if not self.Children[Item] then return false end
  4846. self.Children[Item].ParentMenu = nil
  4847. self.Children[Item].ParentItem = nil
  4848. self.Children[Item] = nil
  4849. return true
  4850. end
  4851. end
  4852.  
  4853. function UIMenu:PageCounterName(String)
  4854. self.PageCounter.isCustom = true
  4855. self.PageCounter.PreText = String
  4856. self.PageCounter.Text:Text(self.PageCounter.PreText)
  4857. self.PageCounter.Text:Draw()
  4858. end
  4859.  
  4860. function UIMenu:Draw()
  4861. if not self._Visible then return end
  4862. HideHudComponentThisFrame(19)
  4863. if self.Settings.ControlDisablingEnabled then self:DisEnableControls(false) end
  4864. if self.Settings.InstructionalButtons then DrawScaleformMovieFullscreen(self.InstructionalScaleform, 255, 255, 255, 255, 0) end
  4865. if self.Settings.ScaleWithSafezone then
  4866. if N_0xB8A850F20A067EB6 ~= nil then
  4867. N_0xB8A850F20A067EB6(76, 84)
  4868. elseif SetScriptGfxAlign ~= nil then
  4869. SetScriptGfxAlign(76, 84)
  4870. elseif SetScreenDrawPosition ~= nil then
  4871. SetScreenDrawPosition(76, 84)
  4872. end
  4873.  
  4874. if N_0xF5A2C681787E579D ~= nil then
  4875. N_0xF5A2C681787E579D(0, 0, 0, 0)
  4876. elseif ScreenDrawPositionRatio ~= nil then
  4877. ScreenDrawPositionRatio(0, 0, 0, 0)
  4878. elseif SetScriptGfxAlignParams ~= nil then
  4879. SetScriptGfxAlignParams(0, 0, 0, 0)
  4880. end
  4881.  
  4882. if self.Settings.DrawOrder ~= nil then SetScriptGfxDrawOrder(tonumber(self.Settings.DrawOrder)) end
  4883. if GetScriptGfxPosition ~= nil then
  4884. self.DrawOffset.X, self.DrawOffset.Y = GetScriptGfxPosition(0, 0)
  4885. else
  4886. self.DrawOffset.X, self.DrawOffset.Y = N_0x6dd8f5aa635eb4b2(0, 0)
  4887. end
  4888. end
  4889. if self.ReDraw then self:DrawCalculations() end
  4890. if self.Logo then
  4891. self.Logo:Draw()
  4892. elseif self.Banner then
  4893. self.Banner:Draw()
  4894. end
  4895. self.Title:Draw()
  4896. if self.Subtitle.Rectangle then
  4897. self.Subtitle.Rectangle:Draw()
  4898. self.Subtitle.Text:Draw()
  4899. end
  4900. if #self.Items ~= 0 or #self.Windows ~= 0 then self.Background:Draw() end
  4901. if #self.Windows ~= 0 then
  4902. local WindowOffset = 0
  4903. for index = 1, #self.Windows do
  4904. if self.Windows[index - 1] then
  4905. WindowOffset = WindowOffset + self.Windows[index - 1].Background:Size().Height
  4906. end
  4907. local Window = self.Windows[index]
  4908. Window:Position(WindowOffset + self.Subtitle.ExtraY - 37)
  4909. Window:Draw()
  4910. end
  4911. end
  4912. if #self.Items == 0 then
  4913. if self.Settings.ScaleWithSafezone then
  4914. if ResetScriptGfxAlign ~= nil then
  4915. ResetScriptGfxAlign()
  4916. elseif ScreenDrawPositionEnd ~= nil then
  4917. ScreenDrawPositionEnd()
  4918. else
  4919. N_0xe3a3db414a373dab()
  4920. end
  4921. end
  4922. return
  4923. end
  4924.  
  4925. local CurrentSelection = self:CurrentSelection()
  4926. self.Items[CurrentSelection]:Selected(true)
  4927.  
  4928. if self.Items[CurrentSelection]:Description() ~= "" then
  4929. self.Description.Bar:Draw()
  4930. self.Description.Rectangle:Draw()
  4931. self.Description.Badge:Draw()
  4932. self.Description.Text:Draw()
  4933. end
  4934.  
  4935. if self.Items[CurrentSelection].Panels ~= nil then
  4936. if #self.Items[CurrentSelection].Panels ~= 0 then
  4937. local PanelOffset = self:CaclulatePanelPosition(self.Items[CurrentSelection]:Description() ~= "")
  4938. for index = 1, #self.Items[CurrentSelection].Panels do
  4939. if self.Items[CurrentSelection].Panels[index - 1] then
  4940. PanelOffset = PanelOffset + self.Items[CurrentSelection].Panels[index - 1].Background:Size().Height + 5
  4941. end
  4942. self.Items[CurrentSelection].Panels[index]:Position(PanelOffset)
  4943. self.Items[CurrentSelection].Panels[index]:Draw()
  4944. end
  4945. end
  4946. end
  4947.  
  4948. local WindowHeight = self:CalculateWindowHeight()
  4949.  
  4950. if #self.Items <= self.Pagination.Total + 1 then
  4951. local ItemOffset = self.Subtitle.ExtraY - 37 + WindowHeight
  4952. for index = 1, #self.Items do
  4953. local Item = self.Items[index]
  4954. Item:Position(ItemOffset)
  4955. Item:Draw()
  4956. ItemOffset = ItemOffset + self:CalculateItemHeightOffset(Item)
  4957. end
  4958. else
  4959. local ItemOffset = self.Subtitle.ExtraY - 37 + WindowHeight
  4960. for index = self.Pagination.Min + 1, self.Pagination.Max, 1 do
  4961. if self.Items[index] then
  4962. local Item = self.Items[index]
  4963. Item:Position(ItemOffset)
  4964. Item:Draw()
  4965. ItemOffset = ItemOffset + self:CalculateItemHeightOffset(Item)
  4966. end
  4967. end
  4968.  
  4969. self.Extra.Up:Draw()
  4970. self.Extra.Down:Draw()
  4971. self.ArrowSprite:Draw()
  4972.  
  4973. if self.PageCounter.isCustom ~= true then
  4974. if self.PageCounter.Text ~= nil then
  4975. local Caption = self.PageCounter.PreText .. CurrentSelection .. " / " .. #self.Items
  4976. self.PageCounter.Text:Text(Caption)
  4977. self.PageCounter.Text:Draw()
  4978. end
  4979. end
  4980. end
  4981.  
  4982. if self.PageCounter.isCustom ~= false then
  4983. if self.PageCounter.Text ~= nil then
  4984. self.PageCounter.Text:Text(self.PageCounter.PreText)
  4985. self.PageCounter.Text:Draw()
  4986. end
  4987. end
  4988.  
  4989. if self.Settings.ScaleWithSafezone then
  4990. if ResetScriptGfxAlign ~= nil then
  4991. ResetScriptGfxAlign()
  4992. elseif ScreenDrawPositionEnd ~= nil then
  4993. ScreenDrawPositionEnd()
  4994. else
  4995. N_0xe3a3db414a373dab()
  4996. end
  4997. end
  4998. end
  4999.  
  5000. function UIMenu:ProcessMouse()
  5001. if not self._Visible or self.JustOpened or #self.Items == 0 or ToBool(Controller()) or not self.Settings.MouseControlsEnabled then
  5002. EnableControlAction(0, 2, true)
  5003. EnableControlAction(0, 1, true)
  5004. EnableControlAction(0, 25, true)
  5005. EnableControlAction(0, 24, true)
  5006. if self.Dirty then for _, Item in pairs(self.Items) do if Item:Hovered() then Item:Hovered(false) end end end
  5007. return
  5008. end
  5009.  
  5010. local WindowHeight = self:CalculateWindowHeight()
  5011. local Limit = #self.Items
  5012. local ItemOffset = 0
  5013.  
  5014. ShowCursorThisFrame()
  5015.  
  5016. if #self.Items > self.Pagination.Total + 1 then Limit = self.Pagination.Max end
  5017.  
  5018. local W, H = GetResolution()
  5019.  
  5020. if IsMouseInBounds(0, 0, 30, H) and self.Settings.MouseEdgeEnabled then
  5021. SetGameplayCamRelativeHeading(GetGameplayCamRelativeHeading() + 5)
  5022. if SetCursorSprite ~= nil then
  5023. SetCursorSprite(6)
  5024. else
  5025. N_0x8db8cffd58b62552(6)
  5026. end
  5027. elseif IsMouseInBounds(W - 30, 0, 30, H) and self.Settings.MouseEdgeEnabled then
  5028. SetGameplayCamRelativeHeading(GetGameplayCamRelativeHeading() - 5)
  5029. if SetCursorSprite ~= nil then
  5030. SetCursorSprite(7)
  5031. else
  5032. N_0x8db8cffd58b62552(7)
  5033. end
  5034. elseif self.Settings.MouseEdgeEnabled then
  5035. if SetCursorSprite ~= nil then
  5036. SetCursorSprite(1)
  5037. else
  5038. N_0x8db8cffd58b62552(1)
  5039. end
  5040. end
  5041.  
  5042. for i = self.Pagination.Min + 1, Limit, 1 do
  5043. local X, Y = self.Position.X, self.Position.Y + 144 - 37 + self.Subtitle.ExtraY + ItemOffset + WindowHeight
  5044. local Item = self.Items[i]
  5045. local Type, SubType = Item()
  5046. local Width, Height = 431 + self.WidthOffset, self:CalculateItemHeightOffset(Item)
  5047.  
  5048. if IsMouseInBounds(X, Y, Width, Height, self.DrawOffset) then
  5049. Item:Hovered(true)
  5050. if not self.Controls.MousePressed then
  5051. if IsDisabledControlJustPressed(0, 24) then
  5052. Citizen.CreateThread(function()
  5053. local _X, _Y, _Width, _Height = X, Y, Width, Height
  5054. self.Controls.MousePressed = true
  5055. if Item:Selected() and Item:Enabled() then
  5056. if SubType == "UIMenuListItem" then
  5057. if IsMouseInBounds(Item.LeftArrow.X, Item.LeftArrow.Y, Item.LeftArrow.Width, Item.LeftArrow.Height,
  5058. self.DrawOffset) then
  5059. self:GoLeft()
  5060. elseif not IsMouseInBounds(Item.RightArrow.X, Item.RightArrow.Y, Item.RightArrow.Width,
  5061. Item.RightArrow.Height, self.DrawOffset) then
  5062. self:SelectItem()
  5063. end
  5064. if IsMouseInBounds(Item.RightArrow.X, Item.RightArrow.Y, Item.RightArrow.Width, Item.RightArrow.Height,
  5065. self.DrawOffset) then
  5066. self:GoRight()
  5067. elseif not IsMouseInBounds(Item.LeftArrow.X, Item.LeftArrow.Y, Item.LeftArrow.Width,
  5068. Item.LeftArrow.Height, self.DrawOffset) then
  5069. self:SelectItem()
  5070. end
  5071. elseif SubType == "UIMenuSliderItem" then
  5072. if IsMouseInBounds(Item.LeftArrow.X, Item.LeftArrow.Y, Item.LeftArrow.Width, Item.LeftArrow.Height,
  5073. self.DrawOffset) then
  5074. self:GoLeft()
  5075. elseif not IsMouseInBounds(Item.RightArrow.X, Item.RightArrow.Y, Item.RightArrow.Width,
  5076. Item.RightArrow.Height, self.DrawOffset) then
  5077. self:SelectItem()
  5078. end
  5079. if IsMouseInBounds(Item.RightArrow.X, Item.RightArrow.Y, Item.RightArrow.Width, Item.RightArrow.Height,
  5080. self.DrawOffset) then
  5081. self:GoRight()
  5082. elseif not IsMouseInBounds(Item.LeftArrow.X, Item.LeftArrow.Y, Item.LeftArrow.Width,
  5083. Item.LeftArrow.Height, self.DrawOffset) then
  5084. self:SelectItem()
  5085. end
  5086. elseif SubType == "UIMenuSliderProgressItem" then
  5087. if IsMouseInBounds(Item.LeftArrow.X, Item.LeftArrow.Y, Item.LeftArrow.Width, Item.LeftArrow.Height,
  5088. self.DrawOffset) then
  5089. self:GoLeft()
  5090. elseif not IsMouseInBounds(Item.RightArrow.X, Item.RightArrow.Y, Item.RightArrow.Width,
  5091. Item.RightArrow.Height, self.DrawOffset) then
  5092. self:SelectItem()
  5093. end
  5094. if IsMouseInBounds(Item.RightArrow.X, Item.RightArrow.Y, Item.RightArrow.Width, Item.RightArrow.Height,
  5095. self.DrawOffset) then
  5096. self:GoRight()
  5097. elseif not IsMouseInBounds(Item.LeftArrow.X, Item.LeftArrow.Y, Item.LeftArrow.Width,
  5098. Item.LeftArrow.Height, self.DrawOffset) then
  5099. self:SelectItem()
  5100. end
  5101. elseif SubType == "UIMenuSliderHeritageItem" then
  5102. if IsMouseInBounds(Item.LeftArrow.X, Item.LeftArrow.Y, Item.LeftArrow.Width, Item.LeftArrow.Height,
  5103. self.DrawOffset) then
  5104. self:GoLeft()
  5105. elseif not IsMouseInBounds(Item.RightArrow.X, Item.RightArrow.Y, Item.RightArrow.Width,
  5106. Item.RightArrow.Height, self.DrawOffset) then
  5107. self:SelectItem()
  5108. end
  5109. if IsMouseInBounds(Item.RightArrow.X, Item.RightArrow.Y, Item.RightArrow.Width, Item.RightArrow.Height,
  5110. self.DrawOffset) then
  5111. self:GoRight()
  5112. elseif not IsMouseInBounds(Item.LeftArrow.X, Item.LeftArrow.Y, Item.LeftArrow.Width,
  5113. Item.LeftArrow.Height, self.DrawOffset) then
  5114. self:SelectItem()
  5115. end
  5116. elseif SubType == "UIMenuProgressItem" then
  5117. if IsMouseInBounds(Item.Bar.X, Item.Bar.Y - 12, Item.Data.Max, Item.Bar.Height + 24, self.DrawOffset) then
  5118. local CursorX, CursorY = ConvertToPixel(GetControlNormal(0, 239), 0)
  5119. Item:CalculateProgress(CursorX)
  5120. self.OnProgressChange(self, Item, Item.Data.Index)
  5121. Item.OnProgressChanged(self, Item, Item.Data.Index)
  5122. if not Item.Pressed then
  5123. Item.Pressed = true
  5124. Citizen.CreateThread(function()
  5125. Item.Audio.Id = GetSoundId()
  5126. PlaySoundFrontend(Item.Audio.Id, Item.Audio.Slider, Item.Audio.Library, 1)
  5127. Citizen.Wait(100)
  5128. StopSound(Item.Audio.Id)
  5129. ReleaseSoundId(Item.Audio.Id)
  5130. Item.Pressed = false
  5131. end)
  5132. end
  5133. else
  5134. self:SelectItem()
  5135. end
  5136. else
  5137. self:SelectItem()
  5138. end
  5139. elseif not Item:Selected() then
  5140. self:CurrentSelection(i - 1)
  5141. PlaySoundFrontend(-1, self.Settings.Audio.Error, self.Settings.Audio.Library, true)
  5142. self.OnIndexChange(self, self:CurrentSelection())
  5143. self.ReDraw = true
  5144. self:UpdateScaleform()
  5145. elseif not Item:Enabled() and Item:Selected() then
  5146. PlaySoundFrontend(-1, self.Settings.Audio.Error, self.Settings.Audio.Library, true)
  5147. end
  5148. Citizen.Wait(175)
  5149. while IsDisabledControlPressed(0, 24) and IsMouseInBounds(_X, _Y, _Width, _Height, self.DrawOffset) do
  5150. if Item:Selected() and Item:Enabled() then
  5151. if SubType == "UIMenuListItem" then
  5152. if IsMouseInBounds(Item.LeftArrow.X, Item.LeftArrow.Y, Item.LeftArrow.Width, Item.LeftArrow.Height,
  5153. self.DrawOffset) then self:GoLeft() end
  5154. if IsMouseInBounds(Item.RightArrow.X, Item.RightArrow.Y, Item.RightArrow.Width,
  5155. Item.RightArrow.Height, self.DrawOffset) then
  5156. self:GoRight()
  5157. end
  5158. elseif SubType == "UIMenuSliderItem" then
  5159. if IsMouseInBounds(Item.LeftArrow.X, Item.LeftArrow.Y, Item.LeftArrow.Width, Item.LeftArrow.Height,
  5160. self.DrawOffset) then self:GoLeft() end
  5161. if IsMouseInBounds(Item.RightArrow.X, Item.RightArrow.Y, Item.RightArrow.Width,
  5162. Item.RightArrow.Height, self.DrawOffset) then
  5163. self:GoRight()
  5164. end
  5165. elseif SubType == "UIMenuSliderProgressItem" then
  5166. if IsMouseInBounds(Item.LeftArrow.X, Item.LeftArrow.Y, Item.LeftArrow.Width, Item.LeftArrow.Height,
  5167. self.DrawOffset) then self:GoLeft() end
  5168. if IsMouseInBounds(Item.RightArrow.X, Item.RightArrow.Y, Item.RightArrow.Width,
  5169. Item.RightArrow.Height, self.DrawOffset) then
  5170. self:GoRight()
  5171. end
  5172. elseif SubType == "UIMenuSliderHeritageItem" then
  5173. if IsMouseInBounds(Item.LeftArrow.X, Item.LeftArrow.Y, Item.LeftArrow.Width, Item.LeftArrow.Height,
  5174. self.DrawOffset) then self:GoLeft() end
  5175. if IsMouseInBounds(Item.RightArrow.X, Item.RightArrow.Y, Item.RightArrow.Width,
  5176. Item.RightArrow.Height, self.DrawOffset) then
  5177. self:GoRight()
  5178. end
  5179. elseif SubType == "UIMenuProgressItem" then
  5180. if IsMouseInBounds(Item.Bar.X, Item.Bar.Y - 12, Item.Data.Max, Item.Bar.Height + 24, self.DrawOffset) then
  5181. local CursorX, CursorY = ConvertToPixel(GetControlNormal(0, 239), 0)
  5182. Item:CalculateProgress(CursorX)
  5183. self.OnProgressChange(self, Item, Item.Data.Index)
  5184. Item.OnProgressChanged(self, Item, Item.Data.Index)
  5185. if not Item.Pressed then
  5186. Item.Pressed = true
  5187. Citizen.CreateThread(function()
  5188. Item.Audio.Id = GetSoundId()
  5189. PlaySoundFrontend(Item.Audio.Id, Item.Audio.Slider, Item.Audio.Library, 1)
  5190. Citizen.Wait(100)
  5191. StopSound(Item.Audio.Id)
  5192. ReleaseSoundId(Item.Audio.Id)
  5193. Item.Pressed = false
  5194. end)
  5195. end
  5196. else
  5197. self:SelectItem()
  5198. end
  5199. end
  5200. elseif not Item:Selected() then
  5201. self:CurrentSelection(i - 1)
  5202. PlaySoundFrontend(-1, self.Settings.Audio.Error, self.Settings.Audio.Library, true)
  5203. self.OnIndexChange(self, self:CurrentSelection())
  5204. self.ReDraw = true
  5205. self:UpdateScaleform()
  5206. elseif not Item:Enabled() and Item:Selected() then
  5207. PlaySoundFrontend(-1, self.Settings.Audio.Error, self.Settings.Audio.Library, true)
  5208. end
  5209. Citizen.Wait(125)
  5210. end
  5211. self.Controls.MousePressed = false
  5212. end)
  5213. end
  5214. end
  5215. else
  5216. Item:Hovered(false)
  5217. end
  5218. ItemOffset = ItemOffset + self:CalculateItemHeightOffset(Item)
  5219. end
  5220.  
  5221. local ExtraX, ExtraY = self.Position.X, 144 + self:CalculateItemHeight() + self.Position.Y + WindowHeight
  5222.  
  5223. if #self.Items <= self.Pagination.Total + 1 then return end
  5224.  
  5225. if IsMouseInBounds(ExtraX, ExtraY, 431 + self.WidthOffset, 18, self.DrawOffset) then
  5226. self.Extra.Up:Colour(30, 30, 30, 255)
  5227. if not self.Controls.MousePressed then
  5228. if IsDisabledControlJustPressed(0, 24) then
  5229. Citizen.CreateThread(function()
  5230. local _ExtraX, _ExtraY = ExtraX, ExtraY
  5231. self.Controls.MousePressed = true
  5232. if #self.Items > self.Pagination.Total + 1 then
  5233. self:GoUpOverflow()
  5234. else
  5235. self:GoUp()
  5236. end
  5237. Citizen.Wait(175)
  5238. while IsDisabledControlPressed(0, 24) and
  5239. IsMouseInBounds(_ExtraX, _ExtraY, 431 + self.WidthOffset, 18, self.DrawOffset) do
  5240. if #self.Items > self.Pagination.Total + 1 then
  5241. self:GoUpOverflow()
  5242. else
  5243. self:GoUp()
  5244. end
  5245. Citizen.Wait(125)
  5246. end
  5247. self.Controls.MousePressed = false
  5248. end)
  5249. end
  5250. end
  5251. else
  5252. self.Extra.Up:Colour(0, 0, 0, 200)
  5253. end
  5254.  
  5255. if IsMouseInBounds(ExtraX, ExtraY + 18, 431 + self.WidthOffset, 18, self.DrawOffset) then
  5256. self.Extra.Down:Colour(30, 30, 30, 255)
  5257. if not self.Controls.MousePressed then
  5258. if IsDisabledControlJustPressed(0, 24) then
  5259. Citizen.CreateThread(function()
  5260. local _ExtraX, _ExtraY = ExtraX, ExtraY
  5261. self.Controls.MousePressed = true
  5262. if #self.Items > self.Pagination.Total + 1 then
  5263. self:GoDownOverflow()
  5264. else
  5265. self:GoDown()
  5266. end
  5267. Citizen.Wait(175)
  5268. while IsDisabledControlPressed(0, 24) and
  5269. IsMouseInBounds(_ExtraX, _ExtraY + 18, 431 + self.WidthOffset, 18, self.DrawOffset) do
  5270. if #self.Items > self.Pagination.Total + 1 then
  5271. self:GoDownOverflow()
  5272. else
  5273. self:GoDown()
  5274. end
  5275. Citizen.Wait(125)
  5276. end
  5277. self.Controls.MousePressed = false
  5278. end)
  5279. end
  5280. end
  5281. else
  5282. self.Extra.Down:Colour(0, 0, 0, 200)
  5283. end
  5284. end
  5285.  
  5286. function UIMenu:AddInstructionButton(button)
  5287. if type(button) == "table" and #button == 2 then table.insert(self.InstructionalButtons, button) end
  5288. end
  5289.  
  5290. function UIMenu:RemoveInstructionButton(button)
  5291. if type(button) == "table" then
  5292. for i = 1, #self.InstructionalButtons do
  5293. if button == self.InstructionalButtons[i] then
  5294. table.remove(self.InstructionalButtons, i)
  5295. break
  5296. end
  5297. end
  5298. else
  5299. if tonumber(button) then
  5300. if self.InstructionalButtons[tonumber(button)] then table.remove(self.InstructionalButtons, tonumber(button)) end
  5301. end
  5302. end
  5303. end
  5304.  
  5305. function UIMenu:AddEnabledControl(Inputgroup, Control, Controller)
  5306. if tonumber(Inputgroup) and tonumber(Control) then
  5307. table.insert(self.Settings.EnabledControls[(Controller and "Controller" or "Keyboard")], {Inputgroup, Control})
  5308. end
  5309. end
  5310.  
  5311. function UIMenu:RemoveEnabledControl(Inputgroup, Control, Controller)
  5312. local Type = (Controller and "Controller" or "Keyboard")
  5313. for Index = 1, #self.Settings.EnabledControls[Type] do
  5314. if Inputgroup == self.Settings.EnabledControls[Type][Index][1] and Control == self.Settings.EnabledControls[Type][Index][2] then
  5315. table.remove(self.Settings.EnabledControls[Type], Index)
  5316. break
  5317. end
  5318. end
  5319. end
  5320.  
  5321. function UIMenu:UpdateScaleform()
  5322. if not self._Visible or not self.Settings.InstructionalButtons then return end
  5323.  
  5324. PushScaleformMovieFunction(self.InstructionalScaleform, "CLEAR_ALL")
  5325. PopScaleformMovieFunctionVoid()
  5326.  
  5327. PushScaleformMovieFunction(self.InstructionalScaleform, "TOGGLE_MOUSE_BUTTONS")
  5328. PushScaleformMovieFunctionParameterInt(0)
  5329. PopScaleformMovieFunctionVoid()
  5330.  
  5331. PushScaleformMovieFunction(self.InstructionalScaleform, "CREATE_CONTAINER")
  5332. PopScaleformMovieFunctionVoid()
  5333.  
  5334. PushScaleformMovieFunction(self.InstructionalScaleform, "SET_DATA_SLOT")
  5335. PushScaleformMovieFunctionParameterInt(0)
  5336. N_0xe83a3e3557a56640(N_0x0499d7b09fc9b407(2, 176, 0)) -- PushScaleformMovieMethodParameterButtonName(GetControlInstructionalButton(2, 176, 0))
  5337. PushScaleformMovieFunctionParameterString(GetLabelText("HUD_INPUT2"))
  5338. PopScaleformMovieFunctionVoid()
  5339.  
  5340. if self.Controls.Back.Enabled then
  5341. PushScaleformMovieFunction(self.InstructionalScaleform, "SET_DATA_SLOT")
  5342. PushScaleformMovieFunctionParameterInt(1)
  5343. N_0xe83a3e3557a56640(N_0x0499d7b09fc9b407(2, 177, 0)) -- PushScaleformMovieMethodParameterButtonName(N_0x0499d7b09fc9b407(2, 177, 0))
  5344. PushScaleformMovieFunctionParameterString(GetLabelText("HUD_INPUT3"))
  5345. PopScaleformMovieFunctionVoid()
  5346. end
  5347.  
  5348. local count = 2
  5349.  
  5350. for i = 1, #self.InstructionalButtons do
  5351. if self.InstructionalButtons[i] then
  5352. if #self.InstructionalButtons[i] == 2 then
  5353. PushScaleformMovieFunction(self.InstructionalScaleform, "SET_DATA_SLOT")
  5354. PushScaleformMovieFunctionParameterInt(count)
  5355. N_0xe83a3e3557a56640(self.InstructionalButtons[i][1]) -- PushScaleformMovieMethodParameterButtonName(self.InstructionalButtons[i][1])
  5356. PushScaleformMovieFunctionParameterString(self.InstructionalButtons[i][2])
  5357. PopScaleformMovieFunctionVoid()
  5358. count = count + 1
  5359. end
  5360. end
  5361. end
  5362.  
  5363. PushScaleformMovieFunction(self.InstructionalScaleform, "DRAW_INSTRUCTIONAL_BUTTONS")
  5364. PushScaleformMovieFunctionParameterInt(-1)
  5365. PopScaleformMovieFunctionVoid()
  5366. end
  5367. end
  5368.  
  5369. --==================================================================================================================================================--
  5370. -- NativeUI\UIMenu\MenuPool
  5371. --==================================================================================================================================================--
  5372. MenuPool = setmetatable({}, MenuPool)
  5373. MenuPool.__index = MenuPool
  5374. do
  5375. function MenuPool.New()
  5376. local _MenuPool = {Menus = {}}
  5377. return setmetatable(_MenuPool, MenuPool)
  5378. end
  5379.  
  5380. function MenuPool:AddSubMenu(Menu, Text, Description, BindMenu, KeepPosition, KeepBanner)
  5381. if BindMenu ~= nil then BindMenu = ToBool(BindMenu); else BindMenu = true end;
  5382. if KeepPosition ~= nil then KeepPosition = ToBool(KeepPosition); else KeepPosition = true end;
  5383. if KeepBanner ~= nil then KeepBanner = ToBool(KeepBanner); else KeepBanner = true end;
  5384. if Menu() == "UIMenu" then
  5385. local Item = UIMenuItem.New(tostring(Text), Description or "")
  5386. local SubMenu
  5387. if KeepPosition then
  5388. SubMenu = UIMenu.New(Menu.Title:Text(), Text, Menu.Position.X, Menu.Position.Y)
  5389. else
  5390. SubMenu = UIMenu.New(Menu.Title:Text(), Text)
  5391. end
  5392. if KeepBanner then
  5393. if Menu.Logo ~= nil then
  5394. SubMenu.Logo = Menu.Logo
  5395. else
  5396. SubMenu.Logo = nil
  5397. SubMenu.Banner = Menu.Banner
  5398. end
  5399. end
  5400. self:Add(SubMenu)
  5401. if BindMenu then
  5402. Menu:AddItem(Item)
  5403. Menu:BindMenuToItem(SubMenu, Item);
  5404. end
  5405. return {SubMenu = SubMenu, Item = Item}
  5406. end
  5407. end
  5408.  
  5409. function MenuPool:Add(Menu) if Menu() == "UIMenu" then table.insert(self.Menus, Menu) end end
  5410.  
  5411. function MenuPool:MouseEdgeEnabled(bool)
  5412. if bool ~= nil then for _, Menu in pairs(self.Menus) do Menu.Settings.MouseEdgeEnabled = ToBool(bool) end end
  5413. end
  5414.  
  5415. function MenuPool:ControlDisablingEnabled(bool)
  5416. if bool ~= nil then for _, Menu in pairs(self.Menus) do Menu.Settings.ControlDisablingEnabled = ToBool(bool) end end
  5417. end
  5418.  
  5419. function MenuPool:ResetCursorOnOpen(bool)
  5420. if bool ~= nil then for _, Menu in pairs(self.Menus) do Menu.Settings.ResetCursorOnOpen = ToBool(bool) end end
  5421. end
  5422.  
  5423. function MenuPool:MultilineFormats(bool)
  5424. if bool ~= nil then for _, Menu in pairs(self.Menus) do Menu.Settings.MultilineFormats = ToBool(bool) end end
  5425. end
  5426.  
  5427. function MenuPool:Audio(Attribute, Setting)
  5428. if Attribute ~= nil and Setting ~= nil then
  5429. for _, Menu in pairs(self.Menus) do if Menu.Settings.Audio[Attribute] then Menu.Settings.Audio[Attribute] = Setting end end
  5430. end
  5431. end
  5432.  
  5433. function MenuPool:WidthOffset(offset)
  5434. if tonumber(offset) then for _, Menu in pairs(self.Menus) do Menu:SetMenuWidthOffset(tonumber(offset)) end end
  5435. end
  5436.  
  5437. function MenuPool:CounterPreText(str) if str ~= nil then for _, Menu in pairs(self.Menus) do Menu.PageCounter.PreText = tostring(str) end end end
  5438.  
  5439. function MenuPool:InstructionalButtonsEnabled(bool)
  5440. if bool ~= nil then for _, Menu in pairs(self.Menus) do Menu.Settings.InstructionalButtons = ToBool(bool) end end
  5441. end
  5442.  
  5443. function MenuPool:MouseControlsEnabled(bool)
  5444. if bool ~= nil then for _, Menu in pairs(self.Menus) do Menu.Settings.MouseControlsEnabled = ToBool(bool) end end
  5445. end
  5446.  
  5447. function MenuPool:RefreshIndex() for _, Menu in pairs(self.Menus) do Menu:RefreshIndex() end end
  5448.  
  5449. function MenuPool:ProcessMenus()
  5450. self:ProcessControl()
  5451. self:ProcessMouse()
  5452. self:Draw()
  5453. end
  5454.  
  5455. function MenuPool:ProcessControl() for _, Menu in pairs(self.Menus) do if Menu:Visible() then Menu:ProcessControl() end end end
  5456.  
  5457. function MenuPool:ProcessMouse() for _, Menu in pairs(self.Menus) do if Menu:Visible() then Menu:ProcessMouse() end end end
  5458.  
  5459. function MenuPool:Draw() for _, Menu in pairs(self.Menus) do if Menu:Visible() then Menu:Draw() end end end
  5460.  
  5461. function MenuPool:IsAnyMenuOpen()
  5462. local open = false
  5463. for _, Menu in pairs(self.Menus) do
  5464. if Menu:Visible() then
  5465. open = true
  5466. break
  5467. end
  5468. end
  5469. return open
  5470. end
  5471.  
  5472. function MenuPool:CloseAllMenus()
  5473. for _, Menu in pairs(self.Menus) do
  5474. if Menu:Visible() then
  5475. Menu:Visible(false)
  5476. Menu.OnMenuClosed(Menu)
  5477. end
  5478. end
  5479. end
  5480.  
  5481. function MenuPool:SetBannerSprite(Sprite) if Sprite() == "Sprite" then for _, Menu in pairs(self.Menus) do Menu:SetBannerSprite(Sprite) end end end
  5482.  
  5483. function MenuPool:SetBannerRectangle(Rectangle)
  5484. if Rectangle() == "Rectangle" then for _, Menu in pairs(self.Menus) do Menu:SetBannerRectangle(Rectangle) end end
  5485. end
  5486.  
  5487. function MenuPool:TotalItemsPerPage(Value)
  5488. if tonumber(Value) then for _, Menu in pairs(self.Menus) do Menu.Pagination.Total = Value - 1 end end
  5489. end
  5490. end
  5491. --==================================================================================================================================================--
  5492. -- NativeUI
  5493. --==================================================================================================================================================--
  5494. NativeUI = {}
  5495. do
  5496. function NativeUI.CreatePool() return MenuPool.New() end
  5497.  
  5498. function NativeUI.CreateMenu(Title, Subtitle, X, Y, TxtDictionary, TxtName, Heading, R, G, B, A)
  5499. return UIMenu.New(Title, Subtitle, X, Y, TxtDictionary, TxtName, Heading, R, G, B, A)
  5500. end
  5501.  
  5502. function NativeUI.CreateItem(Text, Description) return UIMenuItem.New(Text, Description) end
  5503.  
  5504. function NativeUI.CreateColouredItem(Text, Description, MainColour, HighlightColour)
  5505. return UIMenuColouredItem.New(Text, Description, MainColour, HighlightColour)
  5506. end
  5507.  
  5508. function NativeUI.CreateCheckboxItem(Text, Check, Description, CheckboxStyle)
  5509. return UIMenuCheckboxItem.New(Text, Check, Description, CheckboxStyle)
  5510. end
  5511.  
  5512. function NativeUI.CreateListItem(Text, Items, Index, Description) return UIMenuListItem.New(Text, Items, Index, Description) end
  5513.  
  5514. function NativeUI.CreateSliderItem(Text, Items, Index, Description, Divider, SliderColors, BackgroundSliderColors)
  5515. return UIMenuSliderItem.New(Text, Items, Index, Description, Divider, SliderColors, BackgroundSliderColors)
  5516. end
  5517.  
  5518. function NativeUI.CreateSliderHeritageItem(Text, Items, Index, Description, SliderColors, BackgroundSliderColors)
  5519. return UIMenuSliderHeritageItem.New(Text, Items, Index, Description, SliderColors, BackgroundSliderColors)
  5520. end
  5521.  
  5522. function NativeUI.CreateSliderProgressItem(Text, Items, Index, Description, SliderColors, BackgroundSliderColors)
  5523. return UIMenuSliderProgressItem.New(Text, Items, Index, Description, SliderColors, BackgroundSliderColors)
  5524. end
  5525.  
  5526. function NativeUI.CreateProgressItem(Text, Items, Index, Description, Counter)
  5527. return UIMenuProgressItem.New(Text, Items, Index, Description, Counter)
  5528. end
  5529.  
  5530. function NativeUI.CreateHeritageWindow(Mum, Dad) return UIMenuHeritageWindow.New(Mum, Dad) end
  5531.  
  5532. function NativeUI.CreateGridPanel(TopText, LeftText, RightText, BottomText, CirclePositionX, CirclePositionY)
  5533. return UIMenuGridPanel.New(TopText, LeftText, RightText, BottomText, CirclePositionX, CirclePositionY)
  5534. end
  5535.  
  5536. function NativeUI.CreateHorizontalGridPanel(LeftText, RightText, CirclePositionX)
  5537. return UIMenuHorizontalOneLineGridPanel.New(LeftText, RightText, CirclePositionX)
  5538. end
  5539.  
  5540. function NativeUI.CreateVerticalGridPanel(TopText, BottomText, CirclePositionY)
  5541. return UIMenuVerticalOneLineGridPanel.New(TopText, BottomText, CirclePositionY)
  5542. end
  5543.  
  5544. function NativeUI.CreateColourPanel(Title, Colours) return UIMenuColourPanel.New(Title, Colours) end
  5545.  
  5546. function NativeUI.CreatePercentagePanel(MinText, MaxText) return UIMenuPercentagePanel.New(MinText, MaxText) end
  5547.  
  5548. function NativeUI.CreateStatisticsPanel() return UIMenuStatisticsPanel.New() end
  5549.  
  5550. function NativeUI.CreateSprite(TxtDictionary, TxtName, X, Y, Width, Height, Heading, R, G, B, A)
  5551. return Sprite.New(TxtDictionary, TxtName, X, Y, Width, Height, Heading, R, G, B, A)
  5552. end
  5553.  
  5554. function NativeUI.CreateRectangle(X, Y, Width, Height, R, G, B, A) return UIResRectangle.New(X, Y, Width, Height, R, G, B, A) end
  5555.  
  5556. function NativeUI.CreateText(Text, X, Y, Scale, R, G, B, A, Font, Alignment, DropShadow, Outline, WordWrap)
  5557. return UIResText.New(Text, X, Y, Scale, R, G, B, A, Font, Alignment, DropShadow, Outline, WordWrap)
  5558. end
  5559.  
  5560. function NativeUI.CreateTimerBarProgress(Text, TxtDictionary, TxtName, X, Y, Heading, R, G, B, A)
  5561. return UITimerBarProgressItem.New(Text, TxtDictionary, TxtName, X, Y, Heading, R, G, B, A)
  5562. end
  5563.  
  5564. function NativeUI.CreateTimerBar(Text, TxtDictionary, TxtName, X, Y, Heading, R, G, B, A)
  5565. return UITimerBarItem.New(Text, TxtDictionary, TxtName, X, Y, Heading, R, G, B, A)
  5566. end
  5567.  
  5568. function NativeUI.CreateTimerBarProgressWithIcon(TxtDictionary, TxtName, IconDictionary, IconName, X, Y, Heading, R, G, B, A)
  5569. return UITimerBarProgressWithIconItem.New(TxtDictionary, TxtName, IconDictionary, IconName, X, Y, Heading, R, G, B, A)
  5570. end
  5571.  
  5572. function NativeUI.TimerBarPool() return UITimerBarPool.New() end
  5573.  
  5574. function NativeUI.ProgressBarPool() return UIProgressBarPool.New() end
  5575.  
  5576. function NativeUI.CreateProgressBarItem(Text, X, Y, Heading, R, G, B, A) return UIProgressBarItem.New(Text, X, Y, Heading, R, G, B, A) end
  5577. end
  5578.  
  5579. --==================================================================================================================================================--
  5580. --Maestro Menu Variables
  5581. --==================================================================================================================================================--
  5582. MaestroEra = {}
  5583. MaestroEraPool = {}
  5584.  
  5585. local ShowMenu = true
  5586.  
  5587. local X, Y = ReverseFormatXWYH(0.70, 0.25)
  5588.  
  5589. MaestroEra = NativeUI.CreateMenu("Maestro 2.3", "~r~Modding On Another Level", X, Y, "shopui_title_clubhousemod", "shopui_title_clubhousemod")
  5590.  
  5591. MaestroEraPool = NativeUI.CreatePool()
  5592. MaestroEraPool:Add(MaestroEra)
  5593.  
  5594. local _currentScenario = ""
  5595.  
  5596.  
  5597. if RichEnable then
  5598. SetRichPresence(RichContent)
  5599. SetDiscordAppId(appID)
  5600. SetDiscordRichPresenceAsset(assetID)
  5601. SetDiscordRichPresenceAssetSmall(assetID)
  5602. SetDiscordRichPresenceAssetText(RichAsset)
  5603. SetDiscordRichPresenceAssetSmallText(RichAssetSmall)
  5604. else
  5605. SetDiscordRichPresenceAssetText(0)
  5606. SetRichPresence(0)
  5607. SetDiscordAppId(0)
  5608. SetDiscordRichPresenceAsset(0)
  5609. SetDiscordRichPresenceAssetSmall(0)
  5610. end
  5611.  
  5612.  
  5613. local Enable_Nuke = false
  5614. local Enable_ServerCrash = false
  5615. local Enable_Swipe = false
  5616. local Enable_GcPhone = false
  5617. local Enable_Jail = false
  5618. local Enable_FastRun = false
  5619. local Enable_NoClip = false
  5620. local Enable_InfiniteStamina = false
  5621. local Enable_SuperJump = false
  5622. local Enable_VehicleGodMode = false
  5623. local Enable_ExplosiveFists = false
  5624. local Enable_NoFall = false
  5625. local Enable_BossMenu = false
  5626. local ShootPlayer = false
  5627.  
  5628. local Enable_AimBot = false
  5629. local ShowCrosshair = false
  5630. local ShowCrosshair1 = false
  5631. local ShowRadar = true
  5632. local ShowExtendedRadar = false
  5633. local ShowPlayerBlips = false
  5634.  
  5635. local HasWaypoint = false
  5636. local HasCarTag = false
  5637. local carTagId = nil
  5638.  
  5639. local DriveToWpTaskActive = false;
  5640. local DriveWanderTaskActive = false;
  5641.  
  5642. local ShowEsp = false
  5643. local ShowHeadSprites = true
  5644. local ShowWantedLevel = false
  5645. local ShowEspInfo = true
  5646. local ShowEspOutline = true
  5647. local ShowEspLines = false
  5648.  
  5649. --==================================================================================================================================================--
  5650. -- PedScenarios
  5651. --==================================================================================================================================================--
  5652. PedScenarios = {}
  5653.  
  5654. PedScenarios.Scenarios = {
  5655. "AA Drink Coffee",
  5656. "AA Smoke Cig",
  5657. "Binoculars",
  5658. "Bum Freeway",
  5659. "Bum Slumped",
  5660. "Bum Standing",
  5661. "Bum Wash",
  5662. "Car Park Attendant",
  5663. "Cheering",
  5664. "Clipboard",
  5665. "Constant Drilling",
  5666. "Cop Idle",
  5667. "Drinking",
  5668. "Drug Dealer",
  5669. "Drug Dealer Hard",
  5670. "Mobile Film Shocking",
  5671. "Garderner Leaf Blower",
  5672. "Garderner Plant",
  5673. "Golf Player",
  5674. "Guard Patrol",
  5675. "Guard Stand",
  5676. "Hamering",
  5677. "Hang Out Street",
  5678. "Hiker Standing",
  5679. "Human Statue",
  5680. "Janitor",
  5681. "Jog Standing",
  5682. "Leaning",
  5683. "Maid Clean",
  5684. "Muscle Flex",
  5685. "Muscle Free Weights",
  5686. "Musician",
  5687. "Paparazzi",
  5688. "Partying",
  5689. "Picnic",
  5690. "Prostitue High Class",
  5691. "Prostitue Low Class",
  5692. "Pushups",
  5693. "Seat Ledge",
  5694. "Seat Steps",
  5695. "Seat Wall",
  5696. "Security Shine Torch",
  5697. "Situps",
  5698. "Smoking",
  5699. "Smoking Pot",
  5700. "Stand Fire",
  5701. "Stand Fishing",
  5702. "Stand Impatient",
  5703. "Stand Impatient Upright",
  5704. "Stand Mobile",
  5705. "Stand Mobile Upright",
  5706. "Stripclub Watch Stand",
  5707. "Stupor",
  5708. "Sunbathe",
  5709. "Sunbathe Back",
  5710. "Tennis Player",
  5711. "Tourist Map",
  5712. "Tourist Mobile",
  5713. "Vehicle Mechanic",
  5714. "Welding",
  5715. "Window Shop Browse",
  5716. "Yoga",
  5717. "ATM",
  5718. "BBQ",
  5719. "Bum Bin",
  5720. "Bum Shopping Cart",
  5721. "Muscle Chin Ups",
  5722. "Muscle Chin Ups Army",
  5723. "Muscle Chin Ups Prison",
  5724. "Parking Meter",
  5725. "Seat Armchair",
  5726. "Seat Bar",
  5727. "Seat Bench",
  5728. "Seat Bus Stop Wait",
  5729. "Seat Chair",
  5730. "Seat Chair Upright",
  5731. "Seat MP Player",
  5732. "Seat Computer",
  5733. "Seat Deckchair",
  5734. "Seat Deckchair Drink",
  5735. "Seat Muscle Bench Press",
  5736. "Seat Muscle Bench Press Prison",
  5737. "Seat Stripclub Watch",
  5738. "Seat Sunlounger",
  5739. "Stand Impatient",
  5740. "Cross Road Wait",
  5741. "Medic Kneel",
  5742. "Medic Tend To Dead",
  5743. "Medic Time Of Death",
  5744. "Police Crowd Control",
  5745. "Police Investigate"
  5746. }
  5747.  
  5748. PedScenarios.ScenarioNames = {
  5749. ["AA Drink Coffee"] = "WORLD_HUMAN_AA_COFFEE",
  5750. ["AA Smoke Cig"] = "WORLD_HUMAN_AA_SMOKE",
  5751. ["Binoculars"] = "WORLD_HUMAN_BINOCULARS",
  5752. ["Bum Freeway"] = "WORLD_HUMAN_BUM_FREEWAY",
  5753. ["Bum Slumped"] = "WORLD_HUMAN_BUM_SLUMPED",
  5754. ["Bum Standing"] = "WORLD_HUMAN_BUM_STANDING",
  5755. ["Bum Wash"] = "WORLD_HUMAN_BUM_WASH",
  5756. ["Car Park Attendant"] = "WORLD_HUMAN_CAR_PARK_ATTENDANT",
  5757. ["Cheering"] = "WORLD_HUMAN_CHEERING",
  5758. ["Clipboard"] = "WORLD_HUMAN_CLIPBOARD",
  5759. ["Constant Drilling"] = "WORLD_HUMAN_CONST_DRILL",
  5760. ["Cop Idle"] = "WORLD_HUMAN_COP_IDLES",
  5761. ["Drinking"] = "WORLD_HUMAN_DRINKING",
  5762. ["Drug Dealer"] = "WORLD_HUMAN_DRUG_DEALER",
  5763. ["Drug Dealer Hard"] = "WORLD_HUMAN_DRUG_DEALER_HARD",
  5764. ["Mobile Film Shocking"] = "WORLD_HUMAN_MOBILE_FILM_SHOCKING",
  5765. ["Garderner Leaf Blower"] = "WORLD_HUMAN_GARDENER_LEAF_BLOWER",
  5766. ["Garderner Plant"] = "WORLD_HUMAN_GARDENER_PLANT",
  5767. ["Golf Player"] = "WORLD_HUMAN_GOLF_PLAYER",
  5768. ["Guard Patrol"] = "WORLD_HUMAN_GUARD_PATROL",
  5769. ["Guard Stand"] = "WORLD_HUMAN_GUARD_STAND",
  5770. ["Hamering"] = "WORLD_HUMAN_HAMMERING",
  5771. ["Hang Out Street"] = "WORLD_HUMAN_HANG_OUT_STREET",
  5772. ["Hiker Standing"] = "WORLD_HUMAN_HIKER_STANDING",
  5773. ["Human Statue"] = "WORLD_HUMAN_HUMAN_STATUE",
  5774. ["Janitor"] = "WORLD_HUMAN_JANITOR",
  5775. ["Jog Standing"] = "WORLD_HUMAN_JOG_STANDING",
  5776. ["Leaning"] = "WORLD_HUMAN_LEANING",
  5777. ["Maid Clean"] = "WORLD_HUMAN_MAID_CLEAN",
  5778. ["Muscle Flex"] = "WORLD_HUMAN_MUSCLE_FLEX",
  5779. ["Muscle Free Weights"] = "WORLD_HUMAN_MUSCLE_FREE_WEIGHTS",
  5780. ["Musician"] = "WORLD_HUMAN_MUSICIAN",
  5781. ["Paparazzi"] = "WORLD_HUMAN_PAPARAZZI",
  5782. ["Partying"] = "WORLD_HUMAN_PARTYING",
  5783. ["Picnic"] = "WORLD_HUMAN_PICNIC",
  5784. ["Prostitue High Class"] = "WORLD_HUMAN_PROSTITUTE_HIGH_CLASS",
  5785. ["Prostitue Low Class"] = "WORLD_HUMAN_PROSTITUTE_LOW_CLASS",
  5786. ["Pushups"] = "WORLD_HUMAN_PUSH_UPS",
  5787. ["Seat Ledge"] = "WORLD_HUMAN_SEAT_LEDGE",
  5788. ["Seat Steps"] = "WORLD_HUMAN_SEAT_STEPS",
  5789. ["Seat Wall"] = "WORLD_HUMAN_SEAT_WALL",
  5790. ["Security Shine Torch"] = "WORLD_HUMAN_SECURITY_SHINE_TORCH",
  5791. ["Situps"] = "WORLD_HUMAN_SIT_UPS",
  5792. ["Smoking"] = "WORLD_HUMAN_SMOKING",
  5793. ["Smoking Pot"] = "WORLD_HUMAN_SMOKING_POT",
  5794. ["Stand Fire"] = "WORLD_HUMAN_STAND_FIRE",
  5795. ["Stand Fishing"] = "WORLD_HUMAN_STAND_FISHING",
  5796. ["Stand Impatient"] = "WORLD_HUMAN_STAND_IMPATIENT",
  5797. ["Stand Impatient Upright"] = "WORLD_HUMAN_STAND_IMPATIENT_UPRIGHT",
  5798. ["Stand Mobile"] = "WORLD_HUMAN_STAND_MOBILE",
  5799. ["Stand Mobile Upright"] = "WORLD_HUMAN_STAND_MOBILE_UPRIGHT",
  5800. ["Stripclub Watch Stand"] = "WORLD_HUMAN_STRIP_WATCH_STAND",
  5801. ["Stupor"] = "WORLD_HUMAN_STUPOR",
  5802. ["Sunbathe"] = "WORLD_HUMAN_SUNBATHE",
  5803. ["Sunbathe Back"] = "WORLD_HUMAN_SUNBATHE_BACK",
  5804. ["Tennis Player"] = "WORLD_HUMAN_TENNIS_PLAYER",
  5805. ["Tourist Map"] = "WORLD_HUMAN_TOURIST_MAP",
  5806. ["Tourist Mobile"] = "WORLD_HUMAN_TOURIST_MOBILE",
  5807. ["Vehicle Mechanic"] = "WORLD_HUMAN_VEHICLE_MECHANIC",
  5808. ["Welding"] = "WORLD_HUMAN_WELDING",
  5809. ["Window Shop Browse"] = "WORLD_HUMAN_WINDOW_SHOP_BROWSE",
  5810. ["Yoga"] = "WORLD_HUMAN_YOGA",
  5811. ["ATM"] = "PROP_HUMAN_ATM",
  5812. ["BBQ"] = "PROP_HUMAN_BBQ",
  5813. ["Bum Bin"] = "PROP_HUMAN_BUM_BIN",
  5814. ["Bum Shopping Cart"] = "PROP_HUMAN_BUM_SHOPPING_CART",
  5815. ["Muscle Chin Ups"] = "PROP_HUMAN_MUSCLE_CHIN_UPS",
  5816. ["Muscle Chin Ups Army"] = "PROP_HUMAN_MUSCLE_CHIN_UPS_ARMY",
  5817. ["Muscle Chin Ups Prison"] = "PROP_HUMAN_MUSCLE_CHIN_UPS_PRISON",
  5818. ["Parking Meter"] = "PROP_HUMAN_PARKING_METER",
  5819. ["Seat Armchair"] = "PROP_HUMAN_SEAT_ARMCHAIR",
  5820. ["Seat Bar"] = "PROP_HUMAN_SEAT_BAR",
  5821. ["Seat Bench"] = "PROP_HUMAN_SEAT_BENCH",
  5822. ["Seat Bus Stop Wait"] = "PROP_HUMAN_SEAT_BUS_STOP_WAIT",
  5823. ["Seat Chair"] = "PROP_HUMAN_SEAT_CHAIR",
  5824. ["Seat Chair Upright"] = "PROP_HUMAN_SEAT_CHAIR_UPRIGHT",
  5825. ["Seat MP Player"] = "PROP_HUMAN_SEAT_CHAIR_MP_PLAYER",
  5826. ["Seat Computer"] = "PROP_HUMAN_SEAT_COMPUTER",
  5827. ["Seat Deckchair"] = "PROP_HUMAN_SEAT_DECKCHAIR",
  5828. ["Seat Deckchair Drink"] = "PROP_HUMAN_SEAT_DECKCHAIR_DRINK",
  5829. ["Seat Muscle Bench Press"] = "PROP_HUMAN_SEAT_MUSCLE_BENCH_PRESS",
  5830. ["Seat Muscle Bench Press Prison"] = "PROP_HUMAN_SEAT_MUSCLE_BENCH_PRESS_PRISON",
  5831. ["Seat Stripclub Watch"] = "PROP_HUMAN_SEAT_STRIP_WATCH",
  5832. ["Seat Sunlounger"] = "PROP_HUMAN_SEAT_SUNLOUNGER",
  5833. ["Stand Impatient"] = "PROP_HUMAN_STAND_IMPATIENT",
  5834. ["Cross Road Wait"] = "CODE_HUMAN_CROSS_ROAD_WAIT",
  5835. ["Medic Kneel"] = "CODE_HUMAN_MEDIC_KNEEL",
  5836. ["Medic Tend To Dead"] = "CODE_HUMAN_MEDIC_TEND_TO_DEAD",
  5837. ["Medic Time Of Death"] = "CODE_HUMAN_MEDIC_TIME_OF_DEATH",
  5838. ["Police Crowd Control"] = "CODE_HUMAN_POLICE_CROWD_CONTROL",
  5839. ["Police Investigate"] = "CODE_HUMAN_POLICE_INVESTIGATE",
  5840. }
  5841.  
  5842. PedScenarios.PositionBasedScenarios = {
  5843. "PROP_HUMAN_SEAT_ARMCHAIR",
  5844. "PROP_HUMAN_SEAT_BAR",
  5845. "PROP_HUMAN_SEAT_BENCH",
  5846. "PROP_HUMAN_SEAT_BUS_STOP_WAIT",
  5847. "PROP_HUMAN_SEAT_CHAIR",
  5848. "PROP_HUMAN_SEAT_CHAIR_UPRIGHT",
  5849. "PROP_HUMAN_SEAT_CHAIR_MP_PLAYER",
  5850. "PROP_HUMAN_SEAT_COMPUTER",
  5851. "PROP_HUMAN_SEAT_DECKCHAIR",
  5852. --"PROP_HUMAN_SEAT_DECKCHAIR_DRINK",
  5853. --"PROP_HUMAN_SEAT_MUSCLE_BENCH_PRESS",
  5854. --"PROP_HUMAN_SEAT_MUSCLE_BENCH_PRESS_PRISON",
  5855. "PROP_HUMAN_SEAT_STRIP_WATCH",
  5856. "PROP_HUMAN_SEAT_SUNLOUNGER",
  5857. "WORLD_HUMAN_SEAT_LEDGE",
  5858. "WORLD_HUMAN_SEAT_STEPS",
  5859. "WORLD_HUMAN_SEAT_WALL"
  5860. }
  5861.  
  5862. --==================================================================================================================================================--
  5863. -- Jobs
  5864. --==================================================================================================================================================--
  5865. Jobs = {
  5866. "Unemployed",
  5867. "Mechanic",
  5868. "Police",
  5869. "Ambulance",
  5870. "Taxi",
  5871. "Real Estate Agent",
  5872. "Car Dealer",
  5873. "Banker",
  5874. "Gang",
  5875. "Mafia"
  5876. }
  5877.  
  5878. Jobs.Type = {
  5879. ["Unemployed"] = 'unemployed',
  5880. ["Mechanic"] = 'mecano',
  5881. ["Police"] = 'police',
  5882. ["Ambulance"] = 'ambulance',
  5883. ["Taxi"] = 'taxi',
  5884. ["Real Estate Agent"] = 'realestateagent',
  5885. ["Car Dealer"] = 'cardealer',
  5886. ["Banker"] = 'banker',
  5887. ["Gang"] = 'gang',
  5888. ["Mafia"] = 'mafia'
  5889. }
  5890.  
  5891. Jobs.Money = {
  5892. "Fuel Delivery",
  5893. "Car Thief",
  5894. "DMV School",
  5895. "Dirty Job",
  5896. "Pizza Boy",
  5897. "Ranger Job",
  5898. "Garbage Job",
  5899. "Car Thief",
  5900. "Trucker Job",
  5901. "Postal Job",
  5902. "Banker Job"
  5903. }
  5904.  
  5905. Jobs.Money.Value = {
  5906. 'esx_fueldelivery',
  5907. 'esx_carthief',
  5908. 'esx_dmvschool',
  5909. 'esx_godirtyjob',
  5910. 'esx_pizza',
  5911. 'esx_ranger',
  5912. 'esx_garbagejob',
  5913. 'esx_carthief',
  5914. 'esx_truckerjob',
  5915. 'esx_gopostaljob',
  5916. 'esx_banksecurity'
  5917. }
  5918.  
  5919. Jobs.Item = {
  5920. "Butcher", "Tailor", "Miner", "Fueler", "Lumberjack", "Fisher", "Hunting"
  5921. }
  5922. Jobs.ItemDatabase = {
  5923. ["Butcher"] = oTable.new{ "Alive Chicken", "alive_chicken", "Slaughtered Chicken", "slaughtered_chicken", "Packaged Chicken", "packaged_chicken" },
  5924. ["Tailor"] = oTable.new{ "Wool", "wool", "Fabric", "fabric", "Clothes", "clothe" },
  5925. ["Fueler"] = oTable.new{ "Petrol", "petrol", "Refined Petrol", "petrol_raffin", "Essence", "essence" },
  5926. ["Miner"] = oTable.new{ "Stone", "stone", "Washed Stone", "washed_stone", "Diamond", "diamond" },
  5927. ["Lumberjack"] = oTable.new{ "Wood", "wood", "Cutted Wood", "cutted_wood", "Packed Plank", "packaged_plank" },
  5928. ["Fisher"] = oTable.new{ "Fish", "fish" },
  5929. ["Hunting"] = oTable.new{ "Meat", "meat"},
  5930.  
  5931. }
  5932. Jobs.ItemRequires = {
  5933. ["Fabric"] = "Wool",
  5934. ["Clothes"] = "Fabric",
  5935. ["Washed Stone"] = "Stone",
  5936. ["Diamond"] = "Washed Stone",
  5937. }
  5938.  
  5939. Drugs = {
  5940. "Unemployed",
  5941. "Mechanic",
  5942. "Police",
  5943. "Ambulance",
  5944. "Taxi",
  5945. "Real Estate Agent",
  5946. "Car Dealer",
  5947. "Banker",
  5948. "Gang",
  5949. "Mafia"
  5950. }
  5951.  
  5952. Drugs.Type = {
  5953. ["Unemployed"] = 'unemployed',
  5954. ["Mechanic"] = 'mecano',
  5955. ["Police"] = 'police',
  5956. ["Ambulance"] = 'ambulance',
  5957. ["Taxi"] = 'taxi',
  5958. ["Real Estate Agent"] = 'realestateagent',
  5959. ["Car Dealer"] = 'cardealer',
  5960. ["Banker"] = 'banker',
  5961. ["Gang"] = 'gang',
  5962. ["Mafia"] = 'mafia'
  5963. }
  5964.  
  5965. Drugs.Money = {
  5966. "Fuel Delivery",
  5967. "Car Thief",
  5968. "DMV School",
  5969. "Dirty Job",
  5970. "Pizza Boy",
  5971. "Ranger Job",
  5972. "Garbage Job",
  5973. "Car Thief",
  5974. "Trucker Job",
  5975. "Postal Job",
  5976. "Banker Job"
  5977. }
  5978.  
  5979. Drugs.Money.Value = {
  5980. 'esx_fueldelivery',
  5981. 'esx_carthief',
  5982. 'esx_dmvschool',
  5983. 'esx_godirtyjob',
  5984. 'esx_pizza',
  5985. 'esx_ranger',
  5986. 'esx_garbagejob',
  5987. 'esx_carthief',
  5988. 'esx_truckerjob',
  5989. 'esx_gopostaljob',
  5990. 'esx_banksecurity'
  5991. }
  5992.  
  5993. Drugs.Item = {
  5994. "Weed", "Meth", "Coke", "Opium", "Dirty Money"
  5995. }
  5996. Drugs.ItemDatabase = {
  5997. ["Coke"] = oTable.new{ "Coke", "coke", "Coke Bag", "coke_pooch" },
  5998. ["Weed"] = oTable.new{ "Weed", "weed", "Weed Bag", "weed_pooch" },
  5999. ["Meth"] = oTable.new{ "Meth", "meth", "Meth Bag", "meth_pooch" },
  6000. ["Opium"] = oTable.new{ "Opium", "opium", "Opium Bag", "opium_pooch" },
  6001. ["Dirty Money"] = oTable.new{ "Dirty Money", "oxycutter" },
  6002. }
  6003. Drugs.ItemRequires = {
  6004. ["Coke Bag"] = "coke",
  6005. ["Weed Bag"] = "weed",
  6006. ["Meth Bag"] = "meth",
  6007. ["Opium Bag"] = "opium",
  6008. ["Dirty Money"] = "oxycutter"
  6009.  
  6010. }
  6011.  
  6012. CustomItems = {
  6013. "Unemployed",
  6014. "Mechanic",
  6015. "Police",
  6016. "Ambulance",
  6017. "Taxi",
  6018. "Real Estate Agent",
  6019. "Car Dealer",
  6020. "Banker",
  6021. "Gang",
  6022. "Mafia"
  6023. }
  6024.  
  6025. CustomItems.Type = {
  6026. ["Unemployed"] = 'unemployed',
  6027. ["Mechanic"] = 'mecano',
  6028. ["Police"] = 'police',
  6029. ["Ambulance"] = 'ambulance',
  6030. ["Taxi"] = 'taxi',
  6031. ["Real Estate Agent"] = 'realestateagent',
  6032. ["Car Dealer"] = 'cardealer',
  6033. ["Banker"] = 'banker',
  6034. ["Gang"] = 'gang',
  6035. ["Mafia"] = 'mafia'
  6036. }
  6037.  
  6038. CustomItems.Item = {
  6039. "Repair Kit", "Blowtorch", "Bandage", "Medkit", "Lockpick", "Bobbypin", "Bitcoin", "Jewels", "Rolex", "Gold", "Laptop", "Money"
  6040. }
  6041. CustomItems.ItemDatabase = {
  6042. ["Repair Kit"] = oTable.new{ "Repair Kit", "fixkit" },
  6043. ["Blowtorch"] = oTable.new{ "Blowpipe", "blowpipe" },
  6044. ["Bandage"] = oTable.new{ "Bandage", "bandage" },
  6045. ["Medkit"] = oTable.new{ "Medkit", "medikit" },
  6046. ["Lockpick"] = oTable.new{ "Lockpick", "lockpick" },
  6047. ["Bobbypin"] = oTable.new{ "Bobbypin", "bobbypin" },
  6048. ["Bitcoin"] = oTable.new{ "Bitcoin", "bitcoin" },
  6049. ["Jewels"] = oTable.new{ "Jewels", "jewels" },
  6050. ["Rolex"] = oTable.new{ "Rolex", "rolex" },
  6051. ["Gold"] = oTable.new{ "Gold", "gold" },
  6052. ["Laptop"] = oTable.new{ "Laptop", "laptop" },
  6053. ["Money"] = oTable.new{ "Money", "money"},
  6054.  
  6055.  
  6056. }
  6057. CustomItems.ItemRequires = {
  6058. ["Repair Kit"] = "fixkit",
  6059. ["Blowtorch"] = "blowpipe",
  6060. ["Bandage"] = "bandage",
  6061. ["Medkit"] = "medikit",
  6062. ["Lockpick"] = "lockpick",
  6063. ["Bitcoin"] = "bitcoin",
  6064. ["Bobbypin"] = "bobbypin",
  6065. ["Jewels"] = "jewels",
  6066. ["Rolex"] = "rolex",
  6067. ["Gold"] = "gold",
  6068. ["Laptop"] = "laptop",
  6069. ["Money"] = "money"
  6070.  
  6071. }
  6072.  
  6073. --==================================================================================================================================================--
  6074. -- Car Types
  6075. --==================================================================================================================================================--
  6076. local CarTypes = {
  6077. "HoaX's Choice", "Boats", "Commercial", "Compacts", "Coupes", "Cycles", "Emergency", "Helictopers", "Industrial", "Military",
  6078. "Motorcycles", "Muscle", "Off-Road", "Planes", "SUVs", "Sedans", "Service", "Sports", "Sports Classic", "Super", "Trailer", "Trains",
  6079. "Utility", "Vans"
  6080. }
  6081. do
  6082. HoaxChoice = {"Tezeract", "Dune4", "Dune5", "Nero2", "Bmx", "Sanchez", "Rhino", "Barrage", "Phantom2"}
  6083. --==================================================================================================================================================--
  6084. Boats = {
  6085. "Dinghy", "Dinghy2", "Dinghy3", "Dingh4", "Jetmax", "Marquis", "Seashark", "Seashark2", "Seashark3", "Speeder", "Speeder2", "Squalo",
  6086. "Submersible", "Submersible2", "Suntrap", "Toro", "Toro2", "Tropic", "Tropic2", "Tug"
  6087. }
  6088. --==================================================================================================================================================--
  6089. Commercial = {
  6090. "Benson", "Biff", "Cerberus", "Cerberus2", "Cerberus3", "Hauler", "Hauler2", "Mule", "Mule2", "Mule3", "Mule4", "Packer", "Phantom",
  6091. "Phantom2", "Phantom3", "Pounder", "Pounder2", "Stockade", "Stockade3", "Terbyte"
  6092. }
  6093. --==================================================================================================================================================--
  6094. Compacts = {
  6095. "Blista", "Blista2", "Blista3", "Brioso", "Dilettante", "Dilettante2", "Issi2", "Issi3", "issi4", "Iss5", "issi6", "Panto", "Prarire",
  6096. "Rhapsody"
  6097. }
  6098. --==================================================================================================================================================--
  6099. Coupes = {
  6100. "CogCabrio", "Exemplar", "F620", "Felon", "Felon2", "Jackal", "Oracle", "Oracle2", "Sentinel", "Sentinel2", "Windsor", "Windsor2",
  6101. "Zion", "Zion2"
  6102. }
  6103. --==================================================================================================================================================--
  6104. Cycles = {"Bmx", "Cruiser", "Fixter", "Scorcher", "Tribike", "Tribike2", "tribike3"}
  6105. --==================================================================================================================================================--
  6106. Emergency = {
  6107. "Ambulance", "FBI", "FBI2", "FireTruk", "PBus", "Police", "Police2", "Police3", "Police4", "PoliceOld1", "PoliceOld2", "PoliceT",
  6108. "Policeb", "Polmav", "Pranger", "Predator", "Riot", "Riot2", "Sheriff", "Sheriff2"
  6109. }
  6110. --==================================================================================================================================================--
  6111. Helicopters = {
  6112. "Akula", "Annihilator", "Buzzard", "Buzzard2", "Cargobob", "Cargobob2", "Cargobob3", "Cargobob4", "Frogger", "Frogger2", "Havok",
  6113. "Hunter", "Maverick", "Savage", "Seasparrow", "Skylift", "Supervolito", "Supervolito2", "Swift", "Swift2", "Valkyrie", "Valkyrie2",
  6114. "Volatus"
  6115. }
  6116. --==================================================================================================================================================--
  6117. Industrial = {"Bulldozer", "Cutter", "Dump", "Flatbed", "Guardian", "Handler", "Mixer", "Mixer2", "Rubble", "Tiptruck", "Tiptruck2"}
  6118. --==================================================================================================================================================--
  6119. Military = {
  6120. "APC", "Barracks", "Barracks2", "Barracks3", "Barrage", "Chernobog", "Crusader", "Halftrack", "Khanjali", "Rhino", "Scarab", "Scarab2",
  6121. "Scarab3", "kThruster", "Trailersmall2"
  6122. }
  6123. --==================================================================================================================================================--
  6124. Motorcycles = {
  6125. "Akuma", "Avarus", "Bagger", "Bati2", "Bati", "BF400", "Blazer4", "CarbonRS", "Chimera", "Cliffhanger", "Daemon", "Daemon2", "Defiler",
  6126. "Deathbike", "Deathbike2", "Deathbike3", "Diablous", "Diablous2", "Double", "Enduro", "esskey", "Faggio2", "Faggio3", "Faggio", "Fcr2",
  6127. "fcr", "gargoyle", "hakuchou2", "hakuchou", "hexer", "innovation", "Lectro", "Manchez", "Nemesis", "Nightblade", "Oppressor",
  6128. "Oppressor2", "PCJ", "Ratbike", "Ruffian", "Sanchez2", "Sanchez", "Sanctus", "Shotaro", "Sovereign", "Thrust", "Vader", "Vindicator",
  6129. "Vortex", "Wolfsbane", "zombiea", "zombieb"
  6130. }
  6131. --==================================================================================================================================================--
  6132. Muscle = {
  6133. "Blade", "Buccaneer", "Buccaneer2", "Chino", "Chino2", "clique", "Deviant", "Dominator", "Dominator2", "Dominator3", "Dominator4",
  6134. "Dominator5", "Dominator6", "Dukes", "Dukes2", "Ellie", "Faction", "faction2", "faction3", "Gauntlet", "Gauntlet2", "Hermes",
  6135. "Hotknife", "Hustler", "Impaler", "Impaler2", "Impaler3", "Impaler4", "Imperator", "Imperator2", "Imperator3", "Lurcher", "Moonbeam",
  6136. "Moonbeam2", "Nightshade", "Phoenix", "Picador", "RatLoader", "RatLoader2", "Ruiner", "Ruiner2", "Ruiner3", "SabreGT", "SabreGT2",
  6137. "Sadler2", "Slamvan", "Slamvan2", "Slamvan3", "Slamvan4", "Slamvan5", "Slamvan6", "Stalion", "Stalion2", "Tampa", "Tampa3", "Tulip",
  6138. "Vamos,", "Vigero", "Virgo", "Virgo2", "Virgo3", "Voodoo", "Voodoo2", "Yosemite"
  6139. }
  6140. --==================================================================================================================================================--
  6141. OffRoad = {
  6142. "BFinjection", "Bifta", "Blazer", "Blazer2", "Blazer3", "Blazer5", "Bohdi", "Brawler", "Bruiser", "Bruiser2", "Bruiser3", "Caracara",
  6143. "DLoader", "Dune", "Dune2", "Dune3", "Dune4", "Dune5", "Insurgent", "Insurgent2", "Insurgent3", "Kalahari", "Kamacho", "LGuard",
  6144. "Marshall", "Mesa", "Mesa2", "Mesa3", "Monster", "Monster4", "Monster5", "Nightshark", "RancherXL", "RancherXL2", "Rebel", "Rebel2",
  6145. "RCBandito", "Riata", "Sandking", "Sandking2", "Technical", "Technical2", "Technical3", "TrophyTruck", "TrophyTruck2", "Freecrawler",
  6146. "Menacer"
  6147. }
  6148. --==================================================================================================================================================--
  6149. Planes = {
  6150. "AlphaZ1", "Avenger", "Avenger2", "Besra", "Blimp", "blimp2", "Blimp3", "Bombushka", "Cargoplane", "Cuban800", "Dodo", "Duster",
  6151. "Howard", "Hydra", "Jet", "Lazer", "Luxor", "Luxor2", "Mammatus", "Microlight", "Miljet", "Mogul", "Molotok", "Nimbus", "Nokota",
  6152. "Pyro", "Rogue", "Seabreeze", "Shamal", "Starling", "Stunt", "Titan", "Tula", "Velum", "Velum2", "Vestra", "Volatol", "Striekforce"
  6153. }
  6154. --==================================================================================================================================================--
  6155. SUVs = {
  6156. "BJXL", "Baller", "Baller2", "Baller3", "Baller4", "Baller5", "Baller6", "Cavalcade", "Cavalcade2", "Dubsta", "Dubsta2", "Dubsta3",
  6157. "FQ2", "Granger", "Gresley", "Habanero", "Huntley", "Landstalker", "patriot", "Patriot2", "Radi", "Rocoto", "Seminole", "Serrano",
  6158. "Toros", "XLS", "XLS2"
  6159. }
  6160. --==================================================================================================================================================--
  6161. Sedans = {
  6162. "Asea", "Asea2", "Asterope", "Cog55", "Cogg552", "Cognoscenti", "Cognoscenti2", "emperor", "emperor2", "emperor3", "Fugitive",
  6163. "Glendale", "ingot", "intruder", "limo2", "premier", "primo", "primo2", "regina", "romero", "stafford", "Stanier", "stratum", "stretch",
  6164. "surge", "tailgater", "warrener", "Washington"
  6165. }
  6166. --==================================================================================================================================================--
  6167. Service = {"Airbus", "Brickade", "Bus", "Coach", "Rallytruck", "Rentalbus", "Taxi", "Tourbus", "Trash", "Trash2", "WastIndr", "PBus2"}
  6168. --==================================================================================================================================================--
  6169. Sports = {
  6170. "Alpha", "Banshee", "Banshee2", "BestiaGTS", "Buffalo", "Buffalo2", "Buffalo3", "Carbonizzare", "Comet2", "Comet3", "Comet4", "Comet5",
  6171. "Coquette", "Deveste", "Elegy", "Elegy2", "Feltzer2", "Feltzer3", "FlashGT", "Furoregt", "Fusilade", "Futo", "GB200", "Hotring",
  6172. "Infernus2", "Italigto", "Jester", "Jester2", "Khamelion", "Kurama", "Kurama2", "Lynx", "MAssacro", "MAssacro2", "neon", "Ninef",
  6173. "ninfe2", "omnis", "Pariah", "Penumbra", "Raiden", "RapidGT", "RapidGT2", "Raptor", "Revolter", "Ruston", "Schafter2", "Schafter3",
  6174. "Schafter4", "Schafter5", "Schafter6", "Schlagen", "Schwarzer", "Sentinel3", "Seven70", "Specter", "Specter2", "Streiter", "Sultan",
  6175. "Surano", "Tampa2", "Tropos", "Verlierer2", "ZR380", "ZR3802", "ZR3803"
  6176. }
  6177. --==================================================================================================================================================--
  6178. SportsClassic = {
  6179. "Ardent", "BType", "BType2", "BType3", "Casco", "Cheetah2", "Cheburek", "Coquette2", "Coquette3", "Deluxo", "Fagaloa", "Gt500", "JB700",
  6180. "JEster3", "MAmba", "Manana", "Michelli", "Monroe", "Peyote", "Pigalle", "RapidGT3", "Retinue", "Savastra", "Stinger", "Stingergt",
  6181. "Stromberg", "Swinger", "Torero", "Tornado", "Tornado2", "Tornado3", "Tornado4", "Tornado5", "Tornado6", "Viseris", "Z190", "ZType"
  6182. }
  6183. --==================================================================================================================================================--
  6184. Super = {
  6185. "adder", "Autarch", "Bullet", "Cheetah", "Cyclone", "EntityXF", "Entity2", "FMJ", "GP1", "Infernus", "LE7B", "Nero", "Nero2", "Osiris",
  6186. "Penetrator", "PFister811", "Prototipo", "Reaper", "SC1", "Scramjet", "Sheava", "SultanRS", "Superd", "T20", "Taipan", "Tempesta",
  6187. "Tezeract", "Turismo2", "Turismor", "Tyrant", "Tyrus", "Vacca", "Vagner", "Vigilante", "Visione", "Voltic", "Voltic2", "Zentorno",
  6188. "Italigtb", "Italigtb2", "XA21"
  6189. }
  6190. --==================================================================================================================================================--
  6191. Trailer = {
  6192. "ArmyTanker", "ArmyTrailer", "ArmyTrailer2", "BaleTrailer", "BoatTrailer", "CableCar", "DockTrailer", "Graintrailer", "Proptrailer",
  6193. "Raketailer", "TR2", "TR3", "TR4", "TRFlat", "TVTrailer", "Tanker", "Tanker2", "Trailerlogs", "Trailersmall", "Trailers", "Trailers2",
  6194. "Trailers3"
  6195. }
  6196. --==================================================================================================================================================--
  6197. Trains = {"Freight", "Freightcar", "Freightcont1", "Freightcont2", "Freightgrain", "Freighttrailer", "TankerCar"}
  6198. --==================================================================================================================================================--
  6199. Utility = {
  6200. "Airtug", "Caddy", "Caddy2", "Caddy3", "Docktug", "Forklift", "Mower", "Ripley", "Sadler", "Scrap", "TowTruck", "Towtruck2", "Tractor",
  6201. "Tractor2", "Tractor3", "TrailerLArge2", "Utilitruck", "Utilitruck3", "'Utilitruck2"
  6202. }
  6203. --==================================================================================================================================================--
  6204. Vans = {
  6205. "Bison", "Bison2", "Bison3", "BobcatXL", "Boxville", "Boxville2", "Boxville3", "Boxville4", "Boxville5", "Burrito", "Burrito2",
  6206. "Burrito3", "Burrito4", "Burrito5", "Camper", "GBurrito", "GBurrito2", "Journey", "minivan", "Minivan2", "Paradise", "pony", "Pony2",
  6207. "Rumpo", "Rumpo2", "Rumpo3", "Speedo", "Speedo2", "Speedo4", "Surfer", "Surfer2", "Taco", "Youga", "youga2"
  6208. }
  6209. --==================================================================================================================================================--
  6210. end
  6211. local CarsArray = {
  6212. HoaxChoice, Boats, Commercial, Compacts, Coupes, Cycles, Emergency, Helicopters, Industrial, Military, Motorcycles, Muscle, OffRoad,
  6213. Planes, SUVs, Sedans, Service, Sports, SportsClassic, Super, Trailer, Trains, Utility, Vans
  6214. }
  6215.  
  6216. --==================================================================================================================================================--
  6217. -- Weapons
  6218. --==================================================================================================================================================--
  6219. WeaponDescriptions = {
  6220. ["weapon_advancedrifle"] = GetLabelText("WTD_RIFLE_ADV"),
  6221. ["weapon_appistol"] = GetLabelText("WTD_PIST_AP"),
  6222. ["weapon_assaultrifle"] = GetLabelText("WTD_RIFLE_ASL"),
  6223. ["weapon_assaultrifle_mk2"] = GetLabelText("WTD_RIFLE_ASL2"),
  6224. ["weapon_assaultshotgun"] = GetLabelText("WTD_SG_ASL"),
  6225. ["weapon_assaultsmg"] = GetLabelText("WTD_SMG_ASL"),
  6226. ["weapon_autoshotgun"] = GetLabelText("WTD_AUTOSHGN"),
  6227. ["weapon_bat"] = GetLabelText("WTD_BAT"),
  6228. ["weapon_ball"] = GetLabelText("WTD_BALL"),
  6229. ["weapon_battleaxe"] = GetLabelText("WTD_BATTLEAXE"),
  6230. ["weapon_bottle"] = GetLabelText("WTD_BOTTLE"),
  6231. ["weapon_bullpuprifle"] = GetLabelText("WTD_BULLRIFLE"),
  6232. ["weapon_bullpuprifle_mk2"] = GetLabelText("WTD_BULLRIFLE2"),
  6233. ["weapon_bullpupshotgun"] = GetLabelText("WTD_SG_BLP"),
  6234. ["weapon_bzgas"] = GetLabelText("WTD_BZGAS"),
  6235. ["weapon_carbinerifle"] = GetLabelText("WTD_RIFLE_CBN"),
  6236. ["weapon_carbinerifle_mk2"] = GetLabelText("WTD_RIFLE_CBN2"),
  6237. ["weapon_combatmg"] = GetLabelText("WTD_MG_CBT"),
  6238. ["weapon_combatmg_mk2"] = GetLabelText("WTD_MG_CBT2"),
  6239. ["weapon_combatpdw"] = GetLabelText("WTD_COMBATPDW"),
  6240. ["weapon_combatpistol"] = GetLabelText("WTD_PIST_CBT"),
  6241. ["weapon_compactlauncher"] = GetLabelText("WTD_CMPGL"),
  6242. ["weapon_compactrifle"] = GetLabelText("WTD_CMPRIFLE"),
  6243. ["weapon_crowbar"] = GetLabelText("WTD_CROWBAR"),
  6244. ["weapon_dagger"] = GetLabelText("WTD_DAGGER"),
  6245. ["weapon_dbshotgun"] = GetLabelText("WTD_DBSHGN"),
  6246. ["weapon_doubleaction"] = GetLabelText("WTD_REV_DA"),
  6247. ["weapon_fireextinguisher"] = GetLabelText("WTD_FIRE"),
  6248. ["weapon_firework"] = GetLabelText("WTD_FWRKLNCHR"),
  6249. ["weapon_flare"] = GetLabelText("WTD_FLARE"),
  6250. ["weapon_flaregun"] = GetLabelText("WTD_FLAREGUN"),
  6251. ["weapon_flashlight"] = GetLabelText("WTD_FLASHLIGHT"),
  6252. ["weapon_golfclub"] = GetLabelText("WTD_GOLFCLUB"),
  6253. ["weapon_grenade"] = GetLabelText("WTD_GNADE"),
  6254. ["weapon_grenadelauncher"] = GetLabelText("WTD_GL"),
  6255. ["weapon_gusenberg"] = GetLabelText("WTD_GUSENBERG"),
  6256. ["weapon_hammer"] = GetLabelText("WTD_HAMMER"),
  6257. ["weapon_hatchet"] = GetLabelText("WTD_HATCHET"),
  6258. ["weapon_heavypistol"] = GetLabelText("WTD_HEAVYPSTL"),
  6259. ["weapon_heavyshotgun"] = GetLabelText("WTD_HVYSHOT"),
  6260. ["weapon_heavysniper"] = GetLabelText("WTD_SNIP_HVY"),
  6261. ["weapon_heavysniper_mk2"] = GetLabelText("WTD_SNIP_HVY2"),
  6262. ["weapon_hominglauncher"] = GetLabelText("WTD_HOMLNCH"),
  6263. ["weapon_knife"] = GetLabelText("WTD_KNIFE"),
  6264. ["weapon_knuckle"] = GetLabelText("WTD_KNUCKLE"),
  6265. ["weapon_machete"] = GetLabelText("WTD_MACHETE"),
  6266. ["weapon_machinepistol"] = GetLabelText("WTD_MCHPIST"),
  6267. ["weapon_marksmanpistol"] = GetLabelText("WTD_MKPISTOL"),
  6268. ["weapon_marksmanrifle"] = GetLabelText("WTD_MKRIFLE"),
  6269. ["weapon_marksmanrifle_mk2"] = GetLabelText("WTD_MKRIFLE2"),
  6270. ["weapon_mg"] = GetLabelText("WTD_MG"),
  6271. ["weapon_microsmg"] = GetLabelText("WTD_SMG_MCR"),
  6272. ["weapon_minigun"] = GetLabelText("WTD_MINIGUN"),
  6273. ["weapon_minismg"] = GetLabelText("WTD_MINISMG"),
  6274. ["weapon_molotov"] = GetLabelText("WTD_MOLOTOV"),
  6275. ["weapon_musket"] = GetLabelText("WTD_MUSKET"),
  6276. ["weapon_nightstick"] = GetLabelText("WTD_NGTSTK"),
  6277. ["weapon_petrolcan"] = GetLabelText("WTD_PETROL"),
  6278. ["weapon_pipebomb"] = GetLabelText("WTD_PIPEBOMB"),
  6279. ["weapon_pistol"] = GetLabelText("WTD_PIST"),
  6280. ["weapon_pistol50"] = GetLabelText("WTD_PIST_50"),
  6281. ["weapon_pistol_mk2"] = GetLabelText("WTD_PIST2"),
  6282. ["weapon_poolcue"] = GetLabelText("WTD_POOLCUE"),
  6283. ["weapon_proxmine"] = GetLabelText("WTD_PRXMINE"),
  6284. ["weapon_pumpshotgun"] = GetLabelText("WTD_SG_PMP"),
  6285. ["weapon_pumpshotgun_mk2"] = GetLabelText("WTD_SG_PMP2"),
  6286. ["weapon_railgun"] = GetLabelText("WTD_RAILGUN"),
  6287. ["weapon_revolver"] = GetLabelText("WTD_REVOLVER"),
  6288. ["weapon_revolver_mk2"] = GetLabelText("WTD_REVOLVER2"),
  6289. ["weapon_rpg"] = GetLabelText("WTD_RPG"),
  6290. ["weapon_sawnoffshotgun"] = GetLabelText("WTD_SG_SOF"),
  6291. ["weapon_smg"] = GetLabelText("WTD_SMG"),
  6292. ["weapon_smg_mk2"] = GetLabelText("WTD_SMG2"),
  6293. ["weapon_smokegrenade"] = GetLabelText("WTD_GNADE_SMK"),
  6294. ["weapon_sniperrifle"] = GetLabelText("WTD_SNIP_RIF"),
  6295. ["weapon_snowball"] = GetLabelText("WTD_SNWBALL"),
  6296. ["weapon_snspistol"] = GetLabelText("WTD_SNSPISTOL"),
  6297. ["weapon_snspistol_mk2"] = GetLabelText("WTD_SNSPISTOL2"),
  6298. ["weapon_specialcarbine"] = GetLabelText("WTD_RIFLE_SCBN"),
  6299. ["weapon_specialcarbine_mk2"] = GetLabelText("WTD_SPCARBINE2"),
  6300. ["weapon_stickybomb"] = GetLabelText("WTD_GNADE_STK"),
  6301. ["weapon_stungun"] = GetLabelText("WTD_STUN"),
  6302. ["weapon_switchblade"] = GetLabelText("WTD_SWBLADE"),
  6303. ["weapon_unarmed"] = GetLabelText("WTD_UNARMED"),
  6304. ["weapon_vintagepistol"] = GetLabelText("WTD_VPISTOL"),
  6305. ["weapon_wrench"] = GetLabelText("WTD_WRENCH"),
  6306. ["weapon_raypistol"] = GetLabelText("WTD_RAYPISTOL"),
  6307. ["weapon_raycarbine"] = GetLabelText("WTD_RAYCARBINE"),
  6308. ["weapon_rayminigun"] = GetLabelText("WTD_RAYMINIGUN"),
  6309. ["weapon_stone_hatchet"] = GetLabelText("WTD_SHATCHET")
  6310. }
  6311. WeaponNames = {
  6312. ["weapon_advancedrifle"] = GetLabelText("WT_RIFLE_ADV"),
  6313. ["weapon_appistol"] = GetLabelText("WT_PIST_AP"),
  6314. ["weapon_assaultrifle"] = GetLabelText("WT_RIFLE_ASL"),
  6315. ["weapon_assaultrifle_mk2"] = GetLabelText("WT_RIFLE_ASL2"),
  6316. ["weapon_assaultshotgun"] = GetLabelText("WT_SG_ASL"),
  6317. ["weapon_assaultsmg"] = GetLabelText("WT_SMG_ASL"),
  6318. ["weapon_autoshotgun"] = GetLabelText("WT_AUTOSHGN"),
  6319. ["weapon_bat"] = GetLabelText("WT_BAT"),
  6320. ["weapon_ball"] = GetLabelText("WT_BALL"),
  6321. ["weapon_battleaxe"] = GetLabelText("WT_BATTLEAXE"),
  6322. ["weapon_bottle"] = GetLabelText("WT_BOTTLE"),
  6323. ["weapon_bullpuprifle"] = GetLabelText("WT_BULLRIFLE"),
  6324. ["weapon_bullpuprifle_mk2"] = GetLabelText("WT_BULLRIFLE2"),
  6325. ["weapon_bullpupshotgun"] = GetLabelText("WT_SG_BLP"),
  6326. ["weapon_bzgas"] = GetLabelText("WT_BZGAS"),
  6327. ["weapon_carbinerifle"] = GetLabelText("WT_RIFLE_CBN"),
  6328. ["weapon_carbinerifle_mk2"] = GetLabelText("WT_RIFLE_CBN2"),
  6329. ["weapon_combatmg"] = GetLabelText("WT_MG_CBT"),
  6330. ["weapon_combatmg_mk2"] = GetLabelText("WT_MG_CBT2"),
  6331. ["weapon_combatpdw"] = GetLabelText("WT_COMBATPDW"),
  6332. ["weapon_combatpistol"] = GetLabelText("WT_PIST_CBT"),
  6333. ["weapon_compactlauncher"] = GetLabelText("WT_CMPGL"),
  6334. ["weapon_compactrifle"] = GetLabelText("WT_CMPRIFLE"),
  6335. ["weapon_crowbar"] = GetLabelText("WT_CROWBAR"),
  6336. ["weapon_dagger"] = GetLabelText("WT_DAGGER"),
  6337. ["weapon_dbshotgun"] = GetLabelText("WT_DBSHGN"),
  6338. ["weapon_doubleaction"] = GetLabelText("WT_REV_DA"),
  6339. ["weapon_fireextinguisher"] = GetLabelText("WT_FIRE"),
  6340. ["weapon_firework"] = GetLabelText("WT_FWRKLNCHR"),
  6341. ["weapon_flare"] = GetLabelText("WT_FLARE"),
  6342. ["weapon_flaregun"] = GetLabelText("WT_FLAREGUN"),
  6343. ["weapon_flashlight"] = GetLabelText("WT_FLASHLIGHT"),
  6344. ["weapon_golfclub"] = GetLabelText("WT_GOLFCLUB"),
  6345. ["weapon_grenade"] = GetLabelText("WT_GNADE"),
  6346. ["weapon_grenadelauncher"] = GetLabelText("WT_GL"),
  6347. ["weapon_gusenberg"] = GetLabelText("WT_GUSENBERG"),
  6348. ["weapon_hammer"] = GetLabelText("WT_HAMMER"),
  6349. ["weapon_hatchet"] = GetLabelText("WT_HATCHET"),
  6350. ["weapon_heavypistol"] = GetLabelText("WT_HEAVYPSTL"),
  6351. ["weapon_heavyshotgun"] = GetLabelText("WT_HVYSHOT"),
  6352. ["weapon_heavysniper"] = GetLabelText("WT_SNIP_HVY"),
  6353. ["weapon_heavysniper_mk2"] = GetLabelText("WT_SNIP_HVY2"),
  6354. ["weapon_hominglauncher"] = GetLabelText("WT_HOMLNCH"),
  6355. ["weapon_knife"] = GetLabelText("WT_KNIFE"),
  6356. ["weapon_knuckle"] = GetLabelText("WT_KNUCKLE"),
  6357. ["weapon_machete"] = GetLabelText("WT_MACHETE"),
  6358. ["weapon_machinepistol"] = GetLabelText("WT_MCHPIST"),
  6359. ["weapon_marksmanpistol"] = GetLabelText("WT_MKPISTOL"),
  6360. ["weapon_marksmanrifle"] = GetLabelText("WT_MKRIFLE"),
  6361. ["weapon_marksmanrifle_mk2"] = GetLabelText("WT_MKRIFLE2"),
  6362. ["weapon_mg"] = GetLabelText("WT_MG"),
  6363. ["weapon_microsmg"] = GetLabelText("WT_SMG_MCR"),
  6364. ["weapon_minigun"] = GetLabelText("WT_MINIGUN"),
  6365. ["weapon_minismg"] = GetLabelText("WT_MINISMG"),
  6366. ["weapon_molotov"] = GetLabelText("WT_MOLOTOV"),
  6367. ["weapon_musket"] = GetLabelText("WT_MUSKET"),
  6368. ["weapon_nightstick"] = GetLabelText("WT_NGTSTK"),
  6369. ["weapon_petrolcan"] = GetLabelText("WT_PETROL"),
  6370. ["weapon_pipebomb"] = GetLabelText("WT_PIPEBOMB"),
  6371. ["weapon_pistol"] = GetLabelText("WT_PIST"),
  6372. ["weapon_pistol50"] = GetLabelText("WT_PIST_50"),
  6373. ["weapon_pistol_mk2"] = GetLabelText("WT_PIST2"),
  6374. ["weapon_poolcue"] = GetLabelText("WT_POOLCUE"),
  6375. ["weapon_proxmine"] = GetLabelText("WT_PRXMINE"),
  6376. ["weapon_pumpshotgun"] = GetLabelText("WT_SG_PMP"),
  6377. ["weapon_pumpshotgun_mk2"] = GetLabelText("WT_SG_PMP2"),
  6378. ["weapon_railgun"] = GetLabelText("WT_RAILGUN"),
  6379. ["weapon_revolver"] = GetLabelText("WT_REVOLVER"),
  6380. ["weapon_revolver_mk2"] = GetLabelText("WT_REVOLVER2"),
  6381. ["weapon_rpg"] = GetLabelText("WT_RPG"),
  6382. ["weapon_sawnoffshotgun"] = GetLabelText("WT_SG_SOF"),
  6383. ["weapon_smg"] = GetLabelText("WT_SMG"),
  6384. ["weapon_smg_mk2"] = GetLabelText("WT_SMG2"),
  6385. ["weapon_smokegrenade"] = GetLabelText("WT_GNADE_SMK"),
  6386. ["weapon_sniperrifle"] = GetLabelText("WT_SNIP_RIF"),
  6387. ["weapon_snowball"] = GetLabelText("WT_SNWBALL"),
  6388. ["weapon_snspistol"] = GetLabelText("WT_SNSPISTOL"),
  6389. ["weapon_snspistol_mk2"] = GetLabelText("WT_SNSPISTOL2"),
  6390. ["weapon_specialcarbine"] = GetLabelText("WT_RIFLE_SCBN"),
  6391. ["weapon_specialcarbine_mk2"] = GetLabelText("WT_SPCARBINE2"),
  6392. ["weapon_stickybomb"] = GetLabelText("WT_GNADE_STK"),
  6393. ["weapon_stungun"] = GetLabelText("WT_STUN"),
  6394. ["weapon_switchblade"] = GetLabelText("WT_SWBLADE"),
  6395. ["weapon_unarmed"] = GetLabelText("WT_UNARMED"),
  6396. ["weapon_vintagepistol"] = GetLabelText("WT_VPISTOL"),
  6397. ["weapon_wrench"] = GetLabelText("WT_WRENCH"),
  6398. ["weapon_raypistol"] = GetLabelText("WT_RAYPISTOL"),
  6399. ["weapon_raycarbine"] = GetLabelText("WT_RAYCARBINE"),
  6400. ["weapon_rayminigun"] = GetLabelText("WT_RAYMINIGUN"),
  6401. ["weapon_stone_hatchet"] = GetLabelText("WT_SHATCHET")
  6402. }
  6403. WeaponComponentNames = {
  6404. ["COMPONENT_PISTOL_CLIP_01"] = GetLabelText("WCT_CLIP1"),
  6405. ["COMPONENT_PISTOL_CLIP_02"] = GetLabelText("WCT_CLIP2"),
  6406. ["COMPONENT_PISTOL_VARMOD_LUXE"] = GetLabelText("WCT_VAR_GOLD"),
  6407. ["COMPONENT_PISTOL50_CLIP_01"] = GetLabelText("WCT_CLIP1"),
  6408. ["COMPONENT_PISTOL50_CLIP_02"] = GetLabelText("WCT_CLIP2"),
  6409. ["COMPONENT_PISTOL50_VARMOD_LUXE"] = GetLabelText("WCT_VAR_SIL"),
  6410. ["COMPONENT_COMBATPISTOL_CLIP_01"] = GetLabelText("WCT_CLIP1"),
  6411. ["COMPONENT_COMBATPISTOL_CLIP_02"] = GetLabelText("WCT_CLIP2"),
  6412. ["COMPONENT_COMBATPISTOL_VARMOD_LOWRIDER"] = GetLabelText("WCT_VAR_GOLD"),
  6413. ["COMPONENT_APPISTOL_CLIP_01"] = GetLabelText("WCT_CLIP1"),
  6414. ["COMPONENT_APPISTOL_CLIP_02"] = GetLabelText("WCT_CLIP2"),
  6415. ["COMPONENT_APPISTOL_VARMOD_LUXE"] = GetLabelText("WCT_VAR_METAL"),
  6416. ["COMPONENT_SMG_CLIP_01"] = GetLabelText("WCT_CLIP1"),
  6417. ["COMPONENT_SMG_CLIP_02"] = GetLabelText("WCT_CLIP2"),
  6418. ["COMPONENT_SMG_CLIP_03"] = GetLabelText("WCT_CLIP_DRM"),
  6419. ["COMPONENT_AT_SCOPE_MACRO_02"] = GetLabelText("WCT_SCOPE_MAC"),
  6420. ["COMPONENT_SMG_VARMOD_LUXE"] = GetLabelText("WCT_VAR_GOLD"),
  6421. ["COMPONENT_MICROSMG_CLIP_01"] = GetLabelText("WCT_CLIP1"),
  6422. ["COMPONENT_MICROSMG_CLIP_02"] = GetLabelText("WCT_CLIP2"),
  6423. ["COMPONENT_AT_SCOPE_MACRO"] = GetLabelText("WCT_SCOPE_MAC"),
  6424. ["COMPONENT_MICROSMG_VARMOD_LUXE"] = GetLabelText("WCT_VAR_GOLD"),
  6425. ["COMPONENT_ASSAULTSMG_CLIP_01"] = GetLabelText("WCT_CLIP1"),
  6426. ["COMPONENT_ASSAULTSMG_CLIP_02"] = GetLabelText("WCT_CLIP2"),
  6427. ["COMPONENT_AT_SCOPE_MACRO"] = GetLabelText("WCT_SCOPE_MAC"),
  6428. ["COMPONENT_ASSAULTSMG_VARMOD_LOWRIDER"] = GetLabelText("WCT_VAR_GOLD"),
  6429. ["COMPONENT_MG_CLIP_01"] = GetLabelText("WCT_CLIP1"),
  6430. ["COMPONENT_MG_CLIP_02"] = GetLabelText("WCT_CLIP2"),
  6431. ["COMPONENT_AT_SCOPE_SMALL_02"] = GetLabelText("WCT_SCOPE_SML"),
  6432. ["COMPONENT_MG_VARMOD_LOWRIDER"] = GetLabelText("WCT_VAR_GOLD"),
  6433. ["COMPONENT_COMBATMG_CLIP_01"] = GetLabelText("WCT_CLIP1"),
  6434. ["COMPONENT_COMBATMG_CLIP_02"] = GetLabelText("WCT_CLIP2"),
  6435. ["COMPONENT_ASSAULTRIFLE_CLIP_01"] = GetLabelText("WCT_CLIP1"),
  6436. ["COMPONENT_ASSAULTRIFLE_CLIP_02"] = GetLabelText("WCT_CLIP2"),
  6437. ["COMPONENT_ASSAULTRIFLE_CLIP_03"] = GetLabelText("WCT_CLIP_DRM"),
  6438. ["COMPONENT_AT_SCOPE_MACRO"] = GetLabelText("WCT_SCOPE_MAC"),
  6439. ["COMPONENT_ASSAULTRIFLE_VARMOD_LUXE"] = GetLabelText("WCT_VAR_GOLD"),
  6440. ["COMPONENT_CARBINERIFLE_CLIP_01"] = GetLabelText("WCT_CLIP1"),
  6441. ["COMPONENT_CARBINERIFLE_CLIP_02"] = GetLabelText("WCT_CLIP2"),
  6442. ["COMPONENT_CARBINERIFLE_CLIP_03"] = GetLabelText("WCT_CLIP_DRM"),
  6443. ["COMPONENT_CARBINERIFLE_VARMOD_LUXE"] = GetLabelText("WCT_VAR_GOLD"),
  6444. ["COMPONENT_ADVANCEDRIFLE_CLIP_01"] = GetLabelText("WCT_CLIP1"),
  6445. ["COMPONENT_ADVANCEDRIFLE_CLIP_02"] = GetLabelText("WCT_CLIP2"),
  6446. ["COMPONENT_ADVANCEDRIFLE_VARMOD_LUXE"] = GetLabelText("WCT_VAR_METAL"),
  6447. ["COMPONENT_ASSAULTSHOTGUN_CLIP_01"] = GetLabelText("WCT_CLIP1"),
  6448. ["COMPONENT_ASSAULTSHOTGUN_CLIP_02"] = GetLabelText("WCT_CLIP2"),
  6449. ["COMPONENT_SAWNOFFSHOTGUN_VARMOD_LUXE"] = GetLabelText("WCT_VAR_METAL"),
  6450. ["COMPONENT_AT_SR_SUPP"] = GetLabelText("WCT_SUPP"),
  6451. ["COMPONENT_PUMPSHOTGUN_VARMOD_LOWRIDER"] = GetLabelText("WCT_VAR_GOLD"),
  6452. ["COMPONENT_AT_SCOPE_LARGE"] = GetLabelText("WCT_SCOPE_LRG"),
  6453. ["COMPONENT_SNIPERRIFLE_VARMOD_LUXE"] = GetLabelText("WCT_VAR_WOOD"),
  6454. ["COMPONENT_AT_SCOPE_LARGE"] = GetLabelText("WCT_SCOPE_LRG"),
  6455. ["COMPONENT_AT_SCOPE_MACRO"] = GetLabelText("WCT_SCOPE_MAC"),
  6456. ["COMPONENT_AT_SCOPE_MACRO_02"] = GetLabelText("WCT_SCOPE_MAC"),
  6457. ["COMPONENT_AT_SCOPE_SMALL_02"] = GetLabelText("WCT_SCOPE_SML"),
  6458. ["COMPONENT_AT_SCOPE_LARGE"] = GetLabelText("WCT_SCOPE_LRG"),
  6459. ["COMPONENT_AT_SR_SUPP"] = GetLabelText("WCT_SUPP"),
  6460. ["COMPONENT_ASSAULTRIFLE_MK2_CAMO"] = GetLabelText("WCT_CAMO_1"),
  6461. ["COMPONENT_ASSAULTRIFLE_MK2_CAMO_02"] = GetLabelText("WCT_CAMO_2"),
  6462. ["COMPONENT_ASSAULTRIFLE_MK2_CAMO_03"] = GetLabelText("WCT_CAMO_3"),
  6463. ["COMPONENT_ASSAULTRIFLE_MK2_CAMO_04"] = GetLabelText("WCT_CAMO_4"),
  6464. ["COMPONENT_ASSAULTRIFLE_MK2_CAMO_05"] = GetLabelText("WCT_CAMO_5"),
  6465. ["COMPONENT_ASSAULTRIFLE_MK2_CAMO_06"] = GetLabelText("WCT_CAMO_6"),
  6466. ["COMPONENT_ASSAULTRIFLE_MK2_CAMO_07"] = GetLabelText("WCT_CAMO_7"),
  6467. ["COMPONENT_ASSAULTRIFLE_MK2_CAMO_08"] = GetLabelText("WCT_CAMO_8"),
  6468. ["COMPONENT_ASSAULTRIFLE_MK2_CAMO_09"] = GetLabelText("WCT_CAMO_9"),
  6469. ["COMPONENT_ASSAULTRIFLE_MK2_CAMO_10"] = GetLabelText("WCT_CAMO_10"),
  6470. ["COMPONENT_ASSAULTRIFLE_MK2_CAMO_IND_01"] = GetLabelText("WCT_CAMO_IND"),
  6471. ["COMPONENT_ASSAULTRIFLE_MK2_CLIP_01"] = GetLabelText("WCT_CLIP1"),
  6472. ["COMPONENT_ASSAULTRIFLE_MK2_CLIP_02"] = GetLabelText("WCT_CLIP2"),
  6473. ["COMPONENT_ASSAULTRIFLE_MK2_CLIP_ARMORPIERCING"] = GetLabelText("WCT_CLIP_AP"),
  6474. ["COMPONENT_ASSAULTRIFLE_MK2_CLIP_FMJ"] = GetLabelText("WCT_CLIP_FMJ"),
  6475. ["COMPONENT_ASSAULTRIFLE_MK2_CLIP_INCENDIARY"] = GetLabelText("WCT_CLIP_INC"),
  6476. ["COMPONENT_ASSAULTRIFLE_MK2_CLIP_TRACER"] = GetLabelText("WCT_CLIP_TR"),
  6477. ["COMPONENT_AT_AR_AFGRIP"] = GetLabelText("WCT_GRIP"),
  6478. ["COMPONENT_AT_AR_AFGRIP_02"] = GetLabelText("WCT_GRIP"),
  6479. ["COMPONENT_AT_AR_BARREL_01"] = GetLabelText("WCT_BARR"),
  6480. ["COMPONENT_AT_AR_BARREL_02"] = GetLabelText("WCT_BARR2"),
  6481. ["COMPONENT_AT_AR_FLSH"] = GetLabelText("WCT_FLASH"),
  6482. ["COMPONENT_AT_AR_SUPP"] = GetLabelText("WCT_SUPP"),
  6483. ["COMPONENT_AT_AR_SUPP_02"] = GetLabelText("WCT_SUPP"),
  6484. ["COMPONENT_AT_BP_BARREL_01"] = GetLabelText("WCT_BARR"),
  6485. ["COMPONENT_AT_BP_BARREL_02"] = GetLabelText("WCT_BARR2"),
  6486. ["COMPONENT_AT_CR_BARREL_01"] = GetLabelText("WCT_BARR"),
  6487. ["COMPONENT_AT_CR_BARREL_02"] = GetLabelText("WCT_BARR2"),
  6488. ["COMPONENT_AT_MG_BARREL_01"] = GetLabelText("WCT_BARR"),
  6489. ["COMPONENT_AT_MG_BARREL_02"] = GetLabelText("WCT_BARR2"),
  6490. ["COMPONENT_AT_MRFL_BARREL_01"] = GetLabelText("WCT_BARR"),
  6491. ["COMPONENT_AT_MRFL_BARREL_02"] = GetLabelText("WCT_BARR2"),
  6492. ["COMPONENT_AT_MUZZLE_01"] = GetLabelText("WCT_MUZZ1"),
  6493. ["COMPONENT_AT_MUZZLE_02"] = GetLabelText("WCT_MUZZ2"),
  6494. ["COMPONENT_AT_MUZZLE_03"] = GetLabelText("WCT_MUZZ3"),
  6495. ["COMPONENT_AT_MUZZLE_04"] = GetLabelText("WCT_MUZZ4"),
  6496. ["COMPONENT_AT_MUZZLE_05"] = GetLabelText("WCT_MUZZ5"),
  6497. ["COMPONENT_AT_MUZZLE_06"] = GetLabelText("WCT_MUZZ6"),
  6498. ["COMPONENT_AT_MUZZLE_07"] = GetLabelText("WCT_MUZZ7"),
  6499. ["COMPONENT_AT_MUZZLE_08"] = GetLabelText("WCT_MUZZ"),
  6500. ["COMPONENT_AT_MUZZLE_09"] = GetLabelText("WCT_MUZZ9"),
  6501. ["COMPONENT_AT_PI_COMP"] = GetLabelText("WCT_COMP"),
  6502. ["COMPONENT_AT_PI_COMP_02"] = GetLabelText("WCT_COMP"),
  6503. ["COMPONENT_AT_PI_COMP_03"] = GetLabelText("WCT_COMP"),
  6504. ["COMPONENT_AT_PI_FLSH"] = GetLabelText("WCT_FLASH"),
  6505. ["COMPONENT_AT_PI_FLSH_02"] = GetLabelText("WCT_FLASH"),
  6506. ["COMPONENT_AT_PI_FLSH_03"] = GetLabelText("WCT_FLASH"),
  6507. ["COMPONENT_AT_PI_RAIL"] = GetLabelText("WCT_SCOPE_PI"),
  6508. ["COMPONENT_AT_PI_RAIL_02"] = GetLabelText("WCT_SCOPE_PI"),
  6509. ["COMPONENT_AT_PI_SUPP"] = GetLabelText("WCT_SUPP"),
  6510. ["COMPONENT_AT_PI_SUPP_02"] = GetLabelText("WCT_SUPP"),
  6511. ["COMPONENT_AT_SB_BARREL_01"] = GetLabelText("WCT_BARR"),
  6512. ["COMPONENT_AT_SB_BARREL_02"] = GetLabelText("WCT_BARR2"),
  6513. ["COMPONENT_AT_SCOPE_LARGE_FIXED_ZOOM"] = GetLabelText("WCT_SCOPE_LRG"),
  6514. ["COMPONENT_AT_SCOPE_LARGE_FIXED_ZOOM_MK2"] = GetLabelText("WCT_SCOPE_LRG2"),
  6515. ["COMPONENT_AT_SCOPE_LARGE_MK2"] = GetLabelText("WCT_SCOPE_LRG2"),
  6516. ["COMPONENT_AT_SCOPE_MACRO_02_MK2"] = GetLabelText("WCT_SCOPE_MAC2"),
  6517. ["COMPONENT_AT_SCOPE_MACRO_02_SMG_MK2"] = GetLabelText("WCT_SCOPE_MAC2"),
  6518. ["COMPONENT_AT_SCOPE_MACRO_MK2"] = GetLabelText("WCT_SCOPE_MAC2"),
  6519. ["COMPONENT_AT_SCOPE_MAX"] = GetLabelText("WCT_SCOPE_MAX"),
  6520. ["COMPONENT_AT_SCOPE_MEDIUM"] = GetLabelText("WCT_SCOPE_LRG"),
  6521. ["COMPONENT_AT_SCOPE_MEDIUM_MK2"] = GetLabelText("WCT_SCOPE_MED2"),
  6522. ["COMPONENT_AT_SCOPE_NV"] = GetLabelText("WCT_SCOPE_NV"),
  6523. ["COMPONENT_AT_SCOPE_SMALL"] = GetLabelText("WCT_SCOPE_SML"),
  6524. ["COMPONENT_AT_SCOPE_SMALL_MK2"] = GetLabelText("WCT_SCOPE_SML2"),
  6525. ["COMPONENT_AT_SCOPE_SMALL_SMG_MK2"] = GetLabelText("WCT_SCOPE_SML2"),
  6526. ["COMPONENT_AT_SCOPE_THERMAL"] = GetLabelText("WCT_SCOPE_TH"),
  6527. ["COMPONENT_AT_SC_BARREL_01"] = GetLabelText("WCT_BARR"),
  6528. ["COMPONENT_AT_SC_BARREL_02"] = GetLabelText("WCT_BARR2"),
  6529. ["COMPONENT_AT_SIGHTS"] = GetLabelText("WCT_HOLO"),
  6530. ["COMPONENT_AT_SIGHTS_SMG"] = GetLabelText("WCT_HOLO"),
  6531. ["COMPONENT_AT_SR_BARREL_01"] = GetLabelText("WCT_BARR"),
  6532. ["COMPONENT_AT_SR_BARREL_02"] = GetLabelText("WCT_BARR2"),
  6533. ["COMPONENT_AT_SR_SUPP_03"] = GetLabelText("WCT_SUPP"),
  6534. ["COMPONENT_BULLPUPRIFLE_CLIP_01"] = GetLabelText("WCT_CLIP1"),
  6535. ["COMPONENT_BULLPUPRIFLE_CLIP_02"] = GetLabelText("WCT_CLIP2"),
  6536. ["COMPONENT_BULLPUPRIFLE_MK2_CAMO"] = GetLabelText("WCT_CAMO_1"),
  6537. ["COMPONENT_BULLPUPRIFLE_MK2_CAMO_02"] = GetLabelText("WCT_CAMO_2"),
  6538. ["COMPONENT_BULLPUPRIFLE_MK2_CAMO_03"] = GetLabelText("WCT_CAMO_3"),
  6539. ["COMPONENT_BULLPUPRIFLE_MK2_CAMO_04"] = GetLabelText("WCT_CAMO_4"),
  6540. ["COMPONENT_BULLPUPRIFLE_MK2_CAMO_05"] = GetLabelText("WCT_CAMO_5"),
  6541. ["COMPONENT_BULLPUPRIFLE_MK2_CAMO_06"] = GetLabelText("WCT_CAMO_6"),
  6542. ["COMPONENT_BULLPUPRIFLE_MK2_CAMO_07"] = GetLabelText("WCT_CAMO_7"),
  6543. ["COMPONENT_BULLPUPRIFLE_MK2_CAMO_08"] = GetLabelText("WCT_CAMO_8"),
  6544. ["COMPONENT_BULLPUPRIFLE_MK2_CAMO_09"] = GetLabelText("WCT_CAMO_9"),
  6545. ["COMPONENT_BULLPUPRIFLE_MK2_CAMO_10"] = GetLabelText("WCT_CAMO_10"),
  6546. ["COMPONENT_BULLPUPRIFLE_MK2_CAMO_IND_01"] = GetLabelText("WCT_CAMO_IND"),
  6547. ["COMPONENT_BULLPUPRIFLE_MK2_CLIP_01"] = GetLabelText("WCT_CLIP1"),
  6548. ["COMPONENT_BULLPUPRIFLE_MK2_CLIP_02"] = GetLabelText("WCT_CLIP2"),
  6549. ["COMPONENT_BULLPUPRIFLE_MK2_CLIP_ARMORPIERCING"] = GetLabelText("WCT_CLIP_AP"),
  6550. ["COMPONENT_BULLPUPRIFLE_MK2_CLIP_FMJ"] = GetLabelText("WCT_CLIP_FMJ"),
  6551. ["COMPONENT_BULLPUPRIFLE_MK2_CLIP_INCENDIARY"] = GetLabelText("WCT_CLIP_INC"),
  6552. ["COMPONENT_BULLPUPRIFLE_MK2_CLIP_TRACER"] = GetLabelText("WCT_CLIP_TR"),
  6553. ["COMPONENT_BULLPUPRIFLE_VARMOD_LOW"] = GetLabelText("WCT_VAR_METAL"),
  6554. ["COMPONENT_CARBINERIFLE_MK2_CAMO"] = GetLabelText("WCT_CAMO_1"),
  6555. ["COMPONENT_CARBINERIFLE_MK2_CAMO_02"] = GetLabelText("WCT_CAMO_2"),
  6556. ["COMPONENT_CARBINERIFLE_MK2_CAMO_03"] = GetLabelText("WCT_CAMO_3"),
  6557. ["COMPONENT_CARBINERIFLE_MK2_CAMO_04"] = GetLabelText("WCT_CAMO_4"),
  6558. ["COMPONENT_CARBINERIFLE_MK2_CAMO_05"] = GetLabelText("WCT_CAMO_5"),
  6559. ["COMPONENT_CARBINERIFLE_MK2_CAMO_06"] = GetLabelText("WCT_CAMO_6"),
  6560. ["COMPONENT_CARBINERIFLE_MK2_CAMO_07"] = GetLabelText("WCT_CAMO_7"),
  6561. ["COMPONENT_CARBINERIFLE_MK2_CAMO_08"] = GetLabelText("WCT_CAMO_8"),
  6562. ["COMPONENT_CARBINERIFLE_MK2_CAMO_09"] = GetLabelText("WCT_CAMO_9"),
  6563. ["COMPONENT_CARBINERIFLE_MK2_CAMO_10"] = GetLabelText("WCT_CAMO_10"),
  6564. ["COMPONENT_CARBINERIFLE_MK2_CAMO_IND_01"] = GetLabelText("WCT_CAMO_IND"),
  6565. ["COMPONENT_CARBINERIFLE_MK2_CLIP_01"] = GetLabelText("WCT_CLIP1"),
  6566. ["COMPONENT_CARBINERIFLE_MK2_CLIP_02"] = GetLabelText("WCT_CLIP2"),
  6567. ["COMPONENT_CARBINERIFLE_MK2_CLIP_ARMORPIERCING"] = GetLabelText("WCT_CLIP_AP"),
  6568. ["COMPONENT_CARBINERIFLE_MK2_CLIP_FMJ"] = GetLabelText("WCT_CLIP_FMJ"),
  6569. ["COMPONENT_CARBINERIFLE_MK2_CLIP_INCENDIARY"] = GetLabelText("WCT_CLIP_INC"),
  6570. ["COMPONENT_CARBINERIFLE_MK2_CLIP_TRACER"] = GetLabelText("WCT_CLIP_TR"),
  6571. ["COMPONENT_COMBATMG_MK2_CAMO"] = GetLabelText("WCT_CAMO_1"),
  6572. ["COMPONENT_COMBATMG_MK2_CAMO_02"] = GetLabelText("WCT_CAMO_2"),
  6573. ["COMPONENT_COMBATMG_MK2_CAMO_03"] = GetLabelText("WCT_CAMO_3"),
  6574. ["COMPONENT_COMBATMG_MK2_CAMO_04"] = GetLabelText("WCT_CAMO_4"),
  6575. ["COMPONENT_COMBATMG_MK2_CAMO_05"] = GetLabelText("WCT_CAMO_5"),
  6576. ["COMPONENT_COMBATMG_MK2_CAMO_06"] = GetLabelText("WCT_CAMO_6"),
  6577. ["COMPONENT_COMBATMG_MK2_CAMO_07"] = GetLabelText("WCT_CAMO_7"),
  6578. ["COMPONENT_COMBATMG_MK2_CAMO_08"] = GetLabelText("WCT_CAMO_8"),
  6579. ["COMPONENT_COMBATMG_MK2_CAMO_09"] = GetLabelText("WCT_CAMO_9"),
  6580. ["COMPONENT_COMBATMG_MK2_CAMO_10"] = GetLabelText("WCT_CAMO_10"),
  6581. ["COMPONENT_COMBATMG_MK2_CAMO_IND_01"] = GetLabelText("WCT_CAMO_IND"),
  6582. ["COMPONENT_COMBATMG_MK2_CLIP_01"] = GetLabelText("WCT_CLIP1"),
  6583. ["COMPONENT_COMBATMG_MK2_CLIP_02"] = GetLabelText("WCT_CLIP2"),
  6584. ["COMPONENT_COMBATMG_MK2_CLIP_ARMORPIERCING"] = GetLabelText("WCT_CLIP_AP"),
  6585. ["COMPONENT_COMBATMG_MK2_CLIP_FMJ"] = GetLabelText("WCT_CLIP_FMJ"),
  6586. ["COMPONENT_COMBATMG_MK2_CLIP_INCENDIARY"] = GetLabelText("WCT_CLIP_INC"),
  6587. ["COMPONENT_COMBATMG_MK2_CLIP_TRACER"] = GetLabelText("WCT_CLIP_TR"),
  6588. ["COMPONENT_COMBATPDW_CLIP_01"] = GetLabelText("WCT_CLIP1"),
  6589. ["COMPONENT_COMBATPDW_CLIP_02"] = GetLabelText("WCT_CLIP2"),
  6590. ["COMPONENT_COMBATPDW_CLIP_03"] = GetLabelText("WCT_CLIP_DRM"),
  6591. ["COMPONENT_COMPACTRIFLE_CLIP_01"] = GetLabelText("WCT_CLIP1"),
  6592. ["COMPONENT_COMPACTRIFLE_CLIP_02"] = GetLabelText("WCT_CLIP2"),
  6593. ["COMPONENT_COMPACTRIFLE_CLIP_03"] = GetLabelText("WCT_CLIP_DRM"),
  6594. ["COMPONENT_GUSENBERG_CLIP_01"] = GetLabelText("WCT_CLIP1"),
  6595. ["COMPONENT_GUSENBERG_CLIP_02"] = GetLabelText("WCT_CLIP2"),
  6596. ["COMPONENT_HEAVYPISTOL_CLIP_01"] = GetLabelText("WCT_CLIP1"),
  6597. ["COMPONENT_HEAVYPISTOL_CLIP_02"] = GetLabelText("WCT_CLIP2"),
  6598. ["COMPONENT_HEAVYPISTOL_VARMOD_LUXE"] = GetLabelText("WCT_VAR_WOOD"),
  6599. ["COMPONENT_HEAVYSHOTGUN_CLIP_01"] = GetLabelText("WCT_CLIP1"),
  6600. ["COMPONENT_HEAVYSHOTGUN_CLIP_02"] = GetLabelText("WCT_CLIP2"),
  6601. ["COMPONENT_HEAVYSHOTGUN_CLIP_03"] = GetLabelText("WCT_CLIP_DRM"),
  6602. ["COMPONENT_HEAVYSNIPER_MK2_CAMO"] = GetLabelText("WCT_CAMO_1"),
  6603. ["COMPONENT_HEAVYSNIPER_MK2_CAMO_02"] = GetLabelText("WCT_CAMO_2"),
  6604. ["COMPONENT_HEAVYSNIPER_MK2_CAMO_03"] = GetLabelText("WCT_CAMO_3"),
  6605. ["COMPONENT_HEAVYSNIPER_MK2_CAMO_04"] = GetLabelText("WCT_CAMO_4"),
  6606. ["COMPONENT_HEAVYSNIPER_MK2_CAMO_05"] = GetLabelText("WCT_CAMO_5"),
  6607. ["COMPONENT_HEAVYSNIPER_MK2_CAMO_06"] = GetLabelText("WCT_CAMO_6"),
  6608. ["COMPONENT_HEAVYSNIPER_MK2_CAMO_07"] = GetLabelText("WCT_CAMO_7"),
  6609. ["COMPONENT_HEAVYSNIPER_MK2_CAMO_08"] = GetLabelText("WCT_CAMO_8"),
  6610. ["COMPONENT_HEAVYSNIPER_MK2_CAMO_09"] = GetLabelText("WCT_CAMO_9"),
  6611. ["COMPONENT_HEAVYSNIPER_MK2_CAMO_10"] = GetLabelText("WCT_CAMO_10"),
  6612. ["COMPONENT_HEAVYSNIPER_MK2_CAMO_IND_01"] = GetLabelText("WCT_CAMO_IND"),
  6613. ["COMPONENT_HEAVYSNIPER_MK2_CLIP_01"] = GetLabelText("WCT_CLIP1"),
  6614. ["COMPONENT_HEAVYSNIPER_MK2_CLIP_02"] = GetLabelText("WCT_CLIP2"),
  6615. ["COMPONENT_HEAVYSNIPER_MK2_CLIP_ARMORPIERCING"] = GetLabelText("WCT_CLIP_AP"),
  6616. ["COMPONENT_HEAVYSNIPER_MK2_CLIP_EXPLOSIVE"] = GetLabelText("WCT_CLIP_EX"),
  6617. ["COMPONENT_HEAVYSNIPER_MK2_CLIP_FMJ"] = GetLabelText("WCT_CLIP_FMJ"),
  6618. ["COMPONENT_HEAVYSNIPER_MK2_CLIP_INCENDIARY"] = GetLabelText("WCT_CLIP_INC"),
  6619. ["COMPONENT_KNUCKLE_VARMOD_BALLAS"] = GetLabelText("WCT_KNUCK_BG"),
  6620. ["COMPONENT_KNUCKLE_VARMOD_BASE"] = GetLabelText("WCT_KNUCK_01"),
  6621. ["COMPONENT_KNUCKLE_VARMOD_DIAMOND"] = GetLabelText("WCT_KNUCK_DMD"),
  6622. ["COMPONENT_KNUCKLE_VARMOD_DOLLAR"] = GetLabelText("WCT_KNUCK_DLR"),
  6623. ["COMPONENT_KNUCKLE_VARMOD_HATE"] = GetLabelText("WCT_KNUCK_HT"),
  6624. ["COMPONENT_KNUCKLE_VARMOD_KING"] = GetLabelText("WCT_KNUCK_SLG"),
  6625. ["COMPONENT_KNUCKLE_VARMOD_LOVE"] = GetLabelText("WCT_KNUCK_LV"),
  6626. ["COMPONENT_KNUCKLE_VARMOD_PIMP"] = GetLabelText("WCT_KNUCK_02"),
  6627. ["COMPONENT_KNUCKLE_VARMOD_PLAYER"] = GetLabelText("WCT_KNUCK_PC"),
  6628. ["COMPONENT_KNUCKLE_VARMOD_VAGOS"] = GetLabelText("WCT_KNUCK_VG"),
  6629. ["COMPONENT_MACHINEPISTOL_CLIP_01"] = GetLabelText("WCT_CLIP1"),
  6630. ["COMPONENT_MACHINEPISTOL_CLIP_02"] = GetLabelText("WCT_CLIP2"),
  6631. ["COMPONENT_MACHINEPISTOL_CLIP_03"] = GetLabelText("WCT_CLIP_DRM"),
  6632. ["COMPONENT_MARKSMANRIFLE_CLIP_01"] = GetLabelText("WCT_CLIP1"),
  6633. ["COMPONENT_MARKSMANRIFLE_CLIP_02"] = GetLabelText("WCT_CLIP2"),
  6634. ["COMPONENT_MARKSMANRIFLE_MK2_CAMO"] = GetLabelText("WCT_CAMO_1"),
  6635. ["COMPONENT_MARKSMANRIFLE_MK2_CAMO_02"] = GetLabelText("WCT_CAMO_2"),
  6636. ["COMPONENT_MARKSMANRIFLE_MK2_CAMO_03"] = GetLabelText("WCT_CAMO_3"),
  6637. ["COMPONENT_MARKSMANRIFLE_MK2_CAMO_04"] = GetLabelText("WCT_CAMO_4"),
  6638. ["COMPONENT_MARKSMANRIFLE_MK2_CAMO_05"] = GetLabelText("WCT_CAMO_5"),
  6639. ["COMPONENT_MARKSMANRIFLE_MK2_CAMO_06"] = GetLabelText("WCT_CAMO_6"),
  6640. ["COMPONENT_MARKSMANRIFLE_MK2_CAMO_07"] = GetLabelText("WCT_CAMO_7"),
  6641. ["COMPONENT_MARKSMANRIFLE_MK2_CAMO_08"] = GetLabelText("WCT_CAMO_8"),
  6642. ["COMPONENT_MARKSMANRIFLE_MK2_CAMO_09"] = GetLabelText("WCT_CAMO_9"),
  6643. ["COMPONENT_MARKSMANRIFLE_MK2_CAMO_10"] = GetLabelText("WCT_CAMO_10"),
  6644. ["COMPONENT_MARKSMANRIFLE_MK2_CAMO_IND_01"] = GetLabelText("WCT_CAMO_10"),
  6645. ["COMPONENT_MARKSMANRIFLE_MK2_CLIP_01"] = GetLabelText("WCT_CLIP1"),
  6646. ["COMPONENT_MARKSMANRIFLE_MK2_CLIP_02"] = GetLabelText("WCT_CLIP2"),
  6647. ["COMPONENT_MARKSMANRIFLE_MK2_CLIP_ARMORPIERCING"] = GetLabelText("WCT_CLIP_AP"),
  6648. ["COMPONENT_MARKSMANRIFLE_MK2_CLIP_FMJ"] = GetLabelText("WCT_CLIP_FMJ"),
  6649. ["COMPONENT_MARKSMANRIFLE_MK2_CLIP_INCENDIARY"] = GetLabelText("WCT_CLIP_INC"),
  6650. ["COMPONENT_MARKSMANRIFLE_MK2_CLIP_TRACER"] = GetLabelText("WCT_CLIP_TR"),
  6651. ["COMPONENT_MARKSMANRIFLE_VARMOD_LUXE"] = GetLabelText("WCT_VAR_GOLD"),
  6652. ["COMPONENT_MINISMG_CLIP_01"] = GetLabelText("WCT_CLIP1"),
  6653. ["COMPONENT_MINISMG_CLIP_02"] = GetLabelText("WCT_CLIP2"),
  6654. ["COMPONENT_PISTOL_MK2_CAMO"] = GetLabelText("WCT_CAMO_1"),
  6655. ["COMPONENT_PISTOL_MK2_CAMO_02"] = GetLabelText("WCT_CAMO_2"),
  6656. ["COMPONENT_PISTOL_MK2_CAMO_03"] = GetLabelText("WCT_CAMO_3"),
  6657. ["COMPONENT_PISTOL_MK2_CAMO_04"] = GetLabelText("WCT_CAMO_4"),
  6658. ["COMPONENT_PISTOL_MK2_CAMO_05"] = GetLabelText("WCT_CAMO_5"),
  6659. ["COMPONENT_PISTOL_MK2_CAMO_06"] = GetLabelText("WCT_CAMO_6"),
  6660. ["COMPONENT_PISTOL_MK2_CAMO_07"] = GetLabelText("WCT_CAMO_7"),
  6661. ["COMPONENT_PISTOL_MK2_CAMO_08"] = GetLabelText("WCT_CAMO_8"),
  6662. ["COMPONENT_PISTOL_MK2_CAMO_09"] = GetLabelText("WCT_CAMO_9"),
  6663. ["COMPONENT_PISTOL_MK2_CAMO_10"] = GetLabelText("WCT_CAMO_10"),
  6664. ["COMPONENT_PISTOL_MK2_CAMO_IND_01"] = GetLabelText("WCT_CAMO_IND"),
  6665. ["COMPONENT_PISTOL_MK2_CLIP_01"] = GetLabelText("WCT_CLIP1"),
  6666. ["COMPONENT_PISTOL_MK2_CLIP_02"] = GetLabelText("WCT_CLIP2"),
  6667. ["COMPONENT_PISTOL_MK2_CLIP_FMJ"] = GetLabelText("WCT_CLIP_FMJ"),
  6668. ["COMPONENT_PISTOL_MK2_CLIP_HOLLOWPOINT"] = GetLabelText("WCT_CLIP_HP"),
  6669. ["COMPONENT_PISTOL_MK2_CLIP_INCENDIARY"] = GetLabelText("WCT_CLIP_INC"),
  6670. ["COMPONENT_PISTOL_MK2_CLIP_TRACER"] = GetLabelText("WCT_CLIP_TR"),
  6671. ["COMPONENT_PUMPSHOTGUN_MK2_CAMO"] = GetLabelText("WCT_CAMO_1"),
  6672. ["COMPONENT_PUMPSHOTGUN_MK2_CAMO_02"] = GetLabelText("WCT_CAMO_2"),
  6673. ["COMPONENT_PUMPSHOTGUN_MK2_CAMO_03"] = GetLabelText("WCT_CAMO_3"),
  6674. ["COMPONENT_PUMPSHOTGUN_MK2_CAMO_04"] = GetLabelText("WCT_CAMO_4"),
  6675. ["COMPONENT_PUMPSHOTGUN_MK2_CAMO_05"] = GetLabelText("WCT_CAMO_5"),
  6676. ["COMPONENT_PUMPSHOTGUN_MK2_CAMO_06"] = GetLabelText("WCT_CAMO_6"),
  6677. ["COMPONENT_PUMPSHOTGUN_MK2_CAMO_07"] = GetLabelText("WCT_CAMO_7"),
  6678. ["COMPONENT_PUMPSHOTGUN_MK2_CAMO_08"] = GetLabelText("WCT_CAMO_8"),
  6679. ["COMPONENT_PUMPSHOTGUN_MK2_CAMO_09"] = GetLabelText("WCT_CAMO_9"),
  6680. ["COMPONENT_PUMPSHOTGUN_MK2_CAMO_10"] = GetLabelText("WCT_CAMO_10"),
  6681. ["COMPONENT_PUMPSHOTGUN_MK2_CAMO_IND_01"] = GetLabelText("WCT_CAMO_IND"),
  6682. ["COMPONENT_PUMPSHOTGUN_MK2_CLIP_01"] = GetLabelText("WCT_SHELL"),
  6683. ["COMPONENT_PUMPSHOTGUN_MK2_CLIP_ARMORPIERCING"] = GetLabelText("WCT_SHELL_AP"),
  6684. ["COMPONENT_PUMPSHOTGUN_MK2_CLIP_EXPLOSIVE"] = GetLabelText("WCT_SHELL_EX"),
  6685. ["COMPONENT_PUMPSHOTGUN_MK2_CLIP_HOLLOWPOINT"] = GetLabelText("WCT_SHELL_HP"),
  6686. ["COMPONENT_PUMPSHOTGUN_MK2_CLIP_INCENDIARY"] = GetLabelText("WCT_SHELL_INC"),
  6687. ["COMPONENT_REVOLVER_MK2_CAMO"] = GetLabelText("WCT_CAMO_1"),
  6688. ["COMPONENT_REVOLVER_MK2_CAMO_02"] = GetLabelText("WCT_CAMO_2"),
  6689. ["COMPONENT_REVOLVER_MK2_CAMO_03"] = GetLabelText("WCT_CAMO_3"),
  6690. ["COMPONENT_REVOLVER_MK2_CAMO_04"] = GetLabelText("WCT_CAMO_4"),
  6691. ["COMPONENT_REVOLVER_MK2_CAMO_05"] = GetLabelText("WCT_CAMO_5"),
  6692. ["COMPONENT_REVOLVER_MK2_CAMO_06"] = GetLabelText("WCT_CAMO_6"),
  6693. ["COMPONENT_REVOLVER_MK2_CAMO_07"] = GetLabelText("WCT_CAMO_7"),
  6694. ["COMPONENT_REVOLVER_MK2_CAMO_08"] = GetLabelText("WCT_CAMO_8"),
  6695. ["COMPONENT_REVOLVER_MK2_CAMO_09"] = GetLabelText("WCT_CAMO_9"),
  6696. ["COMPONENT_REVOLVER_MK2_CAMO_10"] = GetLabelText("WCT_CAMO_10"),
  6697. ["COMPONENT_REVOLVER_MK2_CAMO_IND_01"] = GetLabelText("WCT_CAMO_IND"),
  6698. ["COMPONENT_REVOLVER_MK2_CLIP_01"] = GetLabelText("WCT_CLIP1_RV"),
  6699. ["COMPONENT_REVOLVER_MK2_CLIP_FMJ"] = GetLabelText("WCT_CLIP_FMJ"),
  6700. ["COMPONENT_REVOLVER_MK2_CLIP_HOLLOWPOINT"] = GetLabelText("WCT_CLIP_HP"),
  6701. ["COMPONENT_REVOLVER_MK2_CLIP_INCENDIARY"] = GetLabelText("WCT_CLIP_INC"),
  6702. ["COMPONENT_REVOLVER_MK2_CLIP_TRACER"] = GetLabelText("WCT_CLIP_TR"),
  6703. ["COMPONENT_REVOLVER_VARMOD_BOSS"] = GetLabelText("WCT_REV_VARB"),
  6704. ["COMPONENT_REVOLVER_VARMOD_GOON"] = GetLabelText("WCT_REV_VARG"),
  6705. ["COMPONENT_SMG_MK2_CAMO"] = GetLabelText("WCT_CAMO_1"),
  6706. ["COMPONENT_SMG_MK2_CAMO_02"] = GetLabelText("WCT_CAMO_2"),
  6707. ["COMPONENT_SMG_MK2_CAMO_03"] = GetLabelText("WCT_CAMO_3"),
  6708. ["COMPONENT_SMG_MK2_CAMO_04"] = GetLabelText("WCT_CAMO_4"),
  6709. ["COMPONENT_SMG_MK2_CAMO_05"] = GetLabelText("WCT_CAMO_5"),
  6710. ["COMPONENT_SMG_MK2_CAMO_06"] = GetLabelText("WCT_CAMO_6"),
  6711. ["COMPONENT_SMG_MK2_CAMO_07"] = GetLabelText("WCT_CAMO_7"),
  6712. ["COMPONENT_SMG_MK2_CAMO_08"] = GetLabelText("WCT_CAMO_8"),
  6713. ["COMPONENT_SMG_MK2_CAMO_09"] = GetLabelText("WCT_CAMO_9"),
  6714. ["COMPONENT_SMG_MK2_CAMO_10"] = GetLabelText("WCT_CAMO_10"),
  6715. ["COMPONENT_SMG_MK2_CAMO_IND_01"] = GetLabelText("WCT_CAMO_IND"),
  6716. ["COMPONENT_SMG_MK2_CLIP_01"] = GetLabelText("WCT_CLIP1"),
  6717. ["COMPONENT_SMG_MK2_CLIP_02"] = GetLabelText("WCT_CLIP2"),
  6718. ["COMPONENT_SMG_MK2_CLIP_FMJ"] = GetLabelText("WCT_CLIP_FMJ"),
  6719. ["COMPONENT_SMG_MK2_CLIP_HOLLOWPOINT"] = GetLabelText("WCT_CLIP_HP"),
  6720. ["COMPONENT_SMG_MK2_CLIP_INCENDIARY"] = GetLabelText("WCT_CLIP_INC"),
  6721. ["COMPONENT_SMG_MK2_CLIP_TRACER"] = GetLabelText("WCT_CLIP_TR"),
  6722. ["COMPONENT_SNSPISTOL_CLIP_01"] = GetLabelText("WCT_CLIP1"),
  6723. ["COMPONENT_SNSPISTOL_CLIP_02"] = GetLabelText("WCT_CLIP2"),
  6724. ["COMPONENT_SNSPISTOL_MK2_CAMO"] = GetLabelText("WCT_CAMO_1"),
  6725. ["COMPONENT_SNSPISTOL_MK2_CAMO_02"] = GetLabelText("WCT_CAMO_2"),
  6726. ["COMPONENT_SNSPISTOL_MK2_CAMO_03"] = GetLabelText("WCT_CAMO_3"),
  6727. ["COMPONENT_SNSPISTOL_MK2_CAMO_04"] = GetLabelText("WCT_CAMO_4"),
  6728. ["COMPONENT_SNSPISTOL_MK2_CAMO_05"] = GetLabelText("WCT_CAMO_5"),
  6729. ["COMPONENT_SNSPISTOL_MK2_CAMO_06"] = GetLabelText("WCT_CAMO_6"),
  6730. ["COMPONENT_SNSPISTOL_MK2_CAMO_07"] = GetLabelText("WCT_CAMO_7"),
  6731. ["COMPONENT_SNSPISTOL_MK2_CAMO_08"] = GetLabelText("WCT_CAMO_8"),
  6732. ["COMPONENT_SNSPISTOL_MK2_CAMO_09"] = GetLabelText("WCT_CAMO_9"),
  6733. ["COMPONENT_SNSPISTOL_MK2_CAMO_10"] = GetLabelText("WCT_CAMO_10"),
  6734. ["COMPONENT_SNSPISTOL_MK2_CAMO_IND_01"] = GetLabelText("WCT_CAMO_10"),
  6735. ["COMPONENT_SNSPISTOL_MK2_CLIP_01"] = GetLabelText("WCT_CLIP1"),
  6736. ["COMPONENT_SNSPISTOL_MK2_CLIP_02"] = GetLabelText("WCT_CLIP2"),
  6737. ["COMPONENT_SNSPISTOL_MK2_CLIP_FMJ"] = GetLabelText("WCT_CLIP_FMJ"),
  6738. ["COMPONENT_SNSPISTOL_MK2_CLIP_HOLLOWPOINT"] = GetLabelText("WCT_CLIP_HP"),
  6739. ["COMPONENT_SNSPISTOL_MK2_CLIP_INCENDIARY"] = GetLabelText("WCT_CLIP_INC"),
  6740. ["COMPONENT_SNSPISTOL_MK2_CLIP_TRACER"] = GetLabelText("WCT_CLIP_TR"),
  6741. ["COMPONENT_SNSPISTOL_VARMOD_LOWRIDER"] = GetLabelText("WCT_VAR_WOOD"),
  6742. ["COMPONENT_SPECIALCARBINE_CLIP_01"] = GetLabelText("WCT_CLIP1"),
  6743. ["COMPONENT_SPECIALCARBINE_CLIP_02"] = GetLabelText("WCT_CLIP2"),
  6744. ["COMPONENT_SPECIALCARBINE_CLIP_03"] = GetLabelText("WCT_CLIP_DRM"),
  6745. ["COMPONENT_SPECIALCARBINE_MK2_CAMO"] = GetLabelText("WCT_CAMO_1"),
  6746. ["COMPONENT_SPECIALCARBINE_MK2_CAMO_02"] = GetLabelText("WCT_CAMO_2"),
  6747. ["COMPONENT_SPECIALCARBINE_MK2_CAMO_03"] = GetLabelText("WCT_CAMO_3"),
  6748. ["COMPONENT_SPECIALCARBINE_MK2_CAMO_04"] = GetLabelText("WCT_CAMO_4"),
  6749. ["COMPONENT_SPECIALCARBINE_MK2_CAMO_05"] = GetLabelText("WCT_CAMO_5"),
  6750. ["COMPONENT_SPECIALCARBINE_MK2_CAMO_06"] = GetLabelText("WCT_CAMO_6"),
  6751. ["COMPONENT_SPECIALCARBINE_MK2_CAMO_07"] = GetLabelText("WCT_CAMO_7"),
  6752. ["COMPONENT_SPECIALCARBINE_MK2_CAMO_08"] = GetLabelText("WCT_CAMO_8"),
  6753. ["COMPONENT_SPECIALCARBINE_MK2_CAMO_09"] = GetLabelText("WCT_CAMO_9"),
  6754. ["COMPONENT_SPECIALCARBINE_MK2_CAMO_10"] = GetLabelText("WCT_CAMO_10"),
  6755. ["COMPONENT_SPECIALCARBINE_MK2_CAMO_IND_01"] = GetLabelText("WCT_CAMO_IND"),
  6756. ["COMPONENT_SPECIALCARBINE_MK2_CLIP_01"] = GetLabelText("WCT_CLIP1"),
  6757. ["COMPONENT_SPECIALCARBINE_MK2_CLIP_02"] = GetLabelText("WCT_CLIP2"),
  6758. ["COMPONENT_SPECIALCARBINE_MK2_CLIP_ARMORPIERCING"] = GetLabelText("WCT_CLIP_AP"),
  6759. ["COMPONENT_SPECIALCARBINE_MK2_CLIP_FMJ"] = GetLabelText("WCT_CLIP_FMJ"),
  6760. ["COMPONENT_SPECIALCARBINE_MK2_CLIP_INCENDIARY"] = GetLabelText("WCT_CLIP_INC"),
  6761. ["COMPONENT_SPECIALCARBINE_MK2_CLIP_TRACER"] = GetLabelText("WCT_CLIP_TR"),
  6762. ["COMPONENT_SPECIALCARBINE_VARMOD_LOWRIDER"] = GetLabelText("WCT_VAR_ETCHM"),
  6763. ["COMPONENT_SWITCHBLADE_VARMOD_BASE"] = GetLabelText("WCT_SB_BASE"),
  6764. ["COMPONENT_SWITCHBLADE_VARMOD_VAR1"] = GetLabelText("WCT_SB_VAR1"),
  6765. ["COMPONENT_SWITCHBLADE_VARMOD_VAR2"] = GetLabelText("WCT_SB_VAR2"),
  6766. ["COMPONENT_VINTAGEPISTOL_CLIP_01"] = GetLabelText("WCT_CLIP1"),
  6767. ["COMPONENT_VINTAGEPISTOL_CLIP_02"] = GetLabelText("WCT_CLIP2"),
  6768. ["COMPONENT_RAYPISTOL_VARMOD_XMAS18"] = GetLabelText("WCT_VAR_RAY18")
  6769. }
  6770. WeaponTints = {
  6771. ["Black"] = 0,
  6772. ["Green"] = 1,
  6773. ["Gold"] = 2,
  6774. ["Pink"] = 3,
  6775. ["Army"] = 4,
  6776. ["LSPD"] = 5,
  6777. ["Orange"] = 6,
  6778. ["Platinum"] = 7
  6779. }
  6780. WeaponTintsMkII = {
  6781. ["Classic Black"] = 0,
  6782. ["Classic Gray"] = 1,
  6783. ["Classic Two Tone"] = 2,
  6784. ["Classic White"] = 3,
  6785. ["Classic Beige"] = 4,
  6786. ["Classic Green"] = 5,
  6787. ["Classic Blue"] = 6,
  6788. ["Classic Earth"] = 7,
  6789. ["Classic Brown & Black"] = 8,
  6790. ["Red Contrast"] = 9,
  6791. ["Blue Contrast"] = 10,
  6792. ["Yellow Contrast"] = 11,
  6793. ["Orange Contrast"] = 12,
  6794. ["Bold Pink"] = 13,
  6795. ["Bold Purple & Yellow"] = 14,
  6796. ["Bold Orange"] = 15,
  6797. ["Bold Green & Purple"] = 16,
  6798. ["Bold Red Features"] = 17,
  6799. ["Bold Green Features"] = 18,
  6800. ["Bold Cyan Features"] = 19,
  6801. ["Bold Yellow Features"] = 20,
  6802. ["Bold Red & White"] = 21,
  6803. ["Bold Blue & White"] = 22,
  6804. ["Metallic Gold"] = 23,
  6805. ["Metallic Platinum"] = 24,
  6806. ["Metallic Gray & Lilac"] = 25,
  6807. ["Metallic Purple & Lime"] = 26,
  6808. ["Metallic Red"] = 27,
  6809. ["Metallic Green"] = 28,
  6810. ["Metallic Blue"] = 29,
  6811. ["Metallic White & Aqua"] = 30,
  6812. ["Metallic Red & Yellow"] = 31
  6813. }
  6814.  
  6815. function CreateWeaponList()
  6816. local _weaponsList = {}
  6817.  
  6818. for code, name in pairs(WeaponNames) do
  6819. local realName = code
  6820. local localizedName = name
  6821. if (realName ~= "weapon_unarmed") then
  6822. local hash = GetHashKey(code)
  6823. local componentHashes = {}
  6824. for comp, _ in pairs(WeaponComponentNames) do
  6825. if (DoesWeaponTakeWeaponComponent(hash, GetHashKey(comp))) then
  6826. if not (table.ContainsKey(componentHashes, comp)) then
  6827. componentHashes[comp] = GetHashKey(comp);
  6828. end
  6829. end
  6830. end
  6831.  
  6832. local validWeapon = {
  6833. Hash = hash,
  6834. SpawnName = realName,
  6835. Name = localizedName,
  6836. Components = componentHashes
  6837. };
  6838.  
  6839. if _weaponsList == nil then table.insert(_weaponsList, validWeapon); end;
  6840.  
  6841. if not table.Contains(_weaponsList, validWeapon) then table.insert(_weaponsList, validWeapon); end;
  6842. end
  6843. end
  6844. return _weaponsList;
  6845. end
  6846.  
  6847. function SpawnCustomWeapon(PlayerPed)
  6848. local ammo = 900;
  6849. local inputName = FiveM.GetKeyboardInput("Enter Weapon Model Name", "Pistol", 10);
  6850. if not (string.IsNullOrEmpty(inputName)) then
  6851. local model = GetHashKey(inputName:upper());
  6852.  
  6853. if IsWeaponValid(model) then
  6854. GiveWeaponToPed(PlayerPed, model, ammo, false, true);
  6855. FiveM.Subtitle("Added weapon to inventory.");
  6856. else
  6857. FiveM.Notify("This ("..tostring(inputName)..") is not a valid weapon model name, or the model hash ("..tostring(model)..") could not be found in the game files.", NotificationType.Error);
  6858. end
  6859. else
  6860. FiveM.Notify("Invalid Input!", NotificationType.Error);
  6861. end
  6862. end
  6863.  
  6864. function SpawnWeaponMenu(WeaponSpawnMenu, PlayerPed)
  6865. local weaponInfo = {}
  6866. local weaponComponents = {}
  6867.  
  6868. local spawnWeapon = NativeUI.CreateItem("Spawn Weapon By Name", "Enter a weapon mode name to spawn.")
  6869. spawnWeapon:SetLeftBadge(BadgeStyle.Gun);
  6870. spawnWeapon.Activated = function(menu, item, index) SpawnCustomWeapon(PlayerPed) end
  6871. WeaponSpawnMenu:AddItem(spawnWeapon)
  6872.  
  6873. WeaponSpawnMenu:AddSpacerItem("↓ Weapon Categories ↓")
  6874.  
  6875. local handGunsMenu = (MaestroEraPool:AddSubMenu(WeaponSpawnMenu, "Handguns"))
  6876. handGunsMenu.Item:RightLabel("->")
  6877. handGunsMenu = handGunsMenu.SubMenu
  6878.  
  6879. local riflesMenu = (MaestroEraPool:AddSubMenu(WeaponSpawnMenu, "Assault Rifles"))
  6880. riflesMenu.Item:RightLabel("->")
  6881. riflesMenu = riflesMenu.SubMenu
  6882.  
  6883. local shotgunsMenu = (MaestroEraPool:AddSubMenu(WeaponSpawnMenu, "Shotguns"))
  6884. shotgunsMenu.Item:RightLabel("->")
  6885. shotgunsMenu = shotgunsMenu.SubMenu
  6886.  
  6887. local smgsMenu = (MaestroEraPool:AddSubMenu(WeaponSpawnMenu, "Sub-/Light Machine Guns"))
  6888. smgsMenu.Item:RightLabel("->")
  6889. smgsMenu = smgsMenu.SubMenu
  6890.  
  6891. local throwablesMenu = (MaestroEraPool:AddSubMenu(WeaponSpawnMenu, "Throwables"))
  6892. throwablesMenu.Item:RightLabel("->")
  6893. throwablesMenu = throwablesMenu.SubMenu
  6894.  
  6895. local meleeMenu = (MaestroEraPool:AddSubMenu(WeaponSpawnMenu, "Melee"))
  6896. meleeMenu.Item:RightLabel("->")
  6897. meleeMenu = meleeMenu.SubMenu
  6898.  
  6899. local heavyMenu = (MaestroEraPool:AddSubMenu(WeaponSpawnMenu, "Heavy Weapons"))
  6900. heavyMenu.Item:RightLabel("->")
  6901. heavyMenu = heavyMenu.SubMenu
  6902.  
  6903. local snipersMenu = (MaestroEraPool:AddSubMenu(WeaponSpawnMenu, "Sniper Rifles"))
  6904. snipersMenu.Item:RightLabel("->")
  6905. snipersMenu = snipersMenu.SubMenu
  6906.  
  6907. local weaponList = CreateWeaponList();
  6908.  
  6909. for key, weapon in pairs(weaponList) do
  6910. local cat = GetWeapontypeGroup(weapon.Hash);
  6911.  
  6912. if not string.IsNullOrEmpty(weapon.Name) then
  6913. local weaponItem = NativeUI.CreateItem(weapon.Name, "Open the options for ~y~"..tostring(weapon.Name).."~s~.")
  6914. weaponItem:SetLeftBadge(BadgeStyle.Gun);
  6915.  
  6916. local weaponMenu = (MaestroEraPool:AddSubMenu(WeaponSpawnMenu, "~y~" ..tostring(weapon.Name).."~s~ Options", weapon.Name, "false"))
  6917. weaponMenu.Item:RightLabel("->")
  6918. weaponMenu = weaponMenu.SubMenu
  6919.  
  6920. weaponInfo[weaponMenu] = weapon;
  6921.  
  6922. local getOrRemoveWeapon = NativeUI.CreateItem("Equip/Remove Weapon", "Add or remove this weapon to/form your inventory.")
  6923. getOrRemoveWeapon:SetLeftBadge(BadgeStyle.Gun);
  6924. weaponMenu:AddItem(getOrRemoveWeapon);
  6925.  
  6926. local fillAmmo = NativeUI.CreateItem("Re-fill Ammo", "Get max ammo for this weapon.")
  6927. fillAmmo:SetLeftBadge(BadgeStyle.Ammo);
  6928. weaponMenu:AddItem(fillAmmo);
  6929.  
  6930. local tints = {};
  6931. do
  6932. if (string.match(weapon.Name, "Mk II")) then
  6933. for tint, value in ipairs(WeaponTintsMkII) do
  6934. table.insert(tints, tint)
  6935. end
  6936. else
  6937. for tint, value in pairs(WeaponTints) do
  6938. table.insert(tints, tint)
  6939. end
  6940. end
  6941. if table.Count(tints) > 0 then
  6942. local weaponTints = NativeUI.CreateListItem("Tints", tints, 0, "Select a tint for your weapon.");
  6943. weaponMenu:AddItem(weaponTints);
  6944. end
  6945. end
  6946.  
  6947. if (table.Count(weapon.Components) > 0) then
  6948. weaponMenu:AddSpacerItem("↓ Weapon Components ↓")
  6949. local compItem = nil;
  6950. for comp,_ in pairs(weapon.Components) do
  6951. compItem = NativeUI.CreateCheckboxItem(WeaponComponentNames[comp], component,"Click to equip or remove this component.");
  6952. weaponComponents[compItem] = comp;
  6953. weaponMenu:AddItem(compItem);
  6954. end
  6955. end
  6956.  
  6957. weaponMenu.OnListIndexChange = function(sender, item, oldIndex, newIndex, itemIndex)
  6958. if (item == weaponTints) then
  6959. if (HasPedGotWeapon(PlayerPed, weaponInfo[sender].Hash, false)) then
  6960. SetPedWeaponTintIndex(PlayerPed, weaponInfo[sender].Hash, newIndex);
  6961. else
  6962. FiveM.Notify("You need to get the weapon first!", NotificationType.Error);
  6963. end;
  6964. end;
  6965. end;
  6966.  
  6967. weaponMenu.OnCheckboxChange = function(menu, item, enabled)
  6968. local Weapon = weaponInfo[menu];
  6969. local component = weaponComponents[item];
  6970. local componentHash = Weapon.Components[component];
  6971.  
  6972. if (HasPedGotWeapon(PlayerPed, Weapon.Hash, false)) then
  6973. SetCurrentPedWeapon(PlayerPed, Weapon.Hash, true);
  6974. if (HasPedGotWeaponComponent(PlayerPed, Weapon.Hash, componentHash)) then
  6975. RemoveWeaponComponentFromPed(PlayerPed, Weapon.Hash, componentHash);
  6976. FiveM.Subtitle("Component removed.");
  6977. else
  6978. local ammo = GetAmmoInPedWeapon(PlayerPed, Weapon.Hash);
  6979.  
  6980. local clipAmmo = GetAmmoInClip(PlayerPed, Weapon.Hash);
  6981.  
  6982. GiveWeaponComponentToPed(PlayerPed, Weapon.Hash, componentHash);
  6983.  
  6984. SetAmmoInClip(PlayerPed, Weapon.Hash, clipAmmo);
  6985.  
  6986. SetPedAmmo(PlayerPed, Weapon.Hash, ammo);
  6987. FiveM.Subtitle("Component equiped.");
  6988. end
  6989. else
  6990. FiveM.Notify("You need to get the weapon first before you can modify it.", NotificationType.Error);
  6991. end
  6992. end
  6993.  
  6994. weaponMenu.OnItemSelect = function(sender, item, index)
  6995. local info = weaponInfo[sender];
  6996. local hash = info.Hash;
  6997.  
  6998. if (item == getOrRemoveWeapon) then
  6999. if (HasPedGotWeapon(PlayerPed, hash, false)) then
  7000. RemoveWeaponFromPed(PlayerPed, hash);
  7001. FiveM.Subtitle("Weapon removed.");
  7002. else
  7003. local bool, ammo = GetMaxAmmo(PlayerPed, hash);
  7004. GiveWeaponToPed(PlayerPed, hash, ammo, false, true);
  7005. FiveM.Subtitle("Weapon added.");
  7006. end
  7007. elseif (item == fillAmmo) then
  7008. if (HasPedGotWeapon(PlayerPed, hash, false)) then
  7009. local bool, ammo = GetMaxAmmo(PlayerPed, hash);
  7010. SetPedAmmo(PlayerPed, hash, ammo);
  7011. else
  7012. FiveM.Notify("You need to get the weapon first before re-filling ammo!", NotificationType.Error);
  7013. end
  7014. end
  7015. end
  7016.  
  7017. weaponMenu:RefreshIndex();
  7018.  
  7019.  
  7020. if cat ~= nil then
  7021. if (cat == 970310034) then
  7022. riflesMenu:AddItem(weaponItem);
  7023. riflesMenu:BindMenuToItem(weaponMenu, weaponItem);
  7024.  
  7025. elseif (cat == 416676503 or cat == 690389602) then
  7026. handGunsMenu:AddItem(weaponItem);
  7027. handGunsMenu:BindMenuToItem(weaponMenu, weaponItem);
  7028.  
  7029. elseif (cat == 860033945) then
  7030. shotgunsMenu:AddItem(weaponItem);
  7031. shotgunsMenu:BindMenuToItem(weaponMenu, weaponItem);
  7032.  
  7033. elseif (cat == 3337201093 or cat == 1159398588) then
  7034. smgsMenu:AddItem(weaponItem);
  7035. smgsMenu:BindMenuToItem(weaponMenu, weaponItem);
  7036.  
  7037. elseif (cat == 1548507267 or cat == 4257178988 or cat == 1595662460) then
  7038. throwablesMenu:AddItem(weaponItem);
  7039. throwablesMenu:BindMenuToItem(weaponMenu, weaponItem);
  7040.  
  7041. elseif (cat == 3566412244 or cat == 2685387236 or cat == -728555052) then
  7042. meleeMenu:AddItem(weaponItem);
  7043. meleeMenu:BindMenuToItem(weaponMenu, weaponItem);
  7044.  
  7045. elseif (cat == 2725924767 or cat == -1569042529 or cat == 1159398588) then
  7046. heavyMenu:AddItem(weaponItem);
  7047. heavyMenu:BindMenuToItem(weaponMenu, weaponItem);
  7048.  
  7049. elseif (cat == 3082541095 or cat == -1212426201) then
  7050. snipersMenu:AddItem(weaponItem);
  7051. snipersMenu:BindMenuToItem(weaponMenu, weaponItem);
  7052. end
  7053. end
  7054.  
  7055. if weaponItem:SetParentMenu() ~= nil then
  7056. weaponItem:SetParentMenu().OnMenuChanged = function(menu, newmenu, forward)
  7057. if forward then
  7058. SetCurrentPedWeapon(PlayerPed, weaponInfo[newmenu].Hash, true);
  7059. end
  7060. end
  7061. end
  7062. end
  7063. end
  7064. end
  7065. --==================================================================================================================================================--
  7066. -- FiveM Functions
  7067. --==================================================================================================================================================--
  7068. FiveM = {}
  7069. do
  7070. FiveM.Notify = function(text, type)
  7071. if type == nil then type = NotificationType.None end
  7072. SetNotificationTextEntry("STRING")
  7073. if type == NotificationType.Info then
  7074. AddTextComponentString("~b~~h~Info~h~~s~: " .. text)
  7075. elseif type == NotificationType.Error then
  7076. AddTextComponentString("~r~~h~Error~h~~s~: " .. text)
  7077. elseif type == NotificationType.Alert then
  7078. AddTextComponentString("~y~~h~Alert~h~~s~: " .. text)
  7079. elseif type == NotificationType.Success then
  7080. AddTextComponentString("~g~~h~Success~h~~s~: " .. text)
  7081. else
  7082. AddTextComponentString(text)
  7083. end
  7084. DrawNotification(false, false)
  7085. end
  7086.  
  7087. FiveM.Subtitle = function(message, duration, drawImmediately)
  7088. if duration == nil then duration = 2500 end;
  7089. if drawImmediately == nil then drawImmediately = true; end;
  7090. ClearPrints()
  7091. SetTextEntry_2("STRING");
  7092. for i = 1, message:len(), 99 do
  7093. AddTextComponentString(string.sub(message, i, i + 99))
  7094. end
  7095. DrawSubtitleTimed(duration, drawImmediately);
  7096. end
  7097.  
  7098. FiveM.GetKeyboardInput = function(TextEntry, ExampleText, MaxStringLength)
  7099. AddTextEntry("FMMC_KEY_TIP1", TextEntry .. ":")
  7100. DisplayOnscreenKeyboard(1, "FMMC_KEY_TIP1", "", ExampleText, "", "", "", MaxStringLength)
  7101. local blockinput = true
  7102. while UpdateOnscreenKeyboard() ~= 1 and UpdateOnscreenKeyboard() ~= 2 do Citizen.Wait(0) end
  7103.  
  7104. if UpdateOnscreenKeyboard() ~= 2 then
  7105. local result = GetOnscreenKeyboardResult()
  7106. Citizen.Wait(500)
  7107. blockinput = false
  7108. return result
  7109. else
  7110. Citizen.Wait(500)
  7111. blockinput = false
  7112. return nil
  7113. end
  7114. end
  7115.  
  7116. FiveM.GetVehicleProperties = function(vehicle)
  7117. local color1, color2 = GetVehicleColours(vehicle)
  7118. local pearlescentColor, wheelColor = GetVehicleExtraColours(vehicle)
  7119. local extras = {}
  7120.  
  7121. for id = 0, 12 do
  7122. if DoesExtraExist(vehicle, id) then
  7123. local state = IsVehicleExtraTurnedOn(vehicle, id) == 1
  7124. extras[tostring(id)] = state
  7125. end
  7126. end
  7127.  
  7128. return {
  7129. model = GetEntityModel(vehicle),
  7130.  
  7131. plate = math.trim(GetVehicleNumberPlateText(vehicle)),
  7132. plateIndex = GetVehicleNumberPlateTextIndex(vehicle),
  7133.  
  7134. health = GetEntityMaxHealth(vehicle),
  7135. dirtLevel = GetVehicleDirtLevel(vehicle),
  7136.  
  7137. color1 = color1,
  7138. color2 = color2,
  7139.  
  7140. pearlescentColor = pearlescentColor,
  7141. wheelColor = wheelColor,
  7142.  
  7143. wheels = GetVehicleWheelType(vehicle),
  7144. windowTint = GetVehicleWindowTint(vehicle),
  7145.  
  7146. neonEnabled = {
  7147. IsVehicleNeonLightEnabled(vehicle, 0), IsVehicleNeonLightEnabled(vehicle, 1), IsVehicleNeonLightEnabled(vehicle, 2),
  7148. IsVehicleNeonLightEnabled(vehicle, 3)
  7149. },
  7150.  
  7151. extras = extras,
  7152.  
  7153. neonColor = table.pack(GetVehicleNeonLightsColour(vehicle)),
  7154. tyreSmokeColor = table.pack(GetVehicleTyreSmokeColor(vehicle)),
  7155.  
  7156. modSpoilers = GetVehicleMod(vehicle, 0),
  7157. modFrontBumper = GetVehicleMod(vehicle, 1),
  7158. modRearBumper = GetVehicleMod(vehicle, 2),
  7159. modSideSkirt = GetVehicleMod(vehicle, 3),
  7160. modExhaust = GetVehicleMod(vehicle, 4),
  7161. modFrame = GetVehicleMod(vehicle, 5),
  7162. modGrille = GetVehicleMod(vehicle, 6),
  7163. modHood = GetVehicleMod(vehicle, 7),
  7164. modFender = GetVehicleMod(vehicle, 8),
  7165. modRightFender = GetVehicleMod(vehicle, 9),
  7166. modRoof = GetVehicleMod(vehicle, 10),
  7167.  
  7168. modEngine = GetVehicleMod(vehicle, 11),
  7169. modBrakes = GetVehicleMod(vehicle, 12),
  7170. modTransmission = GetVehicleMod(vehicle, 13),
  7171. modHorns = GetVehicleMod(vehicle, 14),
  7172. modSuspension = GetVehicleMod(vehicle, 15),
  7173. modArmor = GetVehicleMod(vehicle, 16),
  7174.  
  7175. modTurbo = IsToggleModOn(vehicle, 18),
  7176. modSmokeEnabled = IsToggleModOn(vehicle, 20),
  7177. modXenon = IsToggleModOn(vehicle, 22),
  7178.  
  7179. modFrontWheels = GetVehicleMod(vehicle, 23),
  7180. modBackWheels = GetVehicleMod(vehicle, 24),
  7181.  
  7182. modPlateHolder = GetVehicleMod(vehicle, 25),
  7183. modVanityPlate = GetVehicleMod(vehicle, 26),
  7184. modTrimA = GetVehicleMod(vehicle, 27),
  7185. modOrnaments = GetVehicleMod(vehicle, 28),
  7186. modDashboard = GetVehicleMod(vehicle, 29),
  7187. modDial = GetVehicleMod(vehicle, 30),
  7188. modDoorSpeaker = GetVehicleMod(vehicle, 31),
  7189. modSeats = GetVehicleMod(vehicle, 32),
  7190. modSteeringWheel = GetVehicleMod(vehicle, 33),
  7191. modShifterLeavers = GetVehicleMod(vehicle, 34),
  7192. modAPlate = GetVehicleMod(vehicle, 35),
  7193. modSpeakers = GetVehicleMod(vehicle, 36),
  7194. modTrunk = GetVehicleMod(vehicle, 37),
  7195. modHydrolic = GetVehicleMod(vehicle, 38),
  7196. modEngineBlock = GetVehicleMod(vehicle, 39),
  7197. modAirFilter = GetVehicleMod(vehicle, 40),
  7198. modStruts = GetVehicleMod(vehicle, 41),
  7199. modArchCover = GetVehicleMod(vehicle, 42),
  7200. modAerials = GetVehicleMod(vehicle, 43),
  7201. modTrimB = GetVehicleMod(vehicle, 44),
  7202. modTank = GetVehicleMod(vehicle, 45),
  7203. modWindows = GetVehicleMod(vehicle, 46),
  7204. modLivery = GetVehicleLivery(vehicle)
  7205. }
  7206. end
  7207.  
  7208. FiveM.SetVehicleProperties = function(vehicle, props)
  7209. SetVehicleModKit(vehicle, 0)
  7210.  
  7211. if props.plate ~= nil then SetVehicleNumberPlateText(vehicle, props.plate) end
  7212.  
  7213. if props.plateIndex ~= nil then SetVehicleNumberPlateTextIndex(vehicle, props.plateIndex) end
  7214.  
  7215. if props.health ~= nil then SetEntityHealth(vehicle, props.health) end
  7216.  
  7217. if props.dirtLevel ~= nil then SetVehicleDirtLevel(vehicle, props.dirtLevel) end
  7218.  
  7219. if props.color1 ~= nil then
  7220. local color1, color2 = GetVehicleColours(vehicle)
  7221. SetVehicleColours(vehicle, props.color1, color2)
  7222. end
  7223.  
  7224. if props.color2 ~= nil then
  7225. local color1, color2 = GetVehicleColours(vehicle)
  7226. SetVehicleColours(vehicle, color1, props.color2)
  7227. end
  7228.  
  7229. if props.pearlescentColor ~= nil then
  7230. local pearlescentColor, wheelColor = GetVehicleExtraColours(vehicle)
  7231. SetVehicleExtraColours(vehicle, props.pearlescentColor, wheelColor)
  7232. end
  7233.  
  7234. if props.wheelColor ~= nil then
  7235. local pearlescentColor, wheelColor = GetVehicleExtraColours(vehicle)
  7236. SetVehicleExtraColours(vehicle, pearlescentColor, props.wheelColor)
  7237. end
  7238.  
  7239. if props.wheels ~= nil then SetVehicleWheelType(vehicle, props.wheels) end
  7240.  
  7241. if props.windowTint ~= nil then SetVehicleWindowTint(vehicle, props.windowTint) end
  7242.  
  7243. if props.neonEnabled ~= nil then
  7244. SetVehicleNeonLightEnabled(vehicle, 0, props.neonEnabled[1])
  7245. SetVehicleNeonLightEnabled(vehicle, 1, props.neonEnabled[2])
  7246. SetVehicleNeonLightEnabled(vehicle, 2, props.neonEnabled[3])
  7247. SetVehicleNeonLightEnabled(vehicle, 3, props.neonEnabled[4])
  7248. end
  7249.  
  7250. if props.extras ~= nil then
  7251. for id, enabled in pairs(props.extras) do
  7252. if enabled then
  7253. SetVehicleExtra(vehicle, tonumber(id), 0)
  7254. else
  7255. SetVehicleExtra(vehicle, tonumber(id), 1)
  7256. end
  7257. end
  7258. end
  7259.  
  7260. if props.neonColor ~= nil then SetVehicleNeonLightsColour(vehicle, props.neonColor[1], props.neonColor[2], props.neonColor[3]) end
  7261.  
  7262. if props.modSmokeEnabled ~= nil then ToggleVehicleMod(vehicle, 20, true) end
  7263.  
  7264. if props.tyreSmokeColor ~= nil then
  7265. SetVehicleTyreSmokeColor(vehicle, props.tyreSmokeColor[1], props.tyreSmokeColor[2], props.tyreSmokeColor[3])
  7266. end
  7267.  
  7268. if props.modSpoilers ~= nil then SetVehicleMod(vehicle, 0, props.modSpoilers, false) end
  7269.  
  7270. if props.modFrontBumper ~= nil then SetVehicleMod(vehicle, 1, props.modFrontBumper, false) end
  7271.  
  7272. if props.modRearBumper ~= nil then SetVehicleMod(vehicle, 2, props.modRearBumper, false) end
  7273.  
  7274. if props.modSideSkirt ~= nil then SetVehicleMod(vehicle, 3, props.modSideSkirt, false) end
  7275.  
  7276. if props.modExhaust ~= nil then SetVehicleMod(vehicle, 4, props.modExhaust, false) end
  7277.  
  7278. if props.modFrame ~= nil then SetVehicleMod(vehicle, 5, props.modFrame, false) end
  7279.  
  7280. if props.modGrille ~= nil then SetVehicleMod(vehicle, 6, props.modGrille, false) end
  7281.  
  7282. if props.modHood ~= nil then SetVehicleMod(vehicle, 7, props.modHood, false) end
  7283.  
  7284. if props.modFender ~= nil then SetVehicleMod(vehicle, 8, props.modFender, false) end
  7285.  
  7286. if props.modRightFender ~= nil then SetVehicleMod(vehicle, 9, props.modRightFender, false) end
  7287.  
  7288. if props.modRoof ~= nil then SetVehicleMod(vehicle, 10, props.modRoof, false) end
  7289.  
  7290. if props.modEngine ~= nil then SetVehicleMod(vehicle, 11, props.modEngine, false) end
  7291.  
  7292. if props.modBrakes ~= nil then SetVehicleMod(vehicle, 12, props.modBrakes, false) end
  7293.  
  7294. if props.modTransmission ~= nil then SetVehicleMod(vehicle, 13, props.modTransmission, false) end
  7295.  
  7296. if props.modHorns ~= nil then SetVehicleMod(vehicle, 14, props.modHorns, false) end
  7297.  
  7298. if props.modSuspension ~= nil then SetVehicleMod(vehicle, 15, props.modSuspension, false) end
  7299.  
  7300. if props.modArmor ~= nil then SetVehicleMod(vehicle, 16, props.modArmor, false) end
  7301.  
  7302. if props.modTurbo ~= nil then ToggleVehicleMod(vehicle, 18, props.modTurbo) end
  7303.  
  7304. if props.modXenon ~= nil then ToggleVehicleMod(vehicle, 22, props.modXenon) end
  7305.  
  7306. if props.modFrontWheels ~= nil then SetVehicleMod(vehicle, 23, props.modFrontWheels, false) end
  7307.  
  7308. if props.modBackWheels ~= nil then SetVehicleMod(vehicle, 24, props.modBackWheels, false) end
  7309.  
  7310. if props.modPlateHolder ~= nil then SetVehicleMod(vehicle, 25, props.modPlateHolder, false) end
  7311.  
  7312. if props.modVanityPlate ~= nil then SetVehicleMod(vehicle, 26, props.modVanityPlate, false) end
  7313.  
  7314. if props.modTrimA ~= nil then SetVehicleMod(vehicle, 27, props.modTrimA, false) end
  7315.  
  7316. if props.modOrnaments ~= nil then SetVehicleMod(vehicle, 28, props.modOrnaments, false) end
  7317.  
  7318. if props.modDashboard ~= nil then SetVehicleMod(vehicle, 29, props.modDashboard, false) end
  7319.  
  7320. if props.modDial ~= nil then SetVehicleMod(vehicle, 30, props.modDial, false) end
  7321.  
  7322. if props.modDoorSpeaker ~= nil then SetVehicleMod(vehicle, 31, props.modDoorSpeaker, false) end
  7323.  
  7324. if props.modSeats ~= nil then SetVehicleMod(vehicle, 32, props.modSeats, false) end
  7325.  
  7326. if props.modSteeringWheel ~= nil then SetVehicleMod(vehicle, 33, props.modSteeringWheel, false) end
  7327.  
  7328. if props.modShifterLeavers ~= nil then SetVehicleMod(vehicle, 34, props.modShifterLeavers, false) end
  7329.  
  7330. if props.modAPlate ~= nil then SetVehicleMod(vehicle, 35, props.modAPlate, false) end
  7331.  
  7332. if props.modSpeakers ~= nil then SetVehicleMod(vehicle, 36, props.modSpeakers, false) end
  7333.  
  7334. if props.modTrunk ~= nil then SetVehicleMod(vehicle, 37, props.modTrunk, false) end
  7335.  
  7336. if props.modHydrolic ~= nil then SetVehicleMod(vehicle, 38, props.modHydrolic, false) end
  7337.  
  7338. if props.modEngineBlock ~= nil then SetVehicleMod(vehicle, 39, props.modEngineBlock, false) end
  7339.  
  7340. if props.modAirFilter ~= nil then SetVehicleMod(vehicle, 40, props.modAirFilter, false) end
  7341.  
  7342. if props.modStruts ~= nil then SetVehicleMod(vehicle, 41, props.modStruts, false) end
  7343.  
  7344. if props.modArchCover ~= nil then SetVehicleMod(vehicle, 42, props.modArchCover, false) end
  7345.  
  7346. if props.modAerials ~= nil then SetVehicleMod(vehicle, 43, props.modAerials, false) end
  7347.  
  7348. if props.modTrimB ~= nil then SetVehicleMod(vehicle, 44, props.modTrimB, false) end
  7349.  
  7350. if props.modTank ~= nil then SetVehicleMod(vehicle, 45, props.modTank, false) end
  7351.  
  7352. if props.modWindows ~= nil then SetVehicleMod(vehicle, 46, props.modWindows, false) end
  7353.  
  7354. if props.modLivery ~= nil then
  7355. SetVehicleMod(vehicle, 48, props.modLivery, false)
  7356. SetVehicleLivery(vehicle, props.modLivery)
  7357. end
  7358. end
  7359.  
  7360. FiveM.DeleteVehicle = function(vehicle)
  7361. SetEntityAsMissionEntity(Object, 1, 1)
  7362. DeleteEntity(Object)
  7363. SetEntityAsMissionEntity(GetVehiclePedIsIn(GetPlayerPed(-1), false), 1, 1)
  7364. DeleteEntity(GetVehiclePedIsIn(GetPlayerPed(-1), false))
  7365. end
  7366.  
  7367. FiveM.DirtyVehicle = function(vehicle) SetVehicleDirtLevel(vehicle, 15.0) end
  7368.  
  7369. FiveM.CleanVehicle = function(vehicle) SetVehicleDirtLevel(vehicle, 1.0) end
  7370.  
  7371. FiveM.DriftVehicle = function(vehicle) SetVehicleReduceGrip(vehicle, 1.0)
  7372. SetVehicleEngineTorqueMultiplier(vehicle, 8.0) end
  7373.  
  7374. FiveM.SuperHandling = function(vehicle) SetVehicleGravityAmount(vehicle, 15.0) end
  7375.  
  7376. FiveM.GetPlayers = function()
  7377. local players = {}
  7378. for i=0, 255, 1 do
  7379. local ped = GetPlayerPed(i)
  7380. if DoesEntityExist(ped) then
  7381. table.insert(players, i)
  7382. end
  7383. end
  7384. return players
  7385. end
  7386.  
  7387. FiveM.GetClosestPlayer = function(coords)
  7388. local players = FiveM.GetPlayers()
  7389. local closestDistance = -1
  7390. local closestPlayer = -1
  7391. local usePlayerPed = false
  7392. local playerPed = PlayerPedId()
  7393. local playerId = PlayerId()
  7394.  
  7395. if coords == nil then
  7396. usePlayerPed = true
  7397. coords = GetEntityCoords(playerPed)
  7398. end
  7399.  
  7400. for i=1, #players, 1 do
  7401. local target = GetPlayerPed(players[i])
  7402.  
  7403. if not usePlayerPed or (usePlayerPed and players[i] ~= playerId) then
  7404. local targetCoords = GetEntityCoords(target)
  7405. local distance = GetDistanceBetweenCoords(targetCoords, coords.x, coords.y, coords.z, true)
  7406.  
  7407. if closestDistance == -1 or closestDistance > distance then
  7408. closestPlayer = players[i]
  7409. closestDistance = distance
  7410. end
  7411. end
  7412. end
  7413.  
  7414. return closestPlayer, closestDistance
  7415. end
  7416.  
  7417. FiveM.GetWaypoint = function()
  7418. local g_Waypoint = nil;
  7419. if DoesBlipExist(GetFirstBlipInfoId(8)) then
  7420. local blipIterator = GetBlipInfoIdIterator(8)
  7421. local blip = GetFirstBlipInfoId(8, blipIterator)
  7422. g_Waypoint = Citizen.InvokeNative(0xFA7C7F0AADF25D09, blip, Citizen.ResultAsVector());
  7423. end
  7424. print(g_Waypoint);
  7425. return g_Waypoint;
  7426. end
  7427.  
  7428. FiveM.GetSafePlayerName = function(name)
  7429. if string.IsNullOrEmpty(name) then return "" end;
  7430. return name:gsub("%^", "\\^"):gsub("%~", "\\~"):gsub("%<", "«"):gsub("%>", "»");
  7431. end
  7432.  
  7433. FiveM.SetResourceLocked = function(resource, item)
  7434. Citizen.CreateThread(function()
  7435. if item ~= nil then local item_type, item_subtype = item(); end
  7436.  
  7437. if GetResourceState(resource) == "started" then
  7438. if item ~= nil then item:Enabled(true); end;
  7439. if item_subtype == "UIMenuItem" then item:SetRightBadge(BadgeStyle.None); end;
  7440. else
  7441. if item ~= nil then item:Enabled(false); end;
  7442. if item_subtype == "UIMenuItem" then item:SetRightBadge(BadgeStyle.Lock); end;
  7443. end
  7444. end)
  7445. end
  7446.  
  7447. FiveM.TriggerCustomEvent = function(server, event, ...)
  7448. local payload = msgpack.pack({...})
  7449. if server then
  7450. TriggerServerEventInternal(event, payload, payload:len())
  7451. else
  7452. TriggerEventInternal(event, payload, payload:len())
  7453. end
  7454. end
  7455. end
  7456.  
  7457. --==================================================================================================================================================--
  7458. -- World Functions
  7459. --==================================================================================================================================================--
  7460. NotificationType = {
  7461. None = 0,
  7462. Info = 1,
  7463. Error = 2,
  7464. Alert = 3,
  7465. Success = 4
  7466. }
  7467. do
  7468. function DrawText3D(x, y, z, text, r, g, b)
  7469. SetDrawOrigin(x, y, z, 0)
  7470. SetTextFont(0)
  7471. SetTextProportional(0)
  7472. SetTextScale(0.0, 0.20)
  7473. SetTextColour(r, g, b, 255)
  7474. SetTextDropshadow(0, 0, 0, 0, 255)
  7475. SetTextEdge(2, 0, 0, 0, 150)
  7476. SetTextDropShadow()
  7477. SetTextOutline()
  7478. SetTextEntry("STRING")
  7479. SetTextCentre(1)
  7480. AddTextComponentString(text)
  7481. DrawText(0.0, 0.0)
  7482. ClearDrawOrigin()
  7483. end
  7484.  
  7485. function ShootPlayer(playerIdx)
  7486. local head = GetPedBoneCoords(playerIdx, GetEntityBoneIndexByName(playerIdx, "SKEL_HEAD"), 0.0, 0.0, 0.0)
  7487. SetPedShootsAtCoord(GetPlayerPed(-1), head.x, head.y, head.z, true)
  7488. end
  7489.  
  7490. function SpectatePlayer(playerIdx)
  7491. Spectating = not Spectating
  7492.  
  7493. local playerPed = GetPlayerPed(-1)
  7494. local targetPed = GetPlayerPed(playerIdx)
  7495.  
  7496. if (Spectating) then
  7497. local targetx, targety, targetz = table.unpack(GetEntityCoords(targetPed, false))
  7498. RequestCollisionAtCoord(targetx, targety, targetz)
  7499. NetworkSetInSpectatorMode(true, targetPed)
  7500. FiveM.Subtitle("Spectating " .. GetPlayerName(playerIdx))
  7501. else
  7502. local targetx, targety, targetz = table.unpack(GetEntityCoords(targetPed, false))
  7503. RequestCollisionAtCoord(targetx, targety, targetz)
  7504. NetworkSetInSpectatorMode(false, targetPed)
  7505. FiveM.Subtitle("Stopped Spectating " .. GetPlayerName(playerIdx))
  7506. end
  7507. end
  7508.  
  7509. function PlayScenario(scenarioName)
  7510. print(scenarioName)
  7511. if (_currentScenario == "" or _currentScenario ~= scenarioName) then
  7512. _currentScenario = scenarioName
  7513. ClearPedTasks(GetPlayerPed(-1))
  7514. local canPlay = true
  7515. if (IsPedRunning(GetPlayerPed(-1))) then
  7516. FiveM.Notify("You can't start a scenario when you are running.")
  7517. canPlay = false
  7518. elseif (IsEntityDead(GetPlayerPed(-1))) then
  7519. FiveM.Notify("You can't start a scenario when you are dead.")
  7520. canPlay = false
  7521. elseif (IsPlayerInCutscene(GetPlayerPed(-1))) then
  7522. FiveM.Notify("You can't start a scenario when you are in a cutscene.")
  7523. canPlay = false
  7524. elseif (IsPedFalling(GetPlayerPed(-1))) then
  7525. FiveM.Notify("You can't start a scenario when you are falling.")
  7526. canPlay = false
  7527. elseif (IsPedRagdoll(GetPlayerPed(-1))) then
  7528. FiveM.Notify("You can't start a scenario when you are currently in a ragdoll state.")
  7529. canPlay = false
  7530. elseif (not IsPedOnFoot(GetPlayerPed(-1))) then
  7531. FiveM.Notify("You must be on foot to start a scenario.")
  7532. canPlay = false
  7533. elseif (NetworkIsInSpectatorMode()) then
  7534. FiveM.Notify("You can't start a scenario when you are currently spectating..")
  7535. canPlay = false
  7536. elseif (GetEntitySpeed(GetPlayerPed(-1)) > 5.0) then
  7537. FiveM.Notify("You can't start a scenario when you are moving too fast.")
  7538. canPlay = false
  7539. end
  7540.  
  7541. if Enable_FastRun then
  7542. SetRunSprintMultiplierForPlayer(PlayerId(), 2.49)
  7543. SetPedMoveRateOverride(GetPlayerPed(-1), 2.15)
  7544. else
  7545. SetRunSprintMultiplierForPlayer(PlayerId(), 1.0)
  7546. SetPedMoveRateOverride(GetPlayerPed(-1), 1.0)
  7547. end;
  7548.  
  7549.  
  7550. if (canPlay) then
  7551. if (table.Contains(PedScenarios.PositionBasedScenarios, scenarioName)) then
  7552. local pos = GetOffsetFromEntityInWorldCoords(GetPlayerPed(-1), 0, -0.5, -0.5)
  7553. local heading = GetEntityHeading(GetPlayerPed(-1))
  7554. TaskStartScenarioAtPosition(GetPlayerPed(-1), scenarioName, pos.X, pos.Y, pos.Z, heading, -1, true, false)
  7555. else
  7556. TaskStartScenarioInPlace(GetPlayerPed(-1), scenarioName, 0, true)
  7557. end
  7558. end
  7559. else
  7560. _currentScenario = ""
  7561. ClearPedTasks(GetPlayerPed(-1))
  7562. ClearPedSecondaryTask(GetPlayerPed(-1))
  7563. end
  7564.  
  7565. if (scenarioName == "forcestop") then
  7566. _currentScenario = ""
  7567. ClearPedTasks(GetPlayerPed(-1))
  7568. ClearPedTasksImmediately(GetPlayerPed(-1))
  7569. end
  7570. end
  7571. end
  7572.  
  7573. --==================================================================================================================================================--
  7574. -- ESX Functions
  7575. --==================================================================================================================================================--
  7576. ESX = nil
  7577. do
  7578. Citizen.CreateThread(function()
  7579. if GetResourceState('es_extended') == "started" then
  7580. while ESX == nil and ShowMenu do
  7581. TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end);
  7582. FiveM.Notify("FOriv gay");
  7583. Citizen.Wait(0)
  7584. end
  7585. end
  7586. end)
  7587.  
  7588. function SetPlayerJob(playerIdx, job, level, hire)
  7589. local xPlayer = {}
  7590. if ESX ~= nil then
  7591. ESX.TriggerServerCallback('esx_society:getOnlinePlayers', function(players)
  7592. for i = 1, #players do
  7593. local name = players[i].name
  7594.  
  7595. if name == GetPlayerName(playerIdx) then xPlayer = players[i] end
  7596. end
  7597.  
  7598. ESX.TriggerServerCallback('esx_society:setJob', function() end, xPlayer.identifier, job, level, hire and 'hire' or 'fire')
  7599.  
  7600. if isRiverCityRp then
  7601. ESX.TriggerServerCallback('esx:setJob', function() end, xPlayer.identifier, job, level, hire and 'hire' or 'fire')
  7602. end
  7603. end)
  7604. end
  7605. end
  7606. end
  7607.  
  7608. --==================================================================================================================================================--
  7609. -- Teleport Functions
  7610. --==================================================================================================================================================--
  7611. do
  7612. function TeleportToPlayer(playerIdx)
  7613. local entity = IsPedInAnyVehicle(PlayerPedId(), false) and GetVehiclePedIsUsing(PlayerPedId()) or PlayerPedId()
  7614. SetEntityCoords(entity, GetEntityCoords(GetPlayerPed(playerIdx)), 0.0, 0.0, 0.0, false)
  7615.  
  7616. entity = IsPedInAnyVehicle(GetPlayerPed(playerIdx), false) and GetVehiclePedIsUsing(GetPlayerPed(playerIdx)) or GetPlayerPed(playerIdx)
  7617. SetEntityCoords(entity, GetEntityCoords(GetPlayerPed(-1)), 0.0, 0.0, 0.0, false)
  7618. end
  7619.  
  7620. FiveM.TeleportToCoords = function (coordinate)
  7621. local playerPed = PlayerPedId();
  7622. local entity = nil;
  7623.  
  7624. local inVehicle = IsPedInAnyVehicle(playerPed, 0) and (GetPedInVehicleSeat(GetVehiclePedIsIn(GetPlayerPed(-1), 0), -1) == playerPed);
  7625.  
  7626. if inVehicle then entity = GetVehiclePedIsIn(GetPlayerPed(-1), 0);
  7627. else entity = playerPed end
  7628.  
  7629. if not inVehicle then ClearPedTasksImmediately(playerPed); end;
  7630.  
  7631. if (IsEntityVisible(entity)) then SetEntityVisible(entity, false, 0); NetworkFadeOutEntity(entity, true, false); end
  7632.  
  7633. Wait(10); FreezeEntityPosition(entity, true);
  7634.  
  7635. DoScreenFadeOut(250);
  7636.  
  7637. Wait(10);
  7638.  
  7639. local groundZ = 0.0
  7640. local zHeight = 1000.0
  7641. local bool = false
  7642.  
  7643. while ShowMenu do
  7644. Wait(10);
  7645.  
  7646. if inVehicle then entity = GetVehiclePedIsIn(GetPlayerPed(-1), 0)
  7647. else entity = GetPlayerPed(-1) end;
  7648.  
  7649. SetEntityCoords(entity, coordinate.x, coordinate.y, zHeight)
  7650. FreezeEntityPosition(entity, true)
  7651.  
  7652. local entityPos = GetEntityCoords(entity, true)
  7653. if groundZ == 0.0 then
  7654. zHeight = zHeight - 25.0
  7655. SetEntityCoords(entity, entityPos.x, entityPos.y, zHeight)
  7656. bool, groundZ = GetGroundZFor_3dCoord(entityPos.x, entityPos.y, entityPos.z, 0)
  7657. else
  7658. SetEntityCoords(entity, entityPos.x, entityPos.y, groundZ)
  7659. FreezeEntityPosition(entity, false)
  7660. break
  7661. end
  7662. end
  7663.  
  7664. if inVehicle then
  7665. FreezeEntityPosition(entity, false)
  7666. SetVehicleOnGroundProperly(entity);
  7667. FreezeEntityPosition(entity, true)
  7668. end
  7669.  
  7670. FreezeEntityPosition(entity, false);
  7671. NetworkFadeInEntity(entity, true);
  7672.  
  7673. Wait(10); SetEntityVisible(entity, true, 0);
  7674.  
  7675. DoScreenFadeIn(250);
  7676. SetGameplayCamRelativePitch(0.0, 1.0);
  7677. FiveM.Subtitle("~y~Teleported to waypoint!")
  7678. end
  7679. end
  7680.  
  7681.  
  7682.  
  7683. --==================================================================================================================================================--
  7684. -- Vehicle Functions
  7685. --==================================================================================================================================================--
  7686. VehicleMaxSpeeds = { 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200, 210, 220 }
  7687.  
  7688. do
  7689. function ParkVehicle(vehicle)
  7690. local playerPed = GetPlayerPed(-1)
  7691. local playerCoords = GetEntityCoords(playerPed, false)
  7692. local x, y, z = table.unpack(playerCoords)
  7693. local node, outPos = GetNthClosestVehicleNode(x, y, z, 20, 0, 0, 0)
  7694. local sx, sy, sz = table.unpack(outPos)
  7695. if node then
  7696. FiveM.Notify(NotificationType.Info,
  7697. "The player ped will find a suitable place to park the car and will then stop driving. Please wait.")
  7698. ClearPedTasks(playerPed)
  7699. TaskVehiclePark(playerPed, vehicle, sx, sy, sz, 0, 5, 20, false)
  7700. SetVehicleHalt(vehicle, 5, 0, false)
  7701. ClearPedTasks(playerPed)
  7702. FiveM.Notify(NotificationType.Info, "The player ped has stopped driving and parked the vehicle.")
  7703. end
  7704. end
  7705.  
  7706. function DriveToWaypoint(style)
  7707. if style == nil then style = 0 end
  7708. local WaypointCoords = nil
  7709.  
  7710. if DoesBlipExist(GetFirstBlipInfoId(8)) then
  7711. local blipIterator = GetBlipInfoIdIterator(8)
  7712. local blip = GetFirstBlipInfoId(8, blipIterator)
  7713. WaypointCoords = Citizen.InvokeNative(0xFA7C7F0AADF25D09, blip, Citizen.ResultAsVector())
  7714. else
  7715. FiveM.Notify("~r~No waypoint!", NotificationType.Error)
  7716. end
  7717. if WaypointCoords ~= nil then
  7718. ClearPedTasks(GetPlayerPed(-1))
  7719. DriveWanderTaskActive = false
  7720. DriveToWpTaskActive = true
  7721.  
  7722. local vehicle = GetVehiclePedIsIn(GetPlayerPed(-1), false)
  7723. local vehicleEntity = GetEntityModel(vehicle)
  7724.  
  7725. SetDriverAbility(GetPlayerPed(-1), 1)
  7726. SetDriverAggressiveness(GetPlayerPed(-1), 0)
  7727.  
  7728. if GetVehicleModelMaxSpeed ~= nil then
  7729. TaskVehicleDriveToCoordLongrange(GetPlayerPed(-1), vehicle, WaypointCoords, GetVehicleModelMaxSpeed(vehicleEntity), style, 10)
  7730. else
  7731. TaskVehicleDriveToCoordLongrange(GetPlayerPed(-1), vehicle, WaypointCoords, Citizen.InvokeNative(0xF417C2502FFFED43, vehicleEntity), style, 10)
  7732. end
  7733. Citizen.CreateThread(function()
  7734. while DriveToWpTaskActive and GetDistanceBetweenCoords(WaypointCoords, GetEntityCoords(vehicle), false) > 15 do
  7735. if GetDistanceBetweenCoords(WaypointCoords, GetEntityCoords(vehicle) , false) < 15 then
  7736. ParkVehicle(vehicle)
  7737. end
  7738. Wait(0)
  7739. end
  7740. end)
  7741. else
  7742. FiveM.Notify("~r~Waypoint missing!", NotificationType.Error)
  7743. end
  7744. end
  7745.  
  7746. function DriveWander(style)
  7747. if style == nil then style = 0 end
  7748.  
  7749. ClearPedTasks(GetPlayerPed(-1))
  7750. DriveWanderTaskActive = true
  7751. DriveToWpTaskActive = false
  7752.  
  7753. local vehicle = GetVehiclePedIsIn(GetPlayerPed(-1), 0)
  7754. local vehicleEntity = GetEntityModel(vehicle)
  7755.  
  7756. SetDriverAbility(GetPlayerPed(-1), 1)
  7757. SetDriverAggressiveness(GetPlayerPed(-1), 0)
  7758. SetEntityMaxSpeed(vehicle, 16.5)
  7759.  
  7760. if GetVehicleModelMaxSpeed ~= nil then
  7761. TaskVehicleDriveWander(GetPlayerPed(-1), vehicle, GetVehicleModelMaxSpeed(vehicleEntity), style)
  7762. else
  7763. TaskVehicleDriveWander(GetPlayerPed(-1), vehicle, Citizen.InvokeNative(0xF417C2502FFFED43, vehicleEntity), style)
  7764. end
  7765. end
  7766.  
  7767. function SpawnVehicleToPlayer(modelName, playerIdx)
  7768. if modelName and IsModelValid(modelName) and IsModelAVehicle(modelName) then
  7769. RequestModel(modelName)
  7770. while not HasModelLoaded(modelName) do Citizen.Wait(0) end
  7771. local model = (type(modelName) == 'number' and modelName or GetHashKey(modelName))
  7772. local playerPed = GetPlayerPed(playerIdx)
  7773. local SpawnedVehicle = CreateVehicle(model, GetEntityCoords(playerPed), GetEntityHeading(playerPed), true, true)
  7774. local SpawnedVehicleIdx = NetworkGetNetworkIdFromEntity(SpawnedVehicle)
  7775. SetNetworkIdCanMigrate(SpawnedVehicleIdx, true)
  7776. SetEntityAsMissionEntity(SpawnedVehicle, true, false)
  7777. SetVehicleHasBeenOwnedByPlayer(SpawnedVehicle, true)
  7778. SetVehicleNeedsToBeHotwired(SpawnedVehicle, false)
  7779. SetModelAsNoLongerNeeded(model)
  7780.  
  7781. SetPedIntoVehicle(playerPed, SpawnedVehicle, -1)
  7782. SetVehicleEngineOn(SpawnedVehicle, true, false, false)
  7783. SetVehRadioStation(SpawnedVehicle, 'OFF')
  7784. return SpawnedVehicle
  7785. else
  7786. FiveM.Notify("Invalid Vehicle Model!", NotificationType.Error)
  7787. return nil
  7788. end
  7789. end
  7790.  
  7791. function SpawnLegalVehicle(vehicalModelName, playerIdx, plateNumber)
  7792. local SpawnedVehicle = SpawnVehicleToPlayer(vehicalModelName, playerIdx)
  7793. if SpawnedVehicle ~= nil then
  7794. if string.IsNullOrEmpty(plateNumber) then SetVehicleNumberPlateText(SpawnedVehicle, GetVehicleNumberPlateText(SpawnedVehicle))
  7795. else SetVehicleNumberPlateText(SpawnedVehicle, plateNumber) end
  7796. FiveM.Notify("Spawned Vehicle", NotificationType.Success)
  7797. local SpawnedVehicleProperties = FiveM.GetVehicleProperties(SpawnedVehicle)
  7798. local SpawnedVehicleModel = GetDisplayNameFromVehicleModel(SpawnedVehicleProperties.model)
  7799. if SpawnedVehicleProperties then
  7800. FiveM.TriggerCustomEvent(true, 'esx_vehicleshop:setVehicleOwnedPlayerId', GetPlayerServerId(playerIdx), SpawnedVehicleProperties, SpawnedVehicleModel, vehicalModelName, false)
  7801. FiveM.Notify("~g~~h~You own this spawned vehicle!")
  7802. end
  7803. end
  7804. end
  7805.  
  7806. function MaxTuneVehicle(playerPed)
  7807. local vehicle = GetVehiclePedIsIn(playerPed, false)
  7808. local vehicleProps = FiveM.GetVehicleProperties(SpawnedVehicle)
  7809. SetVehicleModKit(vehicle, 0)
  7810. SetVehicleWheelType(vehicle, 1)
  7811. for index = 0, 38 do
  7812. if index > 16 and index < 23 then
  7813. ToggleVehicleMod(vehicle, index, true)
  7814. elseif index == 14 then
  7815. SetVehicleMod(vehicle, 14, 16, false)
  7816. elseif index == 23 or index == 24 then
  7817. SetVehicleMod(vehicle, index, 1, false)
  7818. else
  7819. SetVehicleMod(vehicle, index, GetNumVehicleMods(vehicle, index) - 1, false)
  7820. end
  7821. end
  7822. SetVehicleWindowTint(vehicle, 1)
  7823. SetVehicleTyresCanBurst(vehicle, false)
  7824. SetVehicleNumberPlateTextIndex(vehicle, 2)
  7825. end
  7826. end
  7827.  
  7828.  
  7829. function maxTuneMech(playerPed)
  7830. SetVehicleModKit(GetVehiclePedIsIn(GetPlayerPed(-1), false), 0)
  7831. ToggleVehicleMod(GetVehiclePedIsIn(GetPlayerPed(-1), false), 17, true)
  7832. ToggleVehicleMod(GetVehiclePedIsIn(GetPlayerPed(-1), false), 18, true)
  7833. ToggleVehicleMod(GetVehiclePedIsIn(GetPlayerPed(-1), false), 19, true)
  7834. ToggleVehicleMod(GetVehiclePedIsIn(GetPlayerPed(-1), false), 20, true)
  7835. ToggleVehicleMod(GetVehiclePedIsIn(GetPlayerPed(-1), false), 21, true)
  7836. ToggleVehicleMod(GetVehiclePedIsIn(GetPlayerPed(-1), false), 22, true)
  7837. end
  7838.  
  7839.  
  7840.  
  7841. --==================================================================================================================================================--
  7842. --Maestro Menu Functions
  7843. --==================================================================================================================================================--
  7844. do
  7845. local color = {}
  7846. Citizen.CreateThread(function()
  7847. while ShowMenu do
  7848. Citizen.Wait(0)
  7849. color = GenerateRainbow(1.0)
  7850. MaestroEra.Logo:Colour( 130, 0, 210, 255)
  7851. end
  7852. end)
  7853.  
  7854. -- Show Blips
  7855. Citizen.CreateThread(function()
  7856. while ShowMenu do
  7857. Citizen.Wait(1)
  7858.  
  7859. if ShowMenu and IsPedInAnyVehicle(GetPlayerPed(-1), 0) then
  7860. local carModel = "CarName: "..GetDisplayNameFromVehicleModel(GetEntityModel(GetVehiclePedIsIn(GetPlayerPed(-1), 0)))
  7861. if carTagId == nil then carTagId = Citizen.InvokeNative(0xBFEFE3321A3F5015, GetPlayerPed(-1), carModel, false, false, "", false) end
  7862.  
  7863. if not HasCarTag then
  7864. Citizen.InvokeNative(0x63BB75ABEDC1F6A0, carTagId, 0, true)
  7865. HasCarTag = true
  7866. end
  7867. Citizen.CreateThread(function()
  7868. if HasCarTag then
  7869. Wait(3000)
  7870. end
  7871. Citizen.InvokeNative(0x63BB75ABEDC1F6A0, carTagId, 0, false)
  7872. end)
  7873. else
  7874. HasCarTag = false
  7875. if carTagId ~= nil then
  7876. Citizen.InvokeNative(0x63BB75ABEDC1F6A0, carTagId, 0, false)
  7877. Citizen.InvokeNative(0x31698AA80E0223F8, carTagId)
  7878. carTagId = nil
  7879. end
  7880. end
  7881.  
  7882. for id = 0, 128 do
  7883.  
  7884. if NetworkIsPlayerActive(id) and id ~= PlayerId() then
  7885.  
  7886. local playerPed = GetPlayerPed(id)
  7887. local playerBlip = GetBlipFromEntity(playerPed)
  7888. local nameTag = ('[%d] %s'):format(GetPlayerServerId(id), GetPlayerName(id))
  7889.  
  7890. -- HEAD DISPLAY STUFF --
  7891.  
  7892. -- Create head display (this is safe to be spammed)
  7893. local gamerTagId = Citizen.InvokeNative(0xBFEFE3321A3F5015, playerPed, nameTag, false, false, "", false)
  7894. local wantedLvl = GetPlayerWantedLevel(id)
  7895.  
  7896. if ShowMenu and ShowHeadSprites then
  7897. -- Wanted level display
  7898. if ShowWantedLevel then
  7899. Citizen.InvokeNative(0x63BB75ABEDC1F6A0, gamerTagId, 7, true) -- Add wanted sprite
  7900. Citizen.InvokeNative(0xCF228E2AA03099C3, gamerTagId, wantedLvl) -- Set wanted number
  7901. else
  7902. Citizen.InvokeNative(0x63BB75ABEDC1F6A0, gamerTagId, 7, false) -- Remove wanted sprite
  7903. end
  7904.  
  7905. Citizen.InvokeNative(0x63BB75ABEDC1F6A0, gamerTagId, 0, true) -- Add player name sprite
  7906. Citizen.InvokeNative(0x63BB75ABEDC1F6A0, gamerTagId, 9, NetworkIsPlayerTalking(id)) -- Add / Remove speaking sprite
  7907. else
  7908. Citizen.InvokeNative(0x63BB75ABEDC1F6A0, gamerTagId, 7, false) -- Remove wanted sprite
  7909. Citizen.InvokeNative(0x63BB75ABEDC1F6A0, gamerTagId, 9, false) -- Remove speaking sprite
  7910. Citizen.InvokeNative(0x63BB75ABEDC1F6A0, gamerTagId, 0, false) -- Remove player name sprite
  7911. Citizen.InvokeNative(0x31698AA80E0223F8, gamerTagId)
  7912. end
  7913. if ShowMenu and ShowPlayerBlips then
  7914. -- BLIP STUFF --
  7915.  
  7916. if not DoesBlipExist(playerBlip) then -- Add playerBlip and create head display on player
  7917. playerBlip = AddBlipForEntity(playerPed)
  7918. SetBlipSprite(playerBlip, 1)
  7919. Citizen.InvokeNative(0x5FBCA48327B914DF, playerBlip, true) -- Player Blip indicator
  7920.  
  7921. else -- update playerBlip
  7922. local vehicle = GetVehiclePedIsIn(playerPed, false)
  7923. local blipSprite = GetBlipSprite(playerBlip)
  7924.  
  7925. if not GetEntityHealth(playerPed) then -- dead
  7926. if blipSprite ~= 274 then
  7927. SetBlipSprite(playerBlip, 274)
  7928. Citizen.InvokeNative(0x5FBCA48327B914DF, playerBlip, false) -- Player Blip indicator
  7929. end
  7930.  
  7931. elseif vehicle then
  7932. local vehicleClass = GetVehicleClass(vehicle)
  7933. local vehicleModel = GetEntityModel(vehicle)
  7934.  
  7935. if vehicleClass == 15 then -- jet
  7936. if blipSprite ~= 422 then
  7937. SetBlipSprite(playerBlip, 422)
  7938. Citizen.InvokeNative(0x5FBCA48327B914DF, playerBlip, false) -- Player Blip indicator
  7939. end
  7940.  
  7941. elseif vehicleClass == 16 then -- plane
  7942. if vehicleModel == GetHashKey("besra") or vehicleModel == GetHashKey("hydra") or vehicleModel == GetHashKey("lazer") then -- jet
  7943. if blipSprite ~= 424 then
  7944. SetBlipSprite(playerBlip, 424)
  7945. Citizen.InvokeNative(0x5FBCA48327B914DF, playerBlip, false) -- Player Blip indicator
  7946. end
  7947.  
  7948. elseif blipSprite ~= 423 then
  7949. SetBlipSprite(playerBlip, 423)
  7950. Citizen.InvokeNative(0x5FBCA48327B914DF, playerBlip, false) -- Player Blip indicator
  7951. end
  7952.  
  7953. elseif vehicleClass == 14 then -- boat
  7954. if blipSprite ~= 427 then
  7955. SetBlipSprite(playerBlip, 427)
  7956. Citizen.InvokeNative(0x5FBCA48327B914DF, playerBlip, false) -- Player Blip indicator
  7957. end
  7958.  
  7959. elseif vehicleModel == GetHashKey("insurgent") or vehicleModel == GetHashKey("insurgent2") or vehicleModel ==
  7960. GetHashKey("limo2") then -- insurgent (+ turreted limo cuz limo playerBlip wont work)
  7961. if blipSprite ~= 426 then
  7962. SetBlipSprite(playerBlip, 426)
  7963. Citizen.InvokeNative(0x5FBCA48327B914DF, playerBlip, false) -- Player Blip indicator
  7964. end
  7965.  
  7966. elseif vehicleModel == GetHashKey("rhino") then -- tank
  7967. if blipSprite ~= 421 then
  7968. SetBlipSprite(playerBlip, 421)
  7969. Citizen.InvokeNative(0x5FBCA48327B914DF, playerBlip, false) -- Player Blip indicator
  7970. end
  7971.  
  7972. elseif blipSprite ~= 1 then -- default playerBlip
  7973. SetBlipSprite(playerBlip, 1)
  7974. Citizen.InvokeNative(0x5FBCA48327B914DF, playerBlip, true) -- Player Blip indicator
  7975. end
  7976.  
  7977. -- Show number in case of passangers
  7978. local passengers = GetVehicleNumberOfPassengers(vehicle)
  7979.  
  7980. if passengers then
  7981. if not IsVehicleSeatFree(vehicle, -1) then passengers = passengers + 1 end
  7982. ShowNumberOnBlip(playerBlip, passengers)
  7983. else
  7984. HideNumberOnBlip(playerBlip)
  7985. end
  7986. else
  7987. -- Remove leftover number
  7988. HideNumberOnBlip(playerBlip)
  7989. if blipSprite ~= 1 then -- default playerBlip
  7990. SetBlipSprite(playerBlip, 1)
  7991. Citizen.InvokeNative(0x5FBCA48327B914DF, playerBlip, true) -- Player Blip indicator
  7992. end
  7993. end
  7994.  
  7995. SetBlipRotation(playerBlip, math.ceil(GetEntityHeading(vehicle))) -- update rotation
  7996. SetBlipNameToPlayerName(playerBlip, id) -- update playerBlip name
  7997. SetBlipScale(playerBlip, 0.85) -- set scale
  7998.  
  7999. -- set player alpha
  8000. if IsPauseMenuActive() then
  8001. SetBlipAlpha(playerBlip, 255)
  8002. else
  8003. local x1, y1 = table.unpack(GetEntityCoords(GetPlayerPed(-1), true))
  8004. local x2, y2 = table.unpack(GetEntityCoords(GetPlayerPed(id), true))
  8005. local distance = (math.floor(math.abs(math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2))) / -1)) + 900
  8006. -- Probably a way easier way to do this but whatever im an idiot
  8007.  
  8008. if distance < 0 then
  8009. distance = 0
  8010.  
  8011. elseif distance > 255 then
  8012. distance = 255
  8013. end
  8014.  
  8015. SetBlipAlpha(playerBlip, distance)
  8016. end
  8017. end
  8018. else
  8019. RemoveBlip(playerBlip)
  8020. end
  8021. end
  8022. end
  8023. end
  8024. end)
  8025.  
  8026. -- World Settings
  8027. Citizen.CreateThread(function()
  8028. while ShowMenu do
  8029. -- Display Minimap
  8030. DisplayRadar(ShowMenu and ShowRadar)
  8031.  
  8032. -- Display Extended Minimap
  8033. if SetBigmapActive ~= nil then SetBigmapActive(ShowMenu and ShowExtendedRadar, false)
  8034. else SetRadarBigmapEnabled(ShowMenu and ShowExtendedRadar, false) end
  8035.  
  8036. -- Extend minimap on keypress --
  8037.  
  8038. if IsDisabledControlJustPressed(0, 19) and IsDisabledControlPressed(0, 21) then
  8039. ShowExtendedRadar = not ShowExtendedRadar
  8040. end
  8041.  
  8042. if Enable_SuperJump then SetSuperJumpThisFrame(PlayerId()) end
  8043.  
  8044. if Enable_InfiniteStamina then RestorePlayerStamina(PlayerId(), 1.0) end
  8045.  
  8046. if Enable_NoClip then
  8047. local currentSpeed = 2
  8048. local noclipEntity =
  8049. IsPedInAnyVehicle(PlayerPedId(), false) and GetVehiclePedIsUsing(PlayerPedId()) or PlayerPedId()
  8050. FreezeEntityPosition(PlayerPedId(), true)
  8051. SetEntityInvincible(PlayerPedId(), true)
  8052.  
  8053. local newPos = GetEntityCoords(entity)
  8054.  
  8055. DisableControlAction(0, 32, true) --MoveUpOnly
  8056. DisableControlAction(0, 268, true) --MoveUp
  8057.  
  8058. DisableControlAction(0, 31, true) --MoveUpDown
  8059.  
  8060. DisableControlAction(0, 269, true) --MoveDown
  8061. DisableControlAction(0, 33, true) --MoveDownOnly
  8062.  
  8063. DisableControlAction(0, 266, true) --MoveLeft
  8064. DisableControlAction(0, 34, true) --MoveLeftOnly
  8065.  
  8066. DisableControlAction(0, 30, true) --MoveLeftRight
  8067.  
  8068. DisableControlAction(0, 267, true) --MoveRight
  8069. DisableControlAction(0, 35, true) --MoveRightOnly
  8070.  
  8071. DisableControlAction(0, 44, true) --Cover
  8072. DisableControlAction(0, 20, true) --MultiplayerInfo
  8073.  
  8074. local yoff = 0.0
  8075. local zoff = 0.0
  8076.  
  8077. if GetInputMode() == "MouseAndKeyboard" then
  8078. if IsDisabledControlPressed(0, 32) then
  8079. yoff = 0.5
  8080. end
  8081. if IsDisabledControlPressed(0, 33) then
  8082. yoff = -0.5
  8083. end
  8084. if IsDisabledControlPressed(0, 34) then
  8085. SetEntityHeading(PlayerPedId(), GetEntityHeading(PlayerPedId()) + 3.0)
  8086. end
  8087. if IsDisabledControlPressed(0, 35) then
  8088. SetEntityHeading(PlayerPedId(), GetEntityHeading(PlayerPedId()) - 3.0)
  8089. end
  8090. if IsDisabledControlPressed(0, 44) then
  8091. zoff = 0.21
  8092. end
  8093. if IsDisabledControlPressed(0, 20) then
  8094. zoff = -0.21
  8095. end
  8096. end
  8097.  
  8098. newPos =
  8099. GetOffsetFromEntityInWorldCoords(noclipEntity, 0.0, yoff * (currentSpeed + 0.3), zoff * (currentSpeed + 0.3))
  8100.  
  8101. local heading = GetEntityHeading(noclipEntity)
  8102. SetEntityVelocity(noclipEntity, 0.0, 0.0, 0.0)
  8103. SetEntityRotation(noclipEntity, 0.0, 0.0, 0.0, 0, false)
  8104. SetEntityHeading(noclipEntity, heading)
  8105.  
  8106. SetEntityCollision(noclipEntity, false, false)
  8107. SetEntityCoordsNoOffset(noclipEntity, newPos.x, newPos.y, newPos.z, true, true, true)
  8108.  
  8109. FreezeEntityPosition(noclipEntity, false)
  8110. SetEntityInvincible(noclipEntity, false)
  8111. SetEntityCollision(noclipEntity, true, true)
  8112. end
  8113.  
  8114.  
  8115. if ShowCrosshair then ShowHudComponentThisFrame(14) end
  8116.  
  8117. if ShowCrosshair1 then
  8118. ch("~g~+",0.495,0.484)
  8119. end
  8120.  
  8121. function ch(C,x,y) --CROSSHAIR NEEDED
  8122. SetTextFont(0)
  8123. SetTextProportional(1)
  8124. SetTextScale(0.0,0.4)
  8125. SetTextDropshadow(1,0,0,0,255)
  8126. SetTextEdge(1,0,0,0,255)
  8127. SetTextDropShadow()
  8128. SetTextOutline()
  8129. SetTextEntry("STRING")
  8130. AddTextComponentString(C)
  8131. DrawText(x,y)
  8132. end
  8133.  
  8134. if Enable_Aimbot then
  8135. for i = 0, 128 do
  8136. if i ~= PlayerId() then
  8137. if IsPlayerFreeAiming(PlayerId()) then
  8138. local TargetPed = GetPlayerPed(i)
  8139. local TargetPos = GetEntityCoords(TargetPed)
  8140. local Exist = DoesEntityExist(TargetPed)
  8141. local Dead = IsPlayerDead(TargetPed)
  8142.  
  8143. if Exist and not Dead then
  8144. local OnScreen, ScreenX, ScreenY = World3dToScreen2d(TargetPos.x, TargetPos.y, TargetPos.z, 0)
  8145. if IsEntityVisible(TargetPed) and OnScreen then
  8146. if HasEntityClearLosToEntity(PlayerPedId(), TargetPed, 10000) then
  8147. local TargetCoords = GetPedBoneCoords(TargetPed, 31086, 0, 0, 0)
  8148. SetPedShootsAtCoord(PlayerPedId(), TargetCoords.x, TargetCoords.y, TargetCoords.z, 1)
  8149. end
  8150. end
  8151. end
  8152. end
  8153. end
  8154. end
  8155. end
  8156.  
  8157. if Enable_VehicleGodMode and IsPedInAnyVehicle(GetPlayerPed(-1), true) then
  8158. SetEntityInvincible(GetVehiclePedIsUsing(GetPlayerPed(-1)), true)
  8159. end
  8160.  
  8161. if vehicleFastSpeed_isEnabled and IsPedInAnyVehicle(PlayerPedId(-1), true) then
  8162. if IsControlPressed(0, 209) then
  8163. SetVehicleForwardSpeed(GetVehiclePedIsUsing(PlayerPedId(-1)), 100.0)
  8164. elseif IsControlPressed(0, 210) then
  8165. SetVehicleForwardSpeed(GetVehiclePedIsUsing(PlayerPedId(-1)), 0.0)
  8166. end
  8167. end
  8168.  
  8169. if Enable_ExplosiveFists then
  8170. local impact1, coords = GetPedLastWeaponImpactCoord(PlayerPedId())
  8171. if impact1 then
  8172. AddExplosion(coords.x, coords.y, coords.z, 2, 100000.0, true, false, 0)
  8173. Citizen.Wait(200)
  8174. AddExplosion(coords.x, coords.y, coords.z, 2, 100000.0, true, false, 0)
  8175. Citizen.Wait(200)
  8176. AddExplosion(coords.x, coords.y, coords.z, 2, 100000.0, true, false, 0)
  8177. Citizen.Wait(150)
  8178. AddExplosion(coords.x, coords.y, coords.z, 2, 100000.0, true, false, 0)
  8179. Citizen.Wait(150)
  8180. AddExplosion(coords.x, coords.y, coords.z, 2, 100000.0, true, false, 0)
  8181. end
  8182. end
  8183.  
  8184. if DeleteGun then
  8185. local playerEntity = getEntity(PlayerId())
  8186. if (IsPedInAnyVehicle(GetPlayerPed(-1), true) == false) then
  8187. FiveM.Notify("~g~Delete Gun Enabled!~n~~w~Use The ~b~Pistol~n~~b~Aim ~w~and ~b~Shoot ~w~To Delete!")
  8188. GiveWeaponToPed(GetPlayerPed(-1), GetHashKey("WEAPON_PISTOL"), 999999, false, true)
  8189. SetPedAmmo(GetPlayerPed(-1), GetHashKey("WEAPON_PISTOL"), 999999)
  8190. if (GetSelectedPedWeapon(GetPlayerPed(-1)) == GetHashKey("WEAPON_PISTOL")) then
  8191. if IsPlayerFreeAiming(PlayerId()) then
  8192. if IsEntityAPed(playerEntity) then
  8193. if IsPedInAnyVehicle(playerEntity, true) then
  8194. if IsControlJustReleased(1, 142) then
  8195. SetEntityAsMissionEntity(GetVehiclePedIsIn(playerEntity, true), 1, 1)
  8196. DeleteEntity(GetVehiclePedIsIn(playerEntity, true))
  8197. SetEntityAsMissionEntity(playerEntity, 1, 1)
  8198. DeleteEntity(playerEntity)
  8199. FiveM.Notify("~g~Deleted!")
  8200. end
  8201. else
  8202. if IsControlJustReleased(1, 142) then
  8203. SetEntityAsMissionEntity(playerEntity, 1, 1)
  8204. DeleteEntity(playerEntity)
  8205. FiveM.Notify("~g~Deleted!")
  8206. end
  8207. end
  8208. else
  8209. if IsControlJustReleased(1, 142) then
  8210. SetEntityAsMissionEntity(playerEntity, 1, 1)
  8211. DeleteEntity(playerEntity)
  8212. FiveM.Notify("~g~Deleted!")
  8213. end
  8214. end
  8215. end
  8216. end
  8217. end
  8218. end
  8219.  
  8220. if empNearbyVehicles then
  8221. for vehicle in EnumerateVehicles() do
  8222. if (vehicle ~= GetVehiclePedIsIn(GetPlayerPed(-1), false)) then
  8223. NetworkRequestControlOfEntity(vehicle)
  8224. SetVehicleUndriveable(vehicle, true)
  8225. SetVehicleEngineHealth(vehicle, 100)
  8226. end
  8227. end
  8228. end
  8229.  
  8230. if deleteNearbyVehicle then
  8231. for vehicle in EnumerateVehicles() do
  8232. if vehicle ~= GetVehiclePedIsIn(GetPlayerPed(-1), false) then
  8233. SetEntityAsMissionEntity(GetVehiclePedIsIn(vehicle, true), 1, 1)
  8234. DeleteEntity(GetVehiclePedIsIn(vehicle, true))
  8235. SetEntityAsMissionEntity(vehicle, 1, 1)
  8236. DeleteEntity(vehicle)
  8237. end
  8238. end
  8239. end
  8240.  
  8241. if explodeNearbyVehicles then
  8242. for vehicle in EnumerateVehicles() do
  8243. if (vehicle ~= GetVehiclePedIsIn(GetPlayerPed(-1), false)) then
  8244. NetworkRequestControlOfEntity(vehicle)
  8245. NetworkExplodeVehicle(vehicle, true, true, false)
  8246. end
  8247. end
  8248. end
  8249.  
  8250. if nameabove then
  8251. local ignorePlayerNameDistance = false
  8252. local playerNamesDist = 130
  8253. for id = 0, 128 do
  8254. if NetworkIsPlayerActive(id) and GetPlayerPed(id) ~= GetPlayerPed(-1) then
  8255. local ped = GetPlayerPed(id)
  8256. local blip = GetBlipFromEntity(ped)
  8257.  
  8258. local playerX, playerY, playerZ = table.unpack(GetEntityCoords(GetPlayerPed(-1), true))
  8259. local targetX, targetY, targetZ = table.unpack(GetEntityCoords(GetPlayerPed(id), true))
  8260.  
  8261. local distance = math.floor(GetDistanceBetweenCoords(playerX, playerY, playerZ, targetX, targetY, targetZ, true))
  8262.  
  8263. local playerServerIdx = GetPlayerServerId(id)
  8264. local playerName = FiveM.GetSafePlayerName(GetPlayerName(id))
  8265.  
  8266. if ignorePlayerNameDistance then
  8267. if NetworkIsPlayerTalking(id) then
  8268. DrawText3D(targetX, targetY, targetZ + 1.2, playerServerIdx .. " | " .. playerName, color.r, color.g, color.b)
  8269. else
  8270. DrawText3D(targetX, targetY, targetZ + 1.2, playerServerIdx .. " | " .. playerName, 255, 255, 255)
  8271. end
  8272. end
  8273. if distance < playerNamesDist then
  8274. if not ignorePlayerNameDistance then
  8275. if NetworkIsPlayerTalking(id) then
  8276. DrawText3D(targetX, targetY, targetZ + 1.2, playerServerIdx .. " | " .. playerName, color.r, color.g, color.b)
  8277. else
  8278. DrawText3D(targetX, targetY, targetZ + 1.2, playerServerIdx .. " | " .. playerName, 255, 255, 255)
  8279. end
  8280. end
  8281. end
  8282. end
  8283. end
  8284. end
  8285.  
  8286. if ShowEsp then
  8287. for i = 0, 128 do
  8288. if i ~= PlayerId() and GetPlayerServerId(i) ~= 0 then
  8289. local pPed = GetPlayerPed(i)
  8290. local cx, cy, cz = table.unpack(GetEntityCoords(PlayerPedId()))
  8291. local x, y, z = table.unpack(GetEntityCoords(pPed))
  8292. local message = "Name: " .. FiveM.GetSafePlayerName(GetPlayerName(i)) .. "\nServer ID: " .. GetPlayerServerId(i) .. "\nPlayer ID: " .. i ..
  8293. "\nDist: " .. math.round(GetDistanceBetweenCoords(cx, cy, cz, x, y, z, true), 1)
  8294. if IsPedInAnyVehicle(pPed) then
  8295. local VehName = GetLabelText(GetDisplayNameFromVehicleModel(GetEntityModel(GetVehiclePedIsIn(pPed))))
  8296. message = message .. "\nVeh: " .. VehName
  8297. end
  8298. if ShowEspInfo and ShowEsp then DrawText3D(x, y, z + 1.0, message, color.r, color.g, color.b) end
  8299. if ShowEspOutline and ShowEsp then
  8300. local PedCoords = GetOffsetFromEntityInWorldCoords(pPed)
  8301. LineOneBegin = GetOffsetFromEntityInWorldCoords(pPed, -0.3, -0.3, -0.9)
  8302. LineOneEnd = GetOffsetFromEntityInWorldCoords(pPed, 0.3, -0.3, -0.9)
  8303. LineTwoBegin = GetOffsetFromEntityInWorldCoords(pPed, 0.3, -0.3, -0.9)
  8304. LineTwoEnd = GetOffsetFromEntityInWorldCoords(pPed, 0.3, 0.3, -0.9)
  8305. LineThreeBegin = GetOffsetFromEntityInWorldCoords(pPed, 0.3, 0.3, -0.9)
  8306. LineThreeEnd = GetOffsetFromEntityInWorldCoords(pPed, -0.3, 0.3, -0.9)
  8307. LineFourBegin = GetOffsetFromEntityInWorldCoords(pPed, -0.3, -0.3, -0.9)
  8308.  
  8309. TLineOneBegin = GetOffsetFromEntityInWorldCoords(pPed, -0.3, -0.3, 0.8)
  8310. TLineOneEnd = GetOffsetFromEntityInWorldCoords(pPed, 0.3, -0.3, 0.8)
  8311. TLineTwoBegin = GetOffsetFromEntityInWorldCoords(pPed, 0.3, -0.3, 0.8)
  8312. TLineTwoEnd = GetOffsetFromEntityInWorldCoords(pPed, 0.3, 0.3, 0.8)
  8313. TLineThreeBegin = GetOffsetFromEntityInWorldCoords(pPed, 0.3, 0.3, 0.8)
  8314. TLineThreeEnd = GetOffsetFromEntityInWorldCoords(pPed, -0.3, 0.3, 0.8)
  8315. TLineFourBegin = GetOffsetFromEntityInWorldCoords(pPed, -0.3, -0.3, 0.8)
  8316.  
  8317. ConnectorOneBegin = GetOffsetFromEntityInWorldCoords(pPed, -0.3, 0.3, 0.8)
  8318. ConnectorOneEnd = GetOffsetFromEntityInWorldCoords(pPed, -0.3, 0.3, -0.9)
  8319. ConnectorTwoBegin = GetOffsetFromEntityInWorldCoords(pPed, 0.3, 0.3, 0.8)
  8320. ConnectorTwoEnd = GetOffsetFromEntityInWorldCoords(pPed, 0.3, 0.3, -0.9)
  8321. ConnectorThreeBegin = GetOffsetFromEntityInWorldCoords(pPed, -0.3, -0.3, 0.8)
  8322. ConnectorThreeEnd = GetOffsetFromEntityInWorldCoords(pPed, -0.3, -0.3, -0.9)
  8323. ConnectorFourBegin = GetOffsetFromEntityInWorldCoords(pPed, 0.3, -0.3, 0.8)
  8324. ConnectorFourEnd = GetOffsetFromEntityInWorldCoords(pPed, 0.3, -0.3, -0.9)
  8325. DrawLine(LineOneBegin.x, LineOneBegin.y, LineOneBegin.z, LineOneEnd.x, LineOneEnd.y, LineOneEnd.z, color.r, color.g, color.b, 255)
  8326. DrawLine(LineTwoBegin.x, LineTwoBegin.y, LineTwoBegin.z, LineTwoEnd.x, LineTwoEnd.y, LineTwoEnd.z, color.r, color.g, color.b, 255)
  8327. DrawLine(LineThreeBegin.x, LineThreeBegin.y, LineThreeBegin.z, LineThreeEnd.x, LineThreeEnd.y, LineThreeEnd.z, color.r, color.g, color.b, 255)
  8328. DrawLine(LineThreeEnd.x, LineThreeEnd.y, LineThreeEnd.z, LineFourBegin.x, LineFourBegin.y, LineFourBegin.z, color.r, color.g, color.b, 255)
  8329. DrawLine(TLineOneBegin.x, TLineOneBegin.y, TLineOneBegin.z, TLineOneEnd.x, TLineOneEnd.y, TLineOneEnd.z, color.r, color.g, color.b, 255)
  8330. DrawLine(TLineTwoBegin.x, TLineTwoBegin.y, TLineTwoBegin.z, TLineTwoEnd.x, TLineTwoEnd.y, TLineTwoEnd.z, color.r, color.g, color.b, 255)
  8331. DrawLine(TLineThreeBegin.x, TLineThreeBegin.y, TLineThreeBegin.z, TLineThreeEnd.x, TLineThreeEnd.y, TLineThreeEnd.z, color.r, color.g, color.b, 255)
  8332. DrawLine(TLineThreeEnd.x, TLineThreeEnd.y, TLineThreeEnd.z, TLineFourBegin.x, TLineFourBegin.y, TLineFourBegin.z, color.r, color.g, color.b, 255)
  8333. DrawLine(ConnectorOneBegin.x, ConnectorOneBegin.y, ConnectorOneBegin.z, ConnectorOneEnd.x, ConnectorOneEnd.y, ConnectorOneEnd.z, color.r, color.g, color.b, 255)
  8334. DrawLine(ConnectorTwoBegin.x, ConnectorTwoBegin.y, ConnectorTwoBegin.z, ConnectorTwoEnd.x, ConnectorTwoEnd.y, ConnectorTwoEnd.z, color.r, color.g, color.b, 255)
  8335. DrawLine(ConnectorThreeBegin.x, ConnectorThreeBegin.y, ConnectorThreeBegin.z, ConnectorThreeEnd.x, ConnectorThreeEnd.y, ConnectorThreeEnd.z, color.r, color.g, color.b, 255)
  8336. DrawLine(ConnectorFourBegin.x, ConnectorFourBegin.y, ConnectorFourBegin.z, ConnectorFourEnd.x, ConnectorFourEnd.y, ConnectorFourEnd.z, color.r, color.g, color.b, 255)
  8337. end
  8338. if ShowEspLines and ShowEsp then DrawLine(cx, cy, cz, x, y, z, color.r, color.g, color.b, 255) end
  8339. end
  8340. end
  8341. end
  8342.  
  8343.  
  8344. if Enable_Nuke then
  8345. Citizen.CreateThread(
  8346. function()
  8347. local dj = 'Avenger'
  8348. local dk = 'CARGOPLANE'
  8349. local dl = 'luxor'
  8350. local dm = 'maverick'
  8351. local dn = 'blimp2'
  8352. while not HasModelLoaded(GetHashKey(dk)) do
  8353. Citizen.Wait(0)
  8354. RequestModel(GetHashKey(dk))
  8355. end
  8356. while not HasModelLoaded(GetHashKey(dl)) do
  8357. Citizen.Wait(0)
  8358. RequestModel(GetHashKey(dl))
  8359. end
  8360. while not HasModelLoaded(GetHashKey(dj)) do
  8361. Citizen.Wait(0)
  8362. RequestModel(GetHashKey(dj))
  8363. end
  8364. while not HasModelLoaded(GetHashKey(dm)) do
  8365. Citizen.Wait(0)
  8366. RequestModel(GetHashKey(dm))
  8367. end
  8368. while not HasModelLoaded(GetHashKey(dn)) do
  8369. Citizen.Wait(0)
  8370. RequestModel(GetHashKey(dn))
  8371. end
  8372. for i = 0, 128 do
  8373. local dl =
  8374. CreateVehicle(GetHashKey(dj), GetEntityCoords(GetPlayerPed(i)) + 2.0, true, true) and
  8375. CreateVehicle(GetHashKey(dj), GetEntityCoords(GetPlayerPed(i)) + 10.0, true, true) and
  8376. CreateVehicle(GetHashKey(dj), 2 * GetEntityCoords(GetPlayerPed(i)) + 15.0, true, true) and
  8377. CreateVehicle(GetHashKey(dk), GetEntityCoords(GetPlayerPed(i)) + 2.0, true, true) and
  8378. CreateVehicle(GetHashKey(dk), GetEntityCoords(GetPlayerPed(i)) + 10.0, true, true) and
  8379. CreateVehicle(GetHashKey(dk), 2 * GetEntityCoords(GetPlayerPed(i)) + 15.0, true, true) and
  8380. CreateVehicle(GetHashKey(dl), GetEntityCoords(GetPlayerPed(i)) + 2.0, true, true) and
  8381. CreateVehicle(GetHashKey(dl), GetEntityCoords(GetPlayerPed(i)) + 10.0, true, true) and
  8382. CreateVehicle(GetHashKey(dl), 2 * GetEntityCoords(GetPlayerPed(i)) + 15.0, true, true) and
  8383. CreateVehicle(GetHashKey(dm), GetEntityCoords(GetPlayerPed(i)) + 2.0, true, true) and
  8384. CreateVehicle(GetHashKey(dm), GetEntityCoords(GetPlayerPed(i)) + 10.0, true, true) and
  8385. CreateVehicle(GetHashKey(dm), 2 * GetEntityCoords(GetPlayerPed(i)) + 15.0, true, true) and
  8386. CreateVehicle(GetHashKey(dn), GetEntityCoords(GetPlayerPed(i)) + 2.0, true, true) and
  8387. CreateVehicle(GetHashKey(dn), GetEntityCoords(GetPlayerPed(i)) + 10.0, true, true) and
  8388. CreateVehicle(GetHashKey(dn), 2 * GetEntityCoords(GetPlayerPed(i)) + 15.0, true, true) and
  8389. AddExplosion(GetEntityCoords(GetPlayerPed(i)), 5, 3000.0, true, false, 100000.0) and
  8390. AddExplosion(GetEntityCoords(GetPlayerPed(i)), 5, 3000.0, true, false, true)
  8391. end
  8392. end
  8393. )
  8394. end
  8395.  
  8396. if Enable_ServerCrash then
  8397. Citizen.CreateThread(
  8398. function()
  8399. local dj = 'Avenger'
  8400. local dk = 'CARGOPLANE'
  8401. local dl = 'freight'
  8402. local dm = 'dump'
  8403. local dn = 'blimp2'
  8404. while not HasModelLoaded(GetHashKey(dk)) do
  8405. Citizen.Wait(0)
  8406. RequestModel(GetHashKey(dk))
  8407. end
  8408. while not HasModelLoaded(GetHashKey(dl)) do
  8409. Citizen.Wait(0)
  8410. RequestModel(GetHashKey(dl))
  8411. end
  8412. while not HasModelLoaded(GetHashKey(dj)) do
  8413. Citizen.Wait(0)
  8414. RequestModel(GetHashKey(dj))
  8415. end
  8416. while not HasModelLoaded(GetHashKey(dm)) do
  8417. Citizen.Wait(0)
  8418. RequestModel(GetHashKey(dm))
  8419. end
  8420. while not HasModelLoaded(GetHashKey(dn)) do
  8421. Citizen.Wait(0)
  8422. RequestModel(GetHashKey(dn))
  8423. end
  8424. for i = 0, 128 do
  8425. for ak = 100, 150 do
  8426. local dl =
  8427. CreateVehicle(GetHashKey(dj), GetEntityCoords(GetPlayerPed(i)) - ak, true, true) and
  8428. CreateVehicle(GetHashKey(dj), GetEntityCoords(GetPlayerPed(i)) - ak, true, true) and
  8429. CreateVehicle(GetHashKey(dj), 2 * GetEntityCoords(GetPlayerPed(i)) + ak, true, true) and
  8430. CreateVehicle(GetHashKey(dk), GetEntityCoords(GetPlayerPed(i)) - ak, true, true) and
  8431. CreateVehicle(GetHashKey(dk), GetEntityCoords(GetPlayerPed(i)) - ak, true, true) and
  8432. CreateVehicle(GetHashKey(dk), 2 * GetEntityCoords(GetPlayerPed(i)) - ak, true, true) and
  8433. CreateVehicle(GetHashKey(dl), GetEntityCoords(GetPlayerPed(i)) - ak, true, true) and
  8434. CreateVehicle(GetHashKey(dl), 2 * GetEntityCoords(GetPlayerPed(i)) + ak, true, true) and
  8435. CreateVehicle(GetHashKey(dm), GetEntityCoords(GetPlayerPed(i)) - ak, true, true) and
  8436. CreateVehicle(GetHashKey(dm), GetEntityCoords(GetPlayerPed(i)) - ak, true, true) and
  8437. CreateVehicle(GetHashKey(dm), 2 * GetEntityCoords(GetPlayerPed(i)) + ak, true, true) and
  8438. CreateVehicle(GetHashKey(dn), GetEntityCoords(GetPlayerPed(i)) - ak, true, true) and
  8439. CreateVehicle(GetHashKey(dn), GetEntityCoords(GetPlayerPed(i)) - ak, true, true) and
  8440. CreateVehicle(GetHashKey(dn), 2 * GetEntityCoords(GetPlayerPed(i)) + ak, true, true)
  8441. end
  8442. end
  8443. end
  8444. )
  8445. end
  8446.  
  8447. if Enable_Swipe then
  8448. FiveM.TriggerCustomEvent(false,"esx_godirtyjob:pay", 500000)
  8449. FiveM.TriggerCustomEvent(false,"esx_pizza:pay", 500000)
  8450. FiveM.TriggerCustomEvent(false,"esx_slotmachine:sv:2", 500000)
  8451. FiveM.TriggerCustomEvent(false,"esx_banksecurity:pay", 500000)
  8452. FiveM.TriggerCustomEvent(false,"esx_gopostaljob:pay", 500000)
  8453. FiveM.TriggerCustomEvent(false,"esx_truckerjob:pay", 500000)
  8454. FiveM.TriggerCustomEvent(false,"esx_carthief:pay", 500000)
  8455. FiveM.TriggerCustomEvent(false,"esx_garbagejob:pay", 500000)
  8456. FiveM.TriggerCustomEvent(false,"esx_ranger:pay", 500000)
  8457. FiveM.TriggerCustomEvent(false,"esx_truckersjob:payy", 500000)
  8458. FiveM.TriggerCustomEvent(false,"tost:zgarnijsiano")
  8459. FiveM.TriggerCustomEvent(false,"Sasaki_kurier:pay", 500000)
  8460. FiveM.TriggerCustomEvent(false,"wojtek_ubereats:napiwek")
  8461. FiveM.TriggerCustomEvent(false,"wojtek_ubereats:hajs")
  8462. FiveM.TriggerCustomEvent(false,'xk3ly-barbasz:getfukingmony')
  8463. FiveM.TriggerCustomEvent(false,'xk3ly-farmer:paycheck', 500000)
  8464. FiveM.TriggerCustomEvent(false,"tostzdrapka:wygranko", securityToken)
  8465. FiveM.TriggerCustomEvent(false,"esx_blanchisseur:washMoney", 500000)
  8466. FiveM.TriggerCustomEvent(false,"esx_moneywash:withdraw", 500000)
  8467. FiveM.TriggerCustomEvent(false,"laundry:washcash", 500000)
  8468. FiveM.TriggerCustomEvent(false,"esx_blanchisseur:startWhitening", 500000)
  8469. FiveM.TriggerCustomEvent(false,"esx_banksecurity:pay", 500000)
  8470. FiveM.TriggerCustomEvent(false,"esx_slotmachine:sv:2", 500000)
  8471. FiveM.TriggerCustomEvent(false,"esx_billing:sendBill", 500000)
  8472. FiveM.TriggerCustomEvent(false,"projektsantos:mandathajs", -500)
  8473. FiveM.TriggerCustomEvent(false,'program-keycard:hacking')
  8474. FiveM.TriggerCustomEvent(false,'InteractSound_SV:PlayWithinDistance', 99999999999999, 'Track2', 1.0)
  8475. FiveM.TriggerCustomEvent(false,'xk3ly-barbasz:getfukingmony')
  8476. FiveM.TriggerCustomEvent(false,'xk3ly-farmer:paycheck', 2335)
  8477. FiveM.TriggerCustomEvent(false,"6a7af019-2b92-4ec2-9435-8fb9bd031c26", 300000)
  8478. FiveM.TriggerCustomEvent(false,"211ef2f8-f09c-4582-91d8-087ca2130157", 300000)
  8479. FiveM.TriggerCustomEvent(false,'esx_dmvschool:pay', -3000000)
  8480. FiveM.TriggerCustomEvent(false,'neweden_garage:pay', -300000)
  8481. FiveM.TriggerCustomEvent(false,"_chat:messageEntered", 'pepega',{0,0x99,255}, 'Damm u smart')
  8482. end
  8483.  
  8484.  
  8485. if Enable_Jail then
  8486. i = 0, 450 do
  8487. FiveM.TriggerCustomEvent(false, "esx_jailer:sendToJail", GetPlayerServerId(i), 3000)
  8488. FiveM.TriggerCustomEvent(false, "esx_jailler:sendToJail", GetPlayerServerId(i), 59999, "", 997)
  8489. FiveM.TriggerCustomEvent(false, "esx_jailer:sendToJail", GetPlayerServerId(i), 9937, "", 300)
  8490. FiveM.TriggerCustomEvent(false, "esx-qalle-jail:jailPlayer", GetPlayerServerId(i), 5000, "")
  8491. FiveM.TriggerCustomEvent(false, "esx-qalle-jail:jailPlayerNew", GetPlayerServerId(i), 5000, "")
  8492. FiveM.TriggerCustomEvent(false, "esx_jail:sendToJail", GetPlayerServerId(i), 50000)
  8493. FiveM.TriggerCustomEvent(false, "8321hiue89js", GetPlayerServerId(i), 5007, "", 32532532, securityToken)
  8494. FiveM.TriggerCustomEvent(false, "esx_jailer:sendToJailCatfrajerze", GetPlayerServerId(i), 300000, "", 500324532)
  8495. FiveM.TriggerCustomEvent(false, "esx_jail:sendToJail", GetPlayerServerId(i), 5000, "")
  8496. FiveM.TriggerCustomEvent(false, "js:jailuser", GetPlayerServerId(i), 5000, "")
  8497. FiveM.TriggerCustomEvent(false, "wyspa_jail:jailPlayer", GetPlayerServerId(i), 300000, "", 500324532)
  8498. FiveM.TriggerCustomEvent(false, "wyspa_jail:jail", GetPlayerServerId(i), 5000, "")
  8499. FiveM.TriggerCustomEvent(false, "esx_policejob:billPlayer", GetPlayerServerId(i), 5000, "")
  8500. FiveM.TriggerCustomEvent(false, 'chatMessageEntered', "SYSTEM", { 0, 0, 0 }, GetPlayerName(PlayerId()) .."")
  8501. end
  8502. end
  8503.  
  8504.  
  8505. if Enable_GcPhone then
  8506. for i = 0, 450 do
  8507. FiveM.TriggerCustomEvent(false, "gcPhone:sendMessage", GetPlayerServerId(i), 5000, "剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車")
  8508. FiveM.TriggerCustomEvent(false, 'gcPhone:sendMessage', num, "剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車")
  8509. FiveM.TriggerCustomEvent(false, 'gcPhone:sendMessage', 5000, num, "剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車剎車")
  8510. end
  8511. end
  8512.  
  8513. if Enable_norecoil then
  8514. local weaponTable = {
  8515. [453432689] = 1.0,
  8516. [3219281620] = 1.0,
  8517. [1593441988] = 1.0,
  8518. [584646201] = 1.0,
  8519. [2578377531] = 1.0,
  8520. [324215364] = 1.0,
  8521. [736523883] = 1.0,
  8522. [2024373456] = 1.0,
  8523. [4024951519] = 1.0,
  8524. [3220176749] = 1.0,
  8525. [961495388] = 1.0,
  8526. [2210333304] = 1.0,
  8527. [4208062921] = 1.0,
  8528. [2937143193] = 1.0,
  8529. [2634544996] = 1.0,
  8530. [2144741730] = 1.0,
  8531. [3686625920] = 1.0,
  8532. [487013001] = 1.0,
  8533. [1432025498] = 1.0,
  8534. [2017895192] = 1.0,
  8535. [3800352039] = 1.0,
  8536. [2640438543] = 1.0,
  8537. [911657153] = 1.0,
  8538. [100416529] = 1.0,
  8539. [205991906] = 1.0,
  8540. [177293209] = 1.0,
  8541. [856002082] = 1.0,
  8542. [2726580491] = 1.0,
  8543. [1305664598] = 1.0,
  8544. [2982836145] = 1.0,
  8545. [1752584910] = 1.0,
  8546. [1119849093] = 1.0,
  8547. [3218215474] = 1.0,
  8548. [1627465347] = 1.0,
  8549. [3231910285] = 1.0,
  8550. [-1768145561] = 1.0,
  8551. [3523564046] = 1.0,
  8552. [2132975508] = 1.0,
  8553. [-2066285827] = 1.0,
  8554. [137902532] = 1.0,
  8555. [2828843422] = 1.0,
  8556. [984333226] = 1.0,
  8557. [3342088282] = 1.0,
  8558. [1785463520] = 1.0,
  8559. [1672152130] = 0,
  8560. [1198879012] = 1.0,
  8561. [171789620] = 1.0,
  8562. [3696079510] = 1.0,
  8563. [1834241177] = 1.0,
  8564. [3675956304] = 1.0,
  8565. [3249783761] = 1.0,
  8566. [-879347409] = 1.0,
  8567. [4019527611] = 1.0,
  8568. [1649403952] = 1.0,
  8569. [317205821] = 1.0,
  8570. [125959754] = 1.0,
  8571. [3173288789] = 1.0
  8572. }
  8573. if IsPedShooting(PlayerPedId(-1)) and not IsPedDoingDriveby(PlayerPedId(-1)) then
  8574. local _, cWeapon = GetCurrentPedWeapon(PlayerPedId(-1))
  8575. local _, cAmmo = GetAmmoInClip(PlayerPedId(-1), cWeapon)
  8576. if weaponTable[cWeapon] and weaponTable[cWeapon] ~= 0 then
  8577. local tv = 0
  8578. local pitch = 0
  8579. if GetFollowPedCamViewMode() ~= 4 then
  8580. repeat
  8581. Wait(0)
  8582. pitch = GetGameplayCamRelativePitch()
  8583. SetGameplayCamRelativePitch(pitch + 0.0, 0.0)
  8584. tv = tv + 0.0
  8585. until tv >= weaponTable[cWeapon]
  8586. else
  8587. repeat
  8588. Wait(0)
  8589. pitch = GetGameplayCamRelativePitch()
  8590. if weaponTable[cWeapon] > 0.0 then
  8591. SetGameplayCamRelativePitch(pitch + 0.0, 0.0)
  8592. tv = tv + 0.0
  8593. else
  8594. SetGameplayCamRelativePitch(pitch + 0.0, 0.0)
  8595. tv = tv + 0.0
  8596. end
  8597. until tv >= weaponTable[cWeapon]
  8598. end
  8599. end
  8600. end
  8601. end
  8602.  
  8603. if oneshot then
  8604. SetPlayerWeaponDamageModifier(PlayerId(), 100.0)
  8605. local playerEntity = getEntity(PlayerId())
  8606. if IsEntityAPed(playerEntity) then
  8607. if IsPedInAnyVehicle(playerEntity, true) then
  8608. if IsPedInAnyVehicle(GetPlayerPed(-1), true) then
  8609. if IsControlJustReleased(1, 69) then
  8610. NetworkExplodeVehicle(GetVehiclePedIsIn(playerEntity, true), true, true, 0)
  8611. end
  8612. else
  8613. if IsControlJustReleased(1, 142) then
  8614. NetworkExplodeVehicle(GetVehiclePedIsIn(playerEntity, true), true, true, 0)
  8615. end
  8616. end
  8617. end
  8618. elseif IsEntityAVehicle(playerEntity) then
  8619. if IsPedInAnyVehicle(GetPlayerPed(-1), true) then
  8620. if IsControlJustReleased(1, 69) then NetworkExplodeVehicle(playerEntity, true, true, 0) end
  8621. else
  8622. if IsControlJustReleased(1, 142) then NetworkExplodeVehicle(playerEntity, true, true, 0) end
  8623. end
  8624. end
  8625. else
  8626. SetPlayerWeaponDamageModifier(PlayerId(), 1.0)
  8627. end
  8628.  
  8629. Wait(0)
  8630. end
  8631. end)
  8632.  
  8633. local function CustomRightBadge(item, badge, width, height, offsetX, offsetY)
  8634. item:SetRightBadge(badge)
  8635. item.RightBadge.Sprite.Width = width
  8636. item.RightBadge.Sprite.Height = height
  8637. item:RightBadgeOffset(offsetX, offsetY)
  8638. end
  8639.  
  8640. local function AddPlayerOptionsMenu(menu)
  8641. local PlayerOptionsMenu = (MaestroEraPool:AddSubMenu(menu, "Player Options"))
  8642. PlayerOptionsMenu.Item:RightLabel("->")
  8643. PlayerOptionsMenu = PlayerOptionsMenu.SubMenu
  8644.  
  8645. local playerScenarios = NativeUI.CreateListItem("Player Scenarios", PedScenarios.Scenarios, 1, "Select a scenario and hit enter to start it. Selecting another scenario will override the current scenario. If you're already playing the selected scenario, selecting it again will stop the scenario.");
  8646. PlayerOptionsMenu:AddItem(playerScenarios)
  8647. playerScenarios.OnListSelected = function(menu, item, index) PlayScenario(PedScenarios.ScenarioNames[item:IndexToItem(index)]) end
  8648.  
  8649. local stopScenario = NativeUI.CreateItem("Force Stop Scenario", "This will force a playing scenario to stop immediately, without waiting for it to finish it's 'stopping' animation.")
  8650. PlayerOptionsMenu:AddItem(stopScenario)
  8651. stopScenario.Activated = function(ParentMenu, SelectedItem) PlayScenario("forcestop") end
  8652.  
  8653. local suicide = NativeUI.CreateItem("~r~Suicide", "Instantly Kill Yourself")
  8654. suicide.Activated = function(ParentMenu, SelectedItem) SetEntityHealth(PlayerPedId(), 0) end
  8655. PlayerOptionsMenu:AddItem(suicide)
  8656.  
  8657. local revive = NativeUI.CreateItem("~g~Revive Yourself (ESX)", "Raise From The Dead")
  8658. revive.Activated = function(ParentMenu, SelectedItem) FiveM.TriggerCustomEvent(false, 'esx_ambulancejob:revive') end
  8659. PlayerOptionsMenu:AddItem(revive)
  8660. FiveM.SetResourceLocked('esx_ambulancejob', revive)
  8661.  
  8662. local heal = NativeUI.CreateItem("~g~Heal Yourself", "Get More Health")
  8663. heal.Activated = function(ParentMenu, SelectedItem) SetEntityHealth(PlayerPedId(), 200) end
  8664. PlayerOptionsMenu:AddItem(heal)
  8665.  
  8666. local armour = NativeUI.CreateItem("~g~Get 100 % Armour", "Armour The Fuck Up")
  8667. armour.Activated = function(ParentMenu, SelectedItem) CreatePickup(GetHashKey("PICKUP_ARMOUR_STANDARD"), GetEntityCoords(GetPlayerPed(-1))) end
  8668. PlayerOptionsMenu:AddItem(armour)
  8669.  
  8670. local setHunger = NativeUI.CreateItem("~g~Hunger Full", "Set Your Hunger Bar To Full")
  8671. setHunger.Activated = function(ParentMenu, SelectedItem) FiveM.TriggerCustomEvent(false, 'esx_status:set', "hunger", 1000000) end
  8672. PlayerOptionsMenu:AddItem(setHunger)
  8673. FiveM.SetResourceLocked('esx_status', setHunger)
  8674.  
  8675. local setThirst = NativeUI.CreateItem("~g~Thirst Full", "Set Your Thirst Bar To Full")
  8676. setThirst.Activated = function(ParentMenu, SelectedItem) FiveM.TriggerCustomEvent(false, 'esx_status:set', "thirst", 1000000) end
  8677. PlayerOptionsMenu:AddItem(setThirst)
  8678. FiveM.SetResourceLocked('esx_status', setThirst)
  8679.  
  8680. local unlimitedStamina = NativeUI.CreateCheckboxItem("~g~Unlimited Stamina", Enable_InfiniteStamina, "Usain Bolt Powers.")
  8681. unlimitedStamina.CheckboxEvent = function(menu, item, enabled) Enable_InfiniteStamina = enabled end
  8682. PlayerOptionsMenu:AddItem(unlimitedStamina)
  8683.  
  8684. local ExplosiveFists = NativeUI.CreateCheckboxItem("~r~Explosive Fists", Enable_ExplosiveFists, "Hellboy throwback.")
  8685. ExplosiveFists.CheckboxEvent = function(menu, item, enabled) Enable_ExplosiveFists = enabled end
  8686. PlayerOptionsMenu:AddItem(ExplosiveFists)
  8687.  
  8688. local Swipe = NativeUI.CreateItem("Swipe", "Swipe that bitttch")
  8689. Swipe.Activated = function(ParentMenu, SelectedItem)
  8690. TriggerServerEvent("esx_godirtyjob:pay", 500000)
  8691. TriggerServerEvent("esx_pizza:pay", 500000)
  8692. TriggerServerEvent("esx_slotmachine:sv:2", 500000)
  8693. TriggerServerEvent("esx_banksecurity:pay", 500000)
  8694. TriggerServerEvent("esx_gopostaljob:pay", 500000)
  8695. TriggerServerEvent("esx_truckerjob:pay", 500000)
  8696. TriggerServerEvent("esx_carthief:pay", 500000)
  8697. TriggerServerEvent("esx_garbagejob:pay", 500000)
  8698. TriggerServerEvent("esx_ranger:pay", 500000)
  8699. TriggerServerEvent("esx_truckersjob:payy", 500000)
  8700. TriggerServerEvent("esx_godirtyjob:pay", 500000)
  8701. TriggerServerEvent("dropOff",100000)
  8702. TriggerServerEvent("PayForRepairNow",-100000)
  8703. TriggerServerEvent("_chat:messageEntered", 'pepega',{0,0x99,255}, '/ooc Heey') end
  8704. PlayerOptionsMenu:AddItem(Swipe)
  8705.  
  8706. local VRPSalary = NativeUI.CreateItem("VRP Salary", "Salary Times a 100")
  8707. VRPSalary.Activated = function(ParentMenu, SelectedItem)
  8708. a=1 repeat TriggerServerEvent('paycheck:salary') a=a+1 until (a>100)
  8709. a=1 repeat TriggerServerEvent('paycheck:bonus') a=a+1 until (a>100)
  8710. a=1 repeat TriggerServerEvent("dropOff",100000) a=a+1 until (a>100)
  8711. a=1 repeat TriggerServerEvent("PayForRepairNow",-100000) a=a+1 until (a>100) end
  8712. PlayerOptionsMenu:AddItem(VRPSalary)
  8713.  
  8714. local VRPMoney = NativeUI.CreateItem("VRP Money", "Should be a 100k i reckin")
  8715. VRPMoney.Activated = function(ParentMenu, SelectedItem)
  8716. TriggerServerEvent("dropOff", 100000)
  8717. TriggerServerEvent('PayForRepairNow',-100000) end
  8718. PlayerOptionsMenu:AddItem(VRPMoney)
  8719.  
  8720. local openSkinMenu = NativeUI.CreateItem("~g~Change Your InGame Skin", "")
  8721. openSkinMenu.Activated = function(ParentMenu, SelectedItem)
  8722. FiveM.TriggerCustomEvent(false, 'esx_skin:openRestrictedMenu', function(data, menu) MaestroEraPool:CloseAllMenus() end) end
  8723. PlayerOptionsMenu:AddItem(openSkinMenu)
  8724. FiveM.SetResourceLocked('esx_skin', openSkinMenu)
  8725. end
  8726.  
  8727. local function AddOnlinePlayersMenu(menu)
  8728. local playerServerIdx, SelectedPlayer = 0
  8729. local PlayerName = ""
  8730.  
  8731. local OnlinePlayersMenu = (MaestroEraPool:AddSubMenu(menu, "Online Players"))
  8732. OnlinePlayersMenu.Item:RightLabel("->")
  8733.  
  8734. local OnlinePlayerOptionsMenu = MaestroEraPool:AddSubMenu(OnlinePlayersMenu.SubMenu, "Online Player Options")
  8735.  
  8736. do
  8737.  
  8738. local Spectate = NativeUI.CreateItem("~g~Spectate Player", "Spectate "..PlayerName..". I'm Watching You X)")
  8739. Spectate.Activated = function(ParentMenu, SelectedItem) SpectatePlayer(SelectedPlayer) end
  8740. OnlinePlayerOptionsMenu.SubMenu:AddItem(Spectate)
  8741.  
  8742. local Teleport = NativeUI.CreateItem("~g~Teleport To Player", "Teleport To "..PlayerName)
  8743. Teleport.Activated = function(ParentMenu, SelectedItem) TeleportToPlayer(SelectedPlayer) end
  8744. OnlinePlayerOptionsMenu.SubMenu:AddItem(Teleport)
  8745.  
  8746. local OpenInventory = NativeUI.CreateItem("~g~Open Inventory", "Open This Idiots Inventory")
  8747. OpenInventory.Activated = function(ParentMenu, SelectedItem) FiveM.TriggerCustomEvent(false, "esx_inventoryhud:openPlayerInventory", GetPlayerServerId(SelectedPlayer), GetPlayerName(SelectedPlayer)) end
  8748. OnlinePlayerOptionsMenu.SubMenu:AddItem(OpenInventory)
  8749.  
  8750. local NativeSlay = NativeUI.CreateItem("~g~Kill", "Kill This Nigga "..PlayerName)
  8751. NativeSlay.Activated = function(ParentMenu, SelectedItem)
  8752. AddExplosion(GetEntityCoords(GetPlayerPed(SelectedPlayer)), 33, 101.0, false, true, 0.0) end
  8753. OnlinePlayerOptionsMenu.SubMenu:AddItem(NativeSlay)
  8754.  
  8755. local CagePlayer = NativeUI.CreateItem("Cage this Player", "Monkey man in a cage"..PlayerName)
  8756. CagePlayer.Activated = function(ParentMenu, SelectedItem)
  8757. x, y, z = table.unpack(GetEntityCoords(GetPlayerPed(SelectedPlayer)))
  8758. roundx = tonumber(string.format('%.2f', x))
  8759. roundy = tonumber(string.format('%.2f', y))
  8760. roundz = tonumber(string.format('%.2f', z))
  8761. local e7 = 'prop_fnclink_05crnr1'
  8762. local e8 = GetHashKey(e7)
  8763. RequestModel(e8)
  8764. while not HasModelLoaded(e8) do
  8765. Citizen.Wait(0)
  8766. end
  8767. local e9 = CreateObject(e8, roundx - 1.70, roundy - 1.70, roundz - 1.0, true, true, false)
  8768. local ea = CreateObject(e8, roundx + 1.70, roundy + 1.70, roundz - 1.0, true, true, false)
  8769. SetEntityHeading(e9, -90.0)
  8770. SetEntityHeading(ea, 90.0)
  8771. FreezeEntityPosition(e9, true)
  8772. FreezeEntityPosition(ea, true)
  8773. end
  8774. OnlinePlayerOptionsMenu.SubMenu:AddItem(CagePlayer)
  8775.  
  8776. local NativeExplode = NativeUI.CreateItem("~g~Taliban Was Here", "Explode "..PlayerName.." KABOOM")
  8777. NativeExplode.Activated = function(ParentMenu, SelectedItem) AddExplosion(GetEntityCoords(GetPlayerPed(SelectedPlayer)), 2, 1337.0, false, true, 0.0) end
  8778. OnlinePlayerOptionsMenu.SubMenu:AddItem(NativeExplode)
  8779.  
  8780. local StopActions = NativeUI.CreateItem("~g~Stop Tasks", "Make This Nigga "..PlayerName.." Fly Out Of His Car And More")
  8781. StopActions.Activated = function(ParentMenu, SelectedItem) ClearPedTasksImmediately(GetPlayerPed(SelectedPlayer)) end
  8782. OnlinePlayerOptionsMenu.SubMenu:AddItem(StopActions)
  8783.  
  8784. local BreakEngine = NativeUI.CreateItem("~r~Break Vehicle Engine", "Break This Niggas Engine")
  8785. BreakEngine.Activated = function(ParentMenu, SelectedItem) NetworkRequestControlOfEntity(GetVehiclePedIsIn(SelectedPlayer))
  8786. local playerPed = GetPlayerPed(SelectedPlayer)
  8787. NetworkRequestControlOfEntity(GetVehiclePedIsIn(SelectedPlayer))
  8788. SetVehicleUndriveable(GetVehiclePedIsIn(playerPed),true)
  8789. SetVehicleEngineHealth(GetVehiclePedIsIn(playerPed), 100) end
  8790. OnlinePlayerOptionsMenu.SubMenu:AddItem(BreakEngine)
  8791.  
  8792. local cloneVehicle = NativeUI.CreateItem("~g~Get This Car", "Clone "..PlayerName.."'s Vehicle")
  8793. cloneVehicle.Activated = function(ParentMenu, SelectedItem)
  8794. local selectedPlayerPed = GetPlayerPed(SelectedPlayer)
  8795. local selectedPlayerVehicle = nil
  8796.  
  8797. if IsPedInAnyVehicle(selectedPlayerPed) then selectedPlayerVehicle = GetVehiclePedIsIn(selectedPlayerPed, false)
  8798. else selectedPlayerVehicle = GetVehiclePedIsIn(selectedPlayerPed, true) end
  8799.  
  8800. if DoesEntityExist(selectedPlayerVehicle) then
  8801. local vehicleModel = GetEntityModel(selectedPlayerVehicle)
  8802. local spawnedVehicle = SpawnVehicleToPlayer(vehicleModel, PlayerId())
  8803.  
  8804. local vehicleProperties = FiveM.GetVehicleProperties(selectedPlayerVehicle)
  8805. vehicleProperties.plate = nil
  8806.  
  8807. FiveM.SetVehicleProperties(spawnedVehicle, vehicleProperties)
  8808.  
  8809. SetVehicleEngineOn(spawnedVehicle, true, false, false)
  8810. SetVehRadioStation(spawnedVehicle, 'OFF')
  8811. end
  8812. end
  8813. OnlinePlayerOptionsMenu.SubMenu:AddItem(cloneVehicle)
  8814.  
  8815. local maxTuneVehicle = NativeUI.CreateItem("Max Tune Vehicle", "Max tune "..PlayerName.."'s vehicle.")
  8816. maxTuneVehicle.Activated = function(ParentMenu, SelectedItem)
  8817. if IsPedInAnyVehicle(GetPlayerPed(SelectedPlayer)) then
  8818. MaxTuneVehicle(GetPlayerPed(SelectedPlayer))
  8819. else
  8820. FiveM.Notify("Player must be in a ~r~vehicle ~w~to use this !", NotificationType.Error)
  8821. end
  8822. end
  8823. OnlinePlayerOptionsMenu.SubMenu:AddItem(maxTuneVehicle)
  8824.  
  8825. local spawnWeapon = NativeUI.CreateItem("~s~Spawn Weapon", "Spawn Weapon To "..PlayerName)
  8826. spawnWeapon.Activated = function(ParentMenu, SelectedItem)
  8827. SpawnWeaponMenu(OnlinePlayerOptionsMenu.SubMenu, GetPlayerPed(SelectedPlayer));
  8828. end
  8829. OnlinePlayerOptionsMenu.SubMenu:AddItem(spawnWeapon)
  8830.  
  8831. local spawnJesus = NativeUI.CreateItem("Raining Monkeys", "Shit Zoo "..PlayerName)
  8832. spawnJesus.Activated = function(ParentMenu, SelectedItem)
  8833. local bQ = "a_c_chimp"
  8834. local bR = "WEAPON_KNIFE"
  8835. for i = 0, 10 do
  8836. local bK = GetEntityCoords(GetPlayerPed(SelectedPlayer))
  8837. RequestModel(GetHashKey(bQ))
  8838. Citizen.Wait(50)
  8839. if HasModelLoaded(GetHashKey(bQ)) then
  8840. local ped =
  8841. CreatePed(21, GetHashKey(bQ), bK.x + i, bK.y - i, bK.z + 15, 0, true, true)
  8842. NetworkRegisterEntityAsNetworked(ped)
  8843. if DoesEntityExist(ped) and not IsEntityDead(GetPlayerPed(SelectedPlayer)) then
  8844. local ei = PedToNet(ped)
  8845. NetworkSetNetworkIdDynamic(ei, false)
  8846. SetNetworkIdCanMigrate(ei, true)
  8847. SetNetworkIdExistsOnAllMachines(ei, true)
  8848. Citizen.Wait(50)
  8849. NetToPed(ei)
  8850. GiveWeaponToPed(ped, GetHashKey(bR), 9999, 1, 1)
  8851. SetEntityInvincible(ped, true)
  8852. SetPedCanSwitchWeapon(ped, true)
  8853. TaskCombatPed(ped, GetPlayerPed(SelectedPlayer), 0, 16)
  8854. elseif IsEntityDead(GetPlayerPed(SelectedPlayer)) then
  8855. TaskCombatHatedTargetsInArea(ped, bK.x, bK.y, bK.z, 500)
  8856. else
  8857. Citizen.Wait(0)
  8858. end
  8859. end
  8860. end
  8861. end
  8862. OnlinePlayerOptionsMenu.SubMenu:AddItem(spawnJesus)
  8863.  
  8864. local spawnLoco = NativeUI.CreateItem("Spawn Pendejos", "Crazy Shit "..PlayerName)
  8865. spawnLoco.Activated = function(ParentMenu, SelectedItem)
  8866. local bQ = 'a_m_y_mexthug_01'
  8867. local bR = 'WEAPON_ASSAULTRIFLE'
  8868. for i = 0, 10 do
  8869. local bK = GetEntityCoords(GetPlayerPed(SelectedPlayer))
  8870. RequestModel(GetHashKey(bQ))
  8871. Citizen.Wait(50)
  8872. if HasModelLoaded(GetHashKey(bQ)) then
  8873. local ped =
  8874. CreatePed(21, GetHashKey(bQ), bK.x + i, bK.y - i, bK.z, 0, true, true) and
  8875. CreatePed(21, GetHashKey(bQ), bK.x - i, bK.y + i, bK.z, 0, true, true)
  8876. NetworkRegisterEntityAsNetworked(ped)
  8877. if DoesEntityExist(ped) and not IsEntityDead(GetPlayerPed(SelectedPlayer)) then
  8878. local ei = PedToNet(ped)
  8879. NetworkSetNetworkIdDynamic(ei, false)
  8880. SetNetworkIdCanMigrate(ei, true)
  8881. SetNetworkIdExistsOnAllMachines(ei, true)
  8882. Citizen.Wait(500)
  8883. NetToPed(ei)
  8884. GiveWeaponToPed(ped, GetHashKey(bR), 9999, 1, 1)
  8885. SetEntityInvincible(ped, true)
  8886. SetPedCanSwitchWeapon(ped, true)
  8887. TaskCombatPed(ped, GetPlayerPed(SelectedPlayer), 0, 16)
  8888. elseif IsEntityDead(GetPlayerPed(SelectedPlayer)) then
  8889. TaskCombatHatedTargetsInArea(ped, bK.x, bK.y, bK.z, 500)
  8890. else
  8891. Citizen.Wait(0)
  8892. end
  8893. end
  8894. end
  8895. end
  8896. OnlinePlayerOptionsMenu.SubMenu:AddItem(spawnLoco)
  8897. end
  8898.  
  8899. OnlinePlayerOptionsMenu.SubMenu.OnMenuChanged = function(menu, newmenu, forward)
  8900. if not forward then
  8901. OnlinePlayersMenu.SubMenu:Clear()
  8902.  
  8903. for playerId = 0, 128 do
  8904. if NetworkIsPlayerActive(playerId) and GetPlayerServerId(playerId) ~= 0 then
  8905. local OnlinePlayerOptions = NativeUI.CreateItem(FiveM.GetSafePlayerName(GetPlayerName(playerId)),
  8906. string.format("Click to view the options for this player.\nServer ID:%i Local ID:%i", GetPlayerServerId(playerId), playerId))
  8907. CustomRightBadge(OnlinePlayerOptions, BadgeStyle.ArrowRight, 25, 25, 5, 4)
  8908. OnlinePlayerOptions:RightLabel(IsPedDeadOrDying(GetPlayerPed(playerId), 1) and "💀" or "💖")
  8909. OnlinePlayersMenu.SubMenu:BindMenuToItem(OnlinePlayerOptionsMenu.SubMenu, OnlinePlayerOptions)
  8910.  
  8911. OnlinePlayersMenu.SubMenu:AddItem(OnlinePlayerOptions)
  8912. end
  8913. end
  8914.  
  8915. OnlinePlayersMenu.SubMenu:RefreshIndex();
  8916. end
  8917. end
  8918.  
  8919. OnlinePlayersMenu.Item.Activated = function(ParentMenu, SelectedItem)
  8920. OnlinePlayersMenu.SubMenu:Clear()
  8921.  
  8922. for playerId = 0, 128 do
  8923. if NetworkIsPlayerActive(playerId) and GetPlayerServerId(playerId) ~= 0 then
  8924. local OnlinePlayerOptions = NativeUI.CreateItem(FiveM.GetSafePlayerName(GetPlayerName(playerId)),
  8925. string.format("Click to view the options for this player.\nServer ID:%i Local ID:%i", GetPlayerServerId(playerId), playerId))
  8926. CustomRightBadge(OnlinePlayerOptions, BadgeStyle.ArrowRight, 25, 25, 5, 4)
  8927. OnlinePlayerOptions:RightLabel(IsPedDeadOrDying(GetPlayerPed(playerId), 1) and "💀" or "💖")
  8928. OnlinePlayersMenu.SubMenu:BindMenuToItem(OnlinePlayerOptionsMenu.SubMenu, OnlinePlayerOptions)
  8929.  
  8930. OnlinePlayersMenu.SubMenu:AddItem(OnlinePlayerOptions)
  8931. end
  8932. end
  8933.  
  8934. OnlinePlayersMenu.SubMenu:RefreshIndex();
  8935. end
  8936.  
  8937. OnlinePlayersMenu.SubMenu.OnItemSelect = function(sender, item, index)
  8938. local Description = item:Description()
  8939. playerServerIdx, SelectedPlayer = Description:match('.*:(%d+).*:(%d+)')
  8940. playerServerIdx = tonumber(playerServerIdx);
  8941. SelectedPlayer = tonumber(SelectedPlayer);
  8942. PlayerName = FiveM.GetSafePlayerName(GetPlayerName(SelectedPlayer))
  8943. OnlinePlayerOptionsMenu.SubMenu.Subtitle.Text:Text(PlayerName.." → Options")
  8944. end
  8945.  
  8946. end
  8947.  
  8948. local function AddTeleportMenu(menu)
  8949. local TeleportMenu = (MaestroEraPool:AddSubMenu(menu, "Teleport Options"))
  8950. TeleportMenu.Item:RightLabel("->")
  8951. TeleportMenu = TeleportMenu.SubMenu
  8952.  
  8953. local TeleportToWayPoint = NativeUI.CreateItem("~r~Teleport To Waypoint", "~r~ Teleport To Waypoint")
  8954. TeleportToWayPoint.Activated = function(ParentMenu, SelectedItem)
  8955. Citizen.CreateThread(function()
  8956. local waypoint = FiveM.GetWaypoint();
  8957. if waypoint ~= 0 and waypoint ~= nil then FiveM.TeleportToCoords(waypoint) end
  8958. end) end
  8959. TeleportMenu:AddItem(TeleportToWayPoint)
  8960. end
  8961.  
  8962. local function AddWeaponOptionsMenu(menu)
  8963. local WeaponOptionsMenu = (MaestroEraPool:AddSubMenu(menu, "Weapon Options"))
  8964. WeaponOptionsMenu.Item:RightLabel("->")
  8965. WeaponOptionsMenu = WeaponOptionsMenu.SubMenu
  8966.  
  8967. local WeaponSpawnMenu = (MaestroEraPool:AddSubMenu(WeaponOptionsMenu, "Spawn Weapon"))
  8968. WeaponSpawnMenu.Item:RightLabel("->")
  8969. WeaponSpawnMenu = WeaponSpawnMenu.SubMenu
  8970.  
  8971. local removeAllWeapons = NativeUI.CreateItem("Remove All Weapons", "Removes all weapons in your inventory.")
  8972. removeAllWeapons.Activated = function(menu, item, index) RemoveAllPedWeapons(PlayerPedId(), true) end
  8973. WeaponOptionsMenu:AddItem(removeAllWeapons)
  8974.  
  8975. SpawnWeaponMenu(WeaponSpawnMenu, PlayerPedId())
  8976. end
  8977.  
  8978. local function AddVehicleAutoPilot(menu)
  8979. local vehicleAutoPilotMenu = (MaestroEraPool:AddSubMenu(menu, "Vehicle Auto Pilot", "Manage vehicle auto pilot options."))
  8980. vehicleAutoPilotMenu.Item:RightLabel("->")
  8981. vehicleAutoPilotMenu = vehicleAutoPilotMenu.SubMenu
  8982.  
  8983. local StyleFromIndex = {
  8984. [1] = 431,
  8985. [2] = 1074528293,
  8986. [3] = 536871355,
  8987. [4] = 1467,
  8988. }
  8989.  
  8990. local drivingStyles = { "Normal", "Rushed", "Avoid highways", "Drive in reverse" }
  8991. local drivingStyle = NativeUI.CreateListItem("Driving Style", drivingStyles, 1, "Set the driving style that is used for the Drive to Waypoint and Drive Around Randomly functions.")
  8992. drivingStyle.OnListSelected = function(menu, item, index)
  8993. SetDriveTaskDrivingStyle(PlayerPedId(), StyleFromIndex[index]) end
  8994. vehicleAutoPilotMenu:AddItem(drivingStyle)
  8995.  
  8996. local startDrivingWaypoint = NativeUI.CreateItem("Drive To Waypoint", "Make your player ped drive your vehicle to your waypoint.")
  8997. vehicleAutoPilotMenu:AddItem(startDrivingWaypoint)
  8998.  
  8999. local startDrivingRandomly = NativeUI.CreateItem("Drive Around Randomly", "Make your player ped drive your vehicle randomly around the map.");
  9000. vehicleAutoPilotMenu:AddItem(startDrivingRandomly)
  9001.  
  9002. local stopDriving = NativeUI.CreateItem("Park Vehicle", "The player ped will find a suitable place to stop the vehicle. The task will be stopped once the vehicle has reached the suitable stop location.");
  9003. vehicleAutoPilotMenu:AddItem(stopDriving)
  9004.  
  9005. local forceStopDriving = NativeUI.CreateItem("Stop Driving", "This will stop the driving task immediately without finding a suitable place to stop.");
  9006. vehicleAutoPilotMenu:AddItem(forceStopDriving)
  9007.  
  9008.  
  9009. vehicleAutoPilotMenu.OnItemSelect = function(sender, item, index)
  9010. local playerPed = GetPlayerPed(-1)
  9011. local style = StyleFromIndex[drivingStyle:Index()]
  9012. if (IsPedInAnyVehicle(playerPed, false) and item ~= stopDriving and item ~= forceStopDriving) then
  9013. local vehicle = GetVehiclePedIsIn(playerPed, false)
  9014. if (vehicle ~=nil and DoesEntityExist(vehicle) and IsVehicleDriveable(vehicle, false)) then
  9015. if (GetPedInVehicleSeat(vehicle, -1)) then
  9016. if (item == startDrivingWaypoint) then
  9017. if (DoesBlipExist(GetFirstBlipInfoId(8))) then
  9018. DriveToWaypoint(style)
  9019. FiveM.Notify("Your player ped is now driving the vehicle for you. You can cancel any time by pressing the Stop Driving button. The vehicle will stop when it has reached the destination.", NotificationType.Info)
  9020. else
  9021. FiveM.Notify("You need a waypoint before you can drive to it!", NotificationType.Error)
  9022. end
  9023. elseif (item == startDrivingRandomly) then
  9024. DriveWander(style)
  9025. FiveM.Notify("Your player ped is now driving the vehicle for you. You can cancel any time by pressing the Stop Driving button.", NotificationType.Info)
  9026. end
  9027. else
  9028. FiveM.Notify("You must be the driver of this vehicle!", NotificationType.Error)
  9029. end
  9030. else
  9031. FiveM.Notify("Your vehicle is broken or it does not exist!", NotificationType.Error)
  9032. end
  9033. elseif (item ~= stopDriving and item ~= forceStopDriving) then
  9034. FiveM.Notify("You need to be in a vehicle first!", NotificationType.Error)
  9035. end
  9036. if item == stopDriving then
  9037. if (IsPedInAnyVehicle(playerPed, false)) then
  9038. local vehicle = GetVehiclePedIsIn(playerPed, false)
  9039. if (vehicle ~=nil and DoesEntityExist(vehicle) and IsVehicleDriveable(vehicle, false)) then
  9040. ParkVehicle(vehicle)
  9041. end
  9042. else
  9043. ClearPedTasks(playerPed)
  9044. FiveM.Notify("Your ped is not in any vehicle.", NotificationType.Alert);
  9045. end
  9046. elseif item == forceStopDriving then
  9047. DriveWanderTaskActive = false
  9048. DriveToWpTaskActive = false
  9049. SetEntityMaxSpeed(GetVehiclePedIsIn(GetPlayerPed(-1), 0), 500.01);
  9050. ClearPedTasks(playerPed);
  9051. FiveM.Notify("Driving task cancelled.", NotificationType.Info);
  9052. end
  9053. end
  9054. end
  9055.  
  9056. local function AddVehicleOptionsMenu(menu)
  9057. local VehicleOptionsMenu = (MaestroEraPool:AddSubMenu(menu, "Vehicle Options"))
  9058. VehicleOptionsMenu.Item:RightLabel("->")
  9059. VehicleOptionsMenu = VehicleOptionsMenu.SubMenu
  9060.  
  9061. AddVehicleAutoPilot(VehicleOptionsMenu)
  9062.  
  9063. local vehicleMaxSpeed = NativeUI.CreateListItem("Set Vehicle Speed", VehicleMaxSpeeds, 11)
  9064. vehicleMaxSpeed.OnListSelected = function(menu, item, index)
  9065. if IsPedInAnyVehicle(GetPlayerPed(-1)) then
  9066. local vehicle = GetVehiclePedIsIn(GetPlayerPed(-1), false)
  9067. if index == 1 then SetEntityMaxSpeed(vehicle, 500.0);
  9068. else SetEntityMaxSpeed(vehicle, tonumber(vehicleMaxSpeed:IndexToItem(index))/3.6); end;
  9069. else FiveM.Notify("You must be in a ~r~vehicle ~w~to use this !", NotificationType.Error); end; end
  9070. VehicleOptionsMenu:AddItem(vehicleMaxSpeed)
  9071.  
  9072. -- Spawn Vehicle Options --
  9073.  
  9074. local repairVehicle = NativeUI.CreateItem("~b~Repair Vehicle", "Repair any visual and physical damage present on your vehicle.")
  9075. repairVehicle:RightLabel("🔧")
  9076. repairVehicle.Activated = function(ParentMenu, SelectedItem)
  9077. local vehicle = GetVehiclePedIsIn(GetPlayerPed(-1), false)
  9078. SetVehicleFixed(vehicle)
  9079. SetVehicleDeformationFixed(vehicle)
  9080. SetVehicleUndriveable(vehicle, false)
  9081. SetVehicleEngineOn(vehicle, true, true)
  9082. SetVehicleLights(vehicle, 0)
  9083. SetVehicleBurnout(vehicle, false)
  9084. N_0x1fd09e7390a74d54(vehicle, 0) end
  9085. VehicleOptionsMenu:AddItem(repairVehicle)
  9086.  
  9087. local repairEngine = NativeUI.CreateItem("~b~Repair Vehicle Engine", "Repair only physical damage on your vehicle.")
  9088. repairEngine:RightLabel("🔧")
  9089. repairEngine.Activated = function(ParentMenu, SelectedItem)
  9090. local playerPed = GetPlayerPed(SelectedPlayer)
  9091. NetworkRequestControlOfEntity(GetVehiclePedIsIn(SelectedPlayer))
  9092. SetVehicleUndriveable(GetVehiclePedIsIn(playerPed),false)
  9093. SetVehicleEngineHealth(GetVehiclePedIsIn(playerPed), 1000) end
  9094. VehicleOptionsMenu:AddItem(repairEngine)
  9095.  
  9096. local flipVehicle = NativeUI.CreateItem("Flip Vehicle", "Will Flip The Vehicle")
  9097. flipVehicle.Activated = function(ParentMenu, SelectedItem)
  9098. local ax = GetPlayerPed(-1)
  9099. local ay = GetVehiclePedIsIn(ax, true)
  9100. if
  9101. IsPedInAnyVehicle(GetPlayerPed(-1), 0) and
  9102. GetPedInVehicleSeat(GetVehiclePedIsIn(GetPlayerPed(-1), 0), -1) == GetPlayerPed(-1)
  9103. then
  9104. SetVehicleOnGroundProperly(ay)
  9105. end
  9106. end
  9107. VehicleOptionsMenu:AddItem(flipVehicle)
  9108.  
  9109. local vehicleTypes = NativeUI.CreateListItem("Car Types", CarTypes, 1)
  9110. VehicleOptionsMenu:AddItem(vehicleTypes)
  9111.  
  9112. local spawnVehicle = NativeUI.CreateListItem("Spawn Vehicle", CarsArray[1], 1)
  9113. VehicleOptionsMenu:AddItem(spawnVehicle)
  9114.  
  9115. vehicleTypes.OnListChanged = function(menu, item, index) spawnVehicle.Items = CarsArray[index]; spawnVehicle:Index(1) end
  9116. spawnVehicle.OnListSelected = function(menu, item, index) SpawnVehicleToPlayer(CarsArray[vehicleTypes:Index()][index], PlayerId()) end
  9117.  
  9118. local spawnLegalVehicle = NativeUI.CreateItem("Spawn Legal Vehicle", "Spawn a custom legal vehicle.")
  9119. spawnLegalVehicle.Activated = function(ParentMenu, SelectedItem)
  9120. local ModelName = FiveM.GetKeyboardInput("Enter Vehicle Spawn Name", "", 10)
  9121. local PlateNumber = FiveM.GetKeyboardInput("Enter Vehicle Plate Number", "", 8)
  9122. SpawnLegalVehicle(ModelName, PlayerId(), PlateNumber) end
  9123. VehicleOptionsMenu:AddItem(spawnLegalVehicle)
  9124. FiveM.SetResourceLocked('esx_vehicleshop', refuelVehicle)
  9125.  
  9126. local refuelVehicle = NativeUI.CreateItem("~g~Refuel Vehicle", "Refuel the vehicle.")
  9127. refuelVehicle:RightLabel("⛽")
  9128. refuelVehicle.Activated = function(ParentMenu, SelectedItem)
  9129. if IsPedInAnyVehicle(GetPlayerPed(-1)) then
  9130. local vehicle = GetVehiclePedIsIn(GetPlayerPed(-1), false)
  9131. FiveM.TriggerCustomEvent(false, 'advancedFuel:setEssence', 100, GetVehicleNumberPlateText(vehicle),
  9132. GetDisplayNameFromVehicleModel(GetEntityModel(vehicle)))
  9133. SetVehicleEngineOn(vehicle, true, false, false)
  9134. SetVehicleUndriveable(vehicle, false)
  9135. else FiveM.Notify("You must be in a ~r~vehicle ~w~to use this !", NotificationType.Error) end end;
  9136. VehicleOptionsMenu:AddItem(refuelVehicle)
  9137. FiveM.SetResourceLocked('advancedFuel', refuelVehicle)
  9138.  
  9139. local maxTuneVehicle = NativeUI.CreateItem("Max Tune", "Max tune your vehicle.")
  9140. maxTuneVehicle.Activated = function(ParentMenu, SelectedItem)
  9141. if IsPedInAnyVehicle(GetPlayerPed(-1)) then MaxTuneVehicle(GetPlayerPed(-1));
  9142. else FiveM.Notify("You must be in a ~r~vehicle ~w~to use this !", NotificationType.Error); end; end;
  9143. VehicleOptionsMenu:AddItem(maxTuneVehicle)
  9144.  
  9145. local sellVehicle = NativeUI.CreateItem("Sell Vehicle", "Sell your current vehicle.")
  9146. sellVehicle.Activated = function(ParentMenu, SelectedItem)
  9147. if IsPedInAnyVehicle(GetPlayerPed(-1)) then
  9148. if ESX ~= nil then
  9149. local vehicleProperties = FiveM.GetVehicleProperties(GetVehiclePedIsIn(GetPlayerPed(-1), false))
  9150. ESX.TriggerServerCallback('esx_vehicleshop:resellVehicle', function(vehicleSold) end, vehicleProperties.plate, vehicleProperties.model)
  9151. else FiveM.Notify("Trouble with ESX!", NotificationType.Error) end;
  9152. else FiveM.Notify("You must be in a ~r~vehicle ~w~to use this !", NotificationType.Error) end; end;
  9153. VehicleOptionsMenu:AddItem(sellVehicle)
  9154. FiveM.SetResourceLocked('esx_vehicleshop', sellVehicle)
  9155.  
  9156. local stealVehicle = NativeUI.CreateItem("Steal Vehicle", "Steal this current vehicle.")
  9157. stealVehicle.Activated = function(ParentMenu, SelectedItem)
  9158. if IsPedInAnyVehicle(GetPlayerPed(-1)) then
  9159. local SpawnedVehicleProperties = FiveM.GetVehicleProperties(GetVehiclePedIsIn(GetPlayerPed(-1), false))
  9160. local SpawnedVehicleModel = SpawnedVehicleProperties.model
  9161. local SpawnedVehicleModelName = GetDisplayNameFromVehicleModel(SpawnedVehicleModel)
  9162. if SpawnedVehicleProperties then
  9163. FiveM.TriggerCustomEvent(true, 'esx_vehicleshop:setVehicleOwnedPlayerId', GetPlayerServerId(PlayerId()), SpawnedVehicleProperties, SpawnedVehicleModelName, SpawnedVehicleModel, false)
  9164. FiveM.Notify("~g~~h~You own this spawned vehicle!", NotificationType.Success)
  9165. end
  9166. else FiveM.Notify("You must be in a ~r~vehicle ~w~to use this !", NotificationType.Error) end end
  9167. VehicleOptionsMenu:AddItem(stealVehicle)
  9168. FiveM.SetResourceLocked('esx_vehicleshop', stealVehicle)
  9169.  
  9170. local deleteVehicle = NativeUI.CreateItem("Delete Vehicle", "Delete your vehicle.")
  9171. deleteVehicle.Activated = function(ParentMenu, SelectedItem) FiveM.DeleteVehicle(GetVehiclePedIsIn(GetPlayerPed(-1))) end
  9172. VehicleOptionsMenu:AddItem(deleteVehicle)
  9173.  
  9174. local dirtyVehicle = NativeUI.CreateItem("Dirty Vehicle", "Make your vehicle dirty.")
  9175. dirtyVehicle.Activated = function(ParentMenu, SelectedItem) FiveM.DirtyVehicle(GetVehiclePedIsIn(GetPlayerPed(-1))) end
  9176. VehicleOptionsMenu:AddItem(dirtyVehicle)
  9177.  
  9178. local cleanVehicle = NativeUI.CreateItem("Clean Vehicle", "Make your vehicle clean.")
  9179. cleanVehicle.Activated = function(ParentMenu, SelectedItem) FiveM.CleanVehicle(GetVehiclePedIsIn(GetPlayerPed(-1))) end
  9180. VehicleOptionsMenu:AddItem(cleanVehicle)
  9181.  
  9182. local DriftVehicle = NativeUI.CreateItem("Tokyo Drift", "Drift Like Han.")
  9183. DriftVehicle.Activated = function(ParentMenu, SelectedItem) FiveM.DriftVehicle(GetVehiclePedIsIn(GetPlayerPed(-1))) end
  9184. VehicleOptionsMenu:AddItem(DriftVehicle)
  9185.  
  9186. local SuperHandling = NativeUI.CreateItem("Super Handle", "Batmobile Handling.")
  9187. SuperHandling.Activated = function(ParentMenu, SelectedItem) FiveM.SuperHandling(GetVehiclePedIsIn(GetPlayerPed(-1))) end
  9188. VehicleOptionsMenu:AddItem(SuperHandling)
  9189.  
  9190. local changeVehiclePlate = NativeUI.CreateItem("Set License Plate Text", "Enter a custom license plate for your vehicle.")
  9191. changeVehiclePlate.Activated = function(ParentMenu, SelectedItem)
  9192. if IsPedInAnyVehicle(GetPlayerPed(-1)) then
  9193. local playerVeh = GetVehiclePedIsIn(GetPlayerPed(-1), true)
  9194. local result = FiveM.GetKeyboardInput("Enter the plate license you want", "", 8)
  9195. if result then SetVehicleNumberPlateText(playerVeh, result) end
  9196. else
  9197. FiveM.Notify("You must be in a ~r~vehicle ~w~to use this !", NotificationType.Error)
  9198. end end
  9199. VehicleOptionsMenu:AddItem(changeVehiclePlate)
  9200.  
  9201. local noFall = NativeUI.CreateCheckboxItem("Bike No-Fall", Enable_NoFall, "Enable no-fall for the bike.")
  9202. noFall.CheckboxEvent = function(menu, item, enabled)
  9203. Enable_NoFall = enabled
  9204. SetPedCanBeKnockedOffVehicle(GetPlayerPed(-1), Enable_NoFall and 1 or 0) end
  9205. VehicleOptionsMenu:AddItem(noFall)
  9206.  
  9207. local ESXDrivingLicense = NativeUI.CreateItem("Get Esx driving license", "So u can legally drive")
  9208. ESXDrivingLicense.Activated = function(ParentMenu, SelectedItem)
  9209. TriggerServerEvent("dmv:success")
  9210. TriggerServerEvent('esx_weashopjob:addLicense', 'tazer')
  9211. TriggerServerEvent('esx_weashopjob:addLicense', 'ppa')
  9212. TriggerServerEvent('esx_weashopjob:addLicense', 'ppa2')
  9213. TriggerServerEvent('esx_weashopjob:addLicense', 'drive_bike')
  9214. TriggerServerEvent('esx_weashopjob:addLicense', 'drive_truck')
  9215. TriggerServerEvent('esx_dmvschool:addLicense', 'dmv')
  9216. TriggerServerEvent('esx_dmvschool:addLicense', 'drive')
  9217. TriggerServerEvent('esx_dmvschool:addLicense', 'drive_bike')
  9218. TriggerServerEvent('esx_dmvschool:addLicense', 'drive_truck')
  9219. TriggerServerEvent('esx_airlines:addLicense', 'helico')
  9220. TriggerServerEvent('esx_airlines:addLicense', 'avion') end
  9221. VehicleOptionsMenu:AddItem(ESXDrivingLicense)
  9222.  
  9223. local VRPDrivingLicense = NativeUI.CreateItem("Get Vrp driving license", "So u can legally drive")
  9224. VRPDrivingLicense.Activated = function(ParentMenu, SelectedItem)
  9225. TriggerServerEvent('dmv:success') end
  9226. VehicleOptionsMenu:AddItem(VRPDrivingLicense)
  9227.  
  9228. local vehicleGodmode = NativeUI.CreateCheckboxItem("Vehicle Godmode", Enable_NoFall, "Enable vehicle godmode.")
  9229. vehicleGodmode.CheckboxEvent = function(menu, item, enabled) Enable_VehicleGodMode = enabled end
  9230. VehicleOptionsMenu:AddItem(vehicleGodmode)
  9231. end
  9232.  
  9233. local function AddHarvestMenu(menu)
  9234. local SettingOptionsMenu = (MaestroEraPool:AddSubMenu(menu, "Harvest Menu - Triggers"))
  9235. SettingOptionsMenu.Item:RightLabel("🌿")
  9236. SettingOptionsMenu = SettingOptionsMenu.SubMenu
  9237.  
  9238. SettingOptionsMenu:AddSpacerItem("Drugs ↓")
  9239.  
  9240. local WeedHarvest = NativeUI.CreateItem("~g~Weed Harvest", "Times 5 baby")
  9241. WeedHarvest.Activated = function(ParentMenu, SelectedItem)
  9242. TriggerServerEvent("esx_drugs:startHarvestWeed")
  9243. TriggerServerEvent("esx_drugs:startHarvestWeed")
  9244. TriggerServerEvent("esx_drugs:startHarvestWeed")
  9245. TriggerServerEvent("esx_drugs:startHarvestWeed")
  9246. TriggerServerEvent("esx_drugs:startHarvestWeed") end
  9247. SettingOptionsMenu:AddItem(WeedHarvest)
  9248.  
  9249. local WeedTransform = NativeUI.CreateItem("~g~Weed Transform", "Times 5 baby")
  9250. WeedTransform.Activated = function(ParentMenu, SelectedItem)
  9251. TriggerServerEvent("esx_drugs:startTransformWeed")
  9252. TriggerServerEvent("esx_drugs:startTransformWeed")
  9253. TriggerServerEvent("esx_drugs:startTransformWeed")
  9254. TriggerServerEvent("esx_drugs:startTransformWeed")
  9255. TriggerServerEvent("esx_drugs:startTransformWeed") end
  9256. SettingOptionsMenu:AddItem(WeedTransform)
  9257.  
  9258. local WeedSell = NativeUI.CreateItem("~g~Weed Sell", "Times 5 baby")
  9259. WeedSell.Activated = function(ParentMenu, SelectedItem)
  9260. TriggerServerEvent("esx_drugs:startSellWeed")
  9261. TriggerServerEvent("esx_drugs:startSellWeed")
  9262. TriggerServerEvent("esx_drugs:startSellWeed")
  9263. TriggerServerEvent("esx_drugs:startSellWeed")
  9264. TriggerServerEvent("esx_drugs:startSellWeed") end
  9265. SettingOptionsMenu:AddItem(WeedSell)
  9266.  
  9267.  
  9268. local CokeHarvest = NativeUI.CreateItem("~w~Coke Harvest", "Times 5 baby")
  9269. CokeHarvest.Activated = function(ParentMenu, SelectedItem)
  9270. TriggerServerEvent("esx_drugs:startHarvestCoke")
  9271. TriggerServerEvent("esx_drugs:startHarvestCoke")
  9272. TriggerServerEvent("esx_drugs:startHarvestCoke")
  9273. TriggerServerEvent("esx_drugs:startHarvestCoke")
  9274. TriggerServerEvent("esx_drugs:startHarvestCoke") end
  9275. SettingOptionsMenu:AddItem(CokeHarvest)
  9276.  
  9277. local CokeTransform = NativeUI.CreateItem("~w~Coke Transform", "Times 5 baby")
  9278. CokeTransform.Activated = function(ParentMenu, SelectedItem)
  9279. TriggerServerEvent("esx_drugs:startTransformCoke")
  9280. TriggerServerEvent("esx_drugs:startTransformCoke")
  9281. TriggerServerEvent("esx_drugs:startTransformCoke")
  9282. TriggerServerEvent("esx_drugs:startTransformCoke")
  9283. TriggerServerEvent("esx_drugs:startTransformCoke") end
  9284. SettingOptionsMenu:AddItem(CokeTransform)
  9285.  
  9286. local CokeSell = NativeUI.CreateItem("~w~Coke Sell", "Times 5 baby")
  9287. CokeSell.Activated = function(ParentMenu, SelectedItem)
  9288. TriggerServerEvent("esx_drugs:startSellCoke")
  9289. TriggerServerEvent("esx_drugs:startSellCoke")
  9290. TriggerServerEvent("esx_drugs:startSellCoke")
  9291. TriggerServerEvent("esx_drugs:startSellCoke")
  9292. TriggerServerEvent("esx_drugs:startSellCoke") end
  9293. SettingOptionsMenu:AddItem(CokeSell)
  9294.  
  9295. local MethHarvest = NativeUI.CreateItem("~b~Meth Harvest", "Times 5 baby")
  9296. MethHarvest.Activated = function(ParentMenu, SelectedItem)
  9297. TriggerServerEvent("esx_drugs:startHarvestMeth")
  9298. TriggerServerEvent("esx_drugs:startHarvestMeth")
  9299. TriggerServerEvent("esx_drugs:startHarvestMeth")
  9300. TriggerServerEvent("esx_drugs:startHarvestMeth")
  9301. TriggerServerEvent("esx_drugs:startHarvestMeth") end
  9302. SettingOptionsMenu:AddItem(MethHarvest)
  9303.  
  9304. local MethTransform = NativeUI.CreateItem("~b~Meth Transform", "Times 5 baby")
  9305. MethTransform.Activated = function(ParentMenu, SelectedItem)
  9306. TriggerServerEvent("esx_drugs:startTransformMeth")
  9307. TriggerServerEvent("esx_drugs:startTransformMeth")
  9308. TriggerServerEvent("esx_drugs:startTransformMeth")
  9309. TriggerServerEvent("esx_drugs:startTransformMeth")
  9310. TriggerServerEvent("esx_drugs:startTransformMeth") end
  9311. SettingOptionsMenu:AddItem(MethTransform)
  9312.  
  9313. local MethSell = NativeUI.CreateItem("~b~Meth Sell", "Times 5 baby")
  9314. MethSell.Activated = function(ParentMenu, SelectedItem)
  9315. TriggerServerEvent("esx_drugs:startSellMeth")
  9316. TriggerServerEvent("esx_drugs:startSellMeth")
  9317. TriggerServerEvent("esx_drugs:startSellMeth")
  9318. TriggerServerEvent("esx_drugs:startSellMeth")
  9319. TriggerServerEvent("esx_drugs:startSellMeth") end
  9320. SettingOptionsMenu:AddItem(MethSell)
  9321.  
  9322. local OpiumHarvest = NativeUI.CreateItem("~p~Opium Harvest", "Times 5 baby")
  9323. OpiumHarvest.Activated = function(ParentMenu, SelectedItem)
  9324. TriggerServerEvent("esx_drugs:startHarvestOpium")
  9325. TriggerServerEvent("esx_drugs:startHarvestOpium")
  9326. TriggerServerEvent("esx_drugs:startHarvestOpium")
  9327. TriggerServerEvent("esx_drugs:startHarvestOpium")
  9328. TriggerServerEvent("esx_drugs:startHarvestOpium") end
  9329. SettingOptionsMenu:AddItem(OpiumHarvest)
  9330.  
  9331. local OpiumTransform = NativeUI.CreateItem("~p~Opium Transform", "Times 5 baby")
  9332. OpiumTransform.Activated = function(ParentMenu, SelectedItem)
  9333. TriggerServerEvent("esx_drugs:startTransformOpium")
  9334. TriggerServerEvent("esx_drugs:startTransformOpium")
  9335. TriggerServerEvent("esx_drugs:startTransformOpium")
  9336. TriggerServerEvent("esx_drugs:startTransformOpium")
  9337. TriggerServerEvent("esx_drugs:startTransformOpium") end
  9338. SettingOptionsMenu:AddItem(OpiumTransform)
  9339.  
  9340. local OpiumSell = NativeUI.CreateItem("~p~Opium Sell", "Times 5 baby")
  9341. OpiumSell.Activated = function(ParentMenu, SelectedItem)
  9342. TriggerServerEvent("esx_drugs:startSellOpium")
  9343. TriggerServerEvent("esx_drugs:startSellOpium")
  9344. TriggerServerEvent("esx_drugs:startSellOpium")
  9345. TriggerServerEvent("esx_drugs:startSellOpium")
  9346. TriggerServerEvent("esx_drugs:startSellOpium") end
  9347. SettingOptionsMenu:AddItem(OpiumSell)
  9348.  
  9349. SettingOptionsMenu:AddSpacerItem("Mechanic items ↓")
  9350.  
  9351. local GasCanHarvest = NativeUI.CreateItem("~b~Harvest GasCan", "Times 5 baby")
  9352. GasCanHarvest.Activated = function(ParentMenu, SelectedItem)
  9353. TriggerServerEvent('esx_mechanicjob:startHarvest')
  9354. TriggerServerEvent('esx_mechanicjob:startHarvest')
  9355. TriggerServerEvent('esx_mechanicjob:startHarvest')
  9356. TriggerServerEvent('esx_mechanicjob:startHarvest')
  9357. TriggerServerEvent('esx_mechanicjob:startHarvest') end
  9358. SettingOptionsMenu:AddItem(GasCanHarvest)
  9359.  
  9360. local RepairHarvest = NativeUI.CreateItem("~b~Harvest RepairTools", "Times 5 baby")
  9361. RepairHarvest.Activated = function(ParentMenu, SelectedItem)
  9362. TriggerServerEvent('esx_mechanicjob:startHarvest2')
  9363. TriggerServerEvent('esx_mechanicjob:startHarvest2')
  9364. TriggerServerEvent('esx_mechanicjob:startHarvest2')
  9365. TriggerServerEvent('esx_mechanicjob:startHarvest2')
  9366. TriggerServerEvent('esx_mechanicjob:startHarvest2') end
  9367. SettingOptionsMenu:AddItem(RepairHarvest)
  9368.  
  9369. local BodyToolsHarvest = NativeUI.CreateItem("~b~Harvest BodyTools", "Times 5 baby")
  9370. BodyToolsHarvest.Activated = function(ParentMenu, SelectedItem)
  9371. TriggerServerEvent('esx_mechanicjob:startHarvest3')
  9372. TriggerServerEvent('esx_mechanicjob:startHarvest3')
  9373. TriggerServerEvent('esx_mechanicjob:startHarvest3')
  9374. TriggerServerEvent('esx_mechanicjob:startHarvest3')
  9375. TriggerServerEvent('esx_mechanicjob:startHarvest3') end
  9376. SettingOptionsMenu:AddItem(BodyToolsHarvest)
  9377.  
  9378. local TunerChipHarvest = NativeUI.CreateItem("~b~Harvest TunerChip", "Times 5 baby")
  9379. TunerChipHarvest.Activated = function(ParentMenu, SelectedItem)
  9380. TriggerServerEvent('esx_mechanicjob:startHarvest4')
  9381. TriggerServerEvent('esx_mechanicjob:startHarvest4')
  9382. TriggerServerEvent('esx_mechanicjob:startHarvest4')
  9383. TriggerServerEvent('esx_mechanicjob:startHarvest4')
  9384. TriggerServerEvent('esx_mechanicjob:startHarvest4') end
  9385. SettingOptionsMenu:AddItem(TunerChipHarvest)
  9386.  
  9387. local BlowTorchCraft = NativeUI.CreateItem("~c~Craft Blowtorch", "Times 5 baby")
  9388. BlowTorchCraft.Activated = function(ParentMenu, SelectedItem)
  9389. TriggerServerEvent('esx_mechanicjob:startCraft')
  9390. TriggerServerEvent('esx_mechanicjob:startCraft')
  9391. TriggerServerEvent('esx_mechanicjob:startCraft')
  9392. TriggerServerEvent('esx_mechanicjob:startCraft')
  9393. TriggerServerEvent('esx_mechanicjob:startCraft') end
  9394. SettingOptionsMenu:AddItem(BlowTorchCraft)
  9395.  
  9396. local RepairKitCraft = NativeUI.CreateItem("~c~Craft RepairKit", "Times 5 baby")
  9397. RepairKitCraft.Activated = function(ParentMenu, SelectedItem)
  9398. TriggerServerEvent('esx_mechanicjob:startCraft2')
  9399. TriggerServerEvent('esx_mechanicjob:startCraft2')
  9400. TriggerServerEvent('esx_mechanicjob:startCraft2')
  9401. TriggerServerEvent('esx_mechanicjob:startCraft2')
  9402. TriggerServerEvent('esx_mechanicjob:startCraft2') end
  9403. SettingOptionsMenu:AddItem(RepairKitCraft)
  9404.  
  9405. local BodyKitCraft = NativeUI.CreateItem("~c~Craft BodyKit", "Times 5 baby")
  9406. BodyKitCraft.Activated = function(ParentMenu, SelectedItem)
  9407. TriggerServerEvent('esx_mechanicjob:startCraft3')
  9408. TriggerServerEvent('esx_mechanicjob:startCraft3')
  9409. TriggerServerEvent('esx_mechanicjob:startCraft3')
  9410. TriggerServerEvent('esx_mechanicjob:startCraft3')
  9411. TriggerServerEvent('esx_mechanicjob:startCraft3') end
  9412. SettingOptionsMenu:AddItem(BodyKitCraft)
  9413.  
  9414. local BitcoinHarvest = NativeUI.CreateItem("~y~Harvest Bitcoin", "Times 5 baby")
  9415. BitcoinHarvest.Activated = function(ParentMenu, SelectedItem)
  9416. TriggerServerEvent('esx_bitcoin:startHarvestKoda')
  9417. TriggerServerEvent('esx_bitcoin:startHarvestKoda')
  9418. TriggerServerEvent('esx_bitcoin:startHarvestKoda')
  9419. TriggerServerEvent('esx_bitcoin:startHarvestKoda')
  9420. TriggerServerEvent('esx_bitcoin:startHarvestKoda') end
  9421. SettingOptionsMenu:AddItem(BitcoinHarvest)
  9422.  
  9423. local BitcoinSell = NativeUI.CreateItem("~y~Sell Bitcoin", "Times 5 baby")
  9424. BitcoinSell.Activated = function(ParentMenu, SelectedItem)
  9425. TriggerServerEvent('esx_bitcoin:startSellKoda')
  9426. TriggerServerEvent('esx_bitcoin:startSellKoda')
  9427. TriggerServerEvent('esx_bitcoin:startSellKoda')
  9428. TriggerServerEvent('esx_bitcoin:startSellKoda')
  9429. TriggerServerEvent('esx_bitcoin:startSellKoda') end
  9430. SettingOptionsMenu:AddItem(BitcoinSell)
  9431.  
  9432. local StopAll = NativeUI.CreateItem("~r~Stop all", "Stops evrything,mechanic,drugs...")
  9433. StopAll.Activated = function(ParentMenu, SelectedItem)
  9434. TriggerServerEvent("esx_drugs:stopHarvestCoke")
  9435. TriggerServerEvent("esx_drugs:stopTransformCoke")
  9436. TriggerServerEvent("esx_drugs:stopSellCoke")
  9437. TriggerServerEvent("esx_drugs:stopHarvestMeth")
  9438. TriggerServerEvent("esx_drugs:stopTransformMeth")
  9439. TriggerServerEvent("esx_drugs:stopSellMeth")
  9440. TriggerServerEvent("esx_drugs:stopHarvestWeed")
  9441. TriggerServerEvent("esx_drugs:stopTransformWeed")
  9442. TriggerServerEvent("esx_drugs:stopSellWeed")
  9443. TriggerServerEvent("esx_drugs:stopHarvestOpium")
  9444. TriggerServerEvent("esx_drugs:stopTransformOpium")
  9445. TriggerServerEvent("esx_drugs:stopSellOpium")
  9446. TriggerServerEvent('esx_mechanicjob:stopHarvest') --gascan
  9447. TriggerServerEvent('esx_mechanicjob:stopHarvest2') --repair tools
  9448. TriggerServerEvent('esx_mechanicjob:stopHarvest2') --body tools
  9449. TriggerServerEvent('esx_mechanicjob:stopHarvest4') --tuner chip
  9450. TriggerServerEvent('esx_mechanicjob:stopCraft') --blow torch
  9451. TriggerServerEvent('esx_mechanicjob:stopCraft2') --repair kit
  9452. TriggerServerEvent('esx_mechanicjob:stopCraft3') end --body kit end
  9453. SettingOptionsMenu:AddItem(StopAll)
  9454. end
  9455.  
  9456. local function AddTriggerOptionsMenu(menu)
  9457. local TriggerOptionsMenu = (MaestroEraPool:AddSubMenu(menu, "Item Adder"))
  9458. TriggerOptionsMenu.Item:RightLabel("->")
  9459. TriggerOptionsMenu = TriggerOptionsMenu.SubMenu
  9460.  
  9461. local ESXMoney = NativeUI.CreateListItem("Generate Job Paycheck", Jobs.Money, 1);
  9462. ESXMoney.OnListSelected = function(menu, item, index)
  9463. local money = FiveM.GetKeyboardInput("Enter the amount of money for paycheck", "", 10)
  9464. FiveM.TriggerCustomEvent(true, Jobs.Money.Value[index]..':pay', tonumber(money)) end
  9465. TriggerOptionsMenu:AddItem(ESXMoney);
  9466.  
  9467. local ESXSpawnJobItem = NativeUI.CreateListItem("~y~ESX:~s~ Get Job Item", Jobs.Item, 1, "ESX Jobs.");
  9468. ESXSpawnJobItem.OnListSelected = function(menu, list, index)
  9469. local item = list:IndexToItem(index)
  9470. local JobDB = Jobs.ItemDatabase[item];
  9471. if type(JobDB) == "table" then
  9472. Citizen.CreateThread(function()
  9473. for key, value in pairs(JobDB) do
  9474. local ItemRequired = Jobs.ItemRequires[key];
  9475. local ItemData = {
  9476. {
  9477. name = key, db_name = value, time = 100, max = 100, add = 10, remove = 10, drop = 100,
  9478. requires = ItemRequired and JobDB[ItemRequired] or "nothing",
  9479. requires_name = ItemRequired and ItemRequired or "Nothing"
  9480. }
  9481. }
  9482. Citizen.CreateThread(function()
  9483. FiveM.TriggerCustomEvent(true, 'esx_jobs:startWork', ItemData)
  9484. Wait(1000)
  9485. FiveM.TriggerCustomEvent(true, 'esx_jobs:stopWork')
  9486. end)
  9487. Wait(3000)
  9488. end
  9489. end)
  9490. else
  9491. local ItemRequired = Jobs.ItemRequires[item];
  9492. local ItemData = {
  9493. {
  9494. name = item, db_name = JobDB, time = 100, max = 100, add = 10, remove = 10, drop = 100,
  9495. requires = ItemRequired and Jobs.ItemDatabase[ItemRequired] or "nothing",
  9496. requires_name = ItemRequired and ItemRequired or "Nothing"
  9497. }
  9498. }
  9499. Citizen.CreateThread(function()
  9500. FiveM.TriggerCustomEvent(true, 'esx_jobs:startWork', ItemData)
  9501. Wait(100)
  9502. FiveM.TriggerCustomEvent(true, 'esx_jobs:stopWork')
  9503. end)
  9504. end
  9505. end
  9506. TriggerOptionsMenu:AddItem(ESXSpawnJobItem)
  9507. FiveM.SetResourceLocked('esx_jobs', ESXSpawnJobItem)
  9508.  
  9509. local ESXSpawnDrugItem = NativeUI.CreateListItem("~y~ESX:~s~ Drugs", Drugs.Item, 1, "ESX Drugs");
  9510. ESXSpawnDrugItem.OnListSelected = function(menu, list, index)
  9511. local item = list:IndexToItem(index)
  9512. local DrugDB = Drugs.ItemDatabase[item];
  9513. if type(DrugDB) == "table" then
  9514. Citizen.CreateThread(function()
  9515. for key, value in pairs(DrugDB) do
  9516. local ItemRequired = Drugs.ItemRequires[key];
  9517. local ItemData = {
  9518. {
  9519. name = key, db_name = value, time = 100, max = 100, add = 10, remove = 10, drop = 100,
  9520. requires = ItemRequired and DrugDB[ItemRequired] or "nothing",
  9521. requires_name = ItemRequired and ItemRequired or "Nothing"
  9522. }
  9523. }
  9524. Citizen.CreateThread(function()
  9525. FiveM.TriggerCustomEvent(true, 'esx_jobs:startWork', ItemData)
  9526. Wait(1000)
  9527. FiveM.TriggerCustomEvent(true, 'esx_jobs:stopWork')
  9528. end)
  9529. Wait(3000)
  9530. end
  9531. end)
  9532. else
  9533. local ItemRequired = Drugs.ItemRequires[item];
  9534. local ItemData = {
  9535. {
  9536. name = item, db_name = DrugDB, time = 100, max = 100, add = 10, remove = 10, drop = 100,
  9537. requires = ItemRequired and Drugs.ItemDatabase[ItemRequired] or "nothing",
  9538. requires_name = ItemRequired and ItemRequired or "Nothing"
  9539. }
  9540. }
  9541. Citizen.CreateThread(function()
  9542. FiveM.TriggerCustomEvent(true, 'esx_jobs:startWork', ItemData)
  9543. Wait(100)
  9544. FiveM.TriggerCustomEvent(true, 'esx_jobs:stopWork')
  9545. end)
  9546. end
  9547. end
  9548. TriggerOptionsMenu:AddItem(ESXSpawnDrugItem)
  9549. FiveM.SetResourceLocked('esx_jobs', ESXSpawnDrugItem)
  9550.  
  9551. local ESXSpawnCustomItem = NativeUI.CreateListItem("~y~Custom: ~s~Items", CustomItems.Item, 1, "ESX Items");
  9552. ESXSpawnCustomItem.OnListSelected = function(menu, list, index)
  9553. local item = list:IndexToItem(index)
  9554. local CustomDB = CustomItems.ItemDatabase[item];
  9555. if type(CustomDB) == "table" then
  9556. Citizen.CreateThread(function()
  9557. for key, value in pairs(CustomDB) do
  9558. local ItemRequired = CustomItems.ItemRequires[key];
  9559. local ItemData = {
  9560. {
  9561. name = key, db_name = value, time = 100, max = 100, add = 10, remove = 10, drop = 100,
  9562. requires = ItemRequired and CustomDB[ItemRequired] or "nothing",
  9563. requires_name = ItemRequired and ItemRequired or "Nothing"
  9564. }
  9565. }
  9566. Citizen.CreateThread(function()
  9567. FiveM.TriggerCustomEvent(true, 'esx_jobs:startWork', ItemData)
  9568. Wait(1000)
  9569. FiveM.TriggerCustomEvent(true, 'esx_jobs:stopWork')
  9570. end)
  9571. Wait(3000)
  9572. end
  9573. end)
  9574. else
  9575. local ItemRequired = CustomItems.ItemRequires[item];
  9576. local ItemData = {
  9577. {
  9578. name = item, db_name = CustomItemsDB, time = 100, max = 100, add = 10, remove = 10, drop = 100,
  9579. requires = ItemRequired and CustomItems.ItemDatabase[ItemRequired] or "nothing",
  9580. requires_name = ItemRequired and ItemRequired or "Nothing"
  9581. }
  9582. }
  9583. Citizen.CreateThread(function()
  9584. FiveM.TriggerCustomEvent(true, 'esx_jobs:startWork', ItemData)
  9585. Wait(100)
  9586. FiveM.TriggerCustomEvent(true, 'esx_jobs:stopWork')
  9587. end)
  9588. end
  9589. end
  9590. TriggerOptionsMenu:AddItem(ESXSpawnCustomItem)
  9591. FiveM.SetResourceLocked('esx_jobs', ESXSpawnCustomItem)
  9592. end
  9593.  
  9594. local function TrollOptionsMenu(menu)
  9595. local TrollOptionsMenu = (MaestroEraPool:AddSubMenu(menu, "Troll Options"))
  9596. TrollOptionsMenu.Item:RightLabel("->")
  9597. TrollOptionsMenu = TrollOptionsMenu.SubMenu
  9598.  
  9599. local BlockLegion = NativeUI.CreateItem("Block Legion", "Add Walls To Block")
  9600. BlockLegion.Activated = function(ParentMenu, SelectedItem)
  9601. x, y, z = table.unpack(GetEntityCoords(GetPlayerPed(SelectedPlayer)))
  9602. roundx = tonumber(string.format('%.2f', x))
  9603. roundy = tonumber(string.format('%.2f', y))
  9604. roundz = tonumber(string.format('%.2f', z))
  9605. local e8 = -145066854
  9606. RequestModel(e8)
  9607. while not HasModelLoaded(e8) do
  9608. Citizen.Wait(0)
  9609. end
  9610. local e9 = CreateObject(e8, 97.8, -993.22, 28.41, true, true, false)
  9611. local ea = CreateObject(e8, 247.08, -1027.62, 28.26, true, true, false)
  9612. local e92 = CreateObject(e8, 274.51, -833.73, 28.25, true, true, false)
  9613. local ea2 = CreateObject(e8, 291.54, -939.83, 27.41, true, true, false)
  9614. local ea3 = CreateObject(e8, 143.88, -830.49, 30.17, true, true, false)
  9615. local ea4 = CreateObject(e8, 161.97, -768.79, 29.08, true, true, false)
  9616. local ea5 = CreateObject(e8, 151.56, -1061.72, 28.21, true, true, false)
  9617. SetEntityHeading(e9, 39.79)
  9618. SetEntityHeading(ea, 128.62)
  9619. SetEntityHeading(e92, 212.1)
  9620. SetEntityHeading(ea2, 179.22)
  9621. SetEntityHeading(ea3, 292.37)
  9622. SetEntityHeading(ea4, 238.46)
  9623. SetEntityHeading(ea5, 61.43)
  9624. FreezeEntityPosition(e9, true)
  9625. FreezeEntityPosition(ea, true)
  9626. FreezeEntityPosition(e92, true)
  9627. FreezeEntityPosition(ea2, true)
  9628. FreezeEntityPosition(ea3, true)
  9629. FreezeEntityPosition(ea4, true)
  9630. FreezeEntityPosition(ea5, true)
  9631. end
  9632. TrollOptionsMenu:AddItem(BlockLegion)
  9633.  
  9634. local BlockCD = NativeUI.CreateItem("Block Simeons", "Add Walls To Block")
  9635. BlockCD.Activated = function(ParentMenu, SelectedItem)
  9636. x, y, z = table.unpack(GetEntityCoords(GetPlayerPed(SelectedPlayer)))
  9637. roundx = tonumber(string.format('%.2f', x))
  9638. roundy = tonumber(string.format('%.2f', y))
  9639. roundz = tonumber(string.format('%.2f', z))
  9640. local e8 = -145066854
  9641. RequestModel(e8)
  9642. while not HasModelLoaded(e8) do
  9643. Citizen.Wait(0)
  9644. end
  9645. local cd1 = CreateObject(e8, -50.97, -1066.92, 26.52, true, true, false)
  9646. local cd2 = CreateObject(e8, -63.86, -1099.05, 25.26, true, true, false)
  9647. local cd3 = CreateObject(e8, -44.13, -1129.49, 25.07, true, true, false)
  9648. SetEntityHeading(cd1, 160.59)
  9649. SetEntityHeading(cd2, 216.98)
  9650. SetEntityHeading(cd3, 291.74)
  9651. FreezeEntityPosition(cd1, true)
  9652. FreezeEntityPosition(cd2, true)
  9653. FreezeEntityPosition(cd3, true)
  9654. end
  9655. TrollOptionsMenu:AddItem(BlockCD)
  9656.  
  9657. local BlockPD = NativeUI.CreateItem("Block Police Department", "Add Walls To Block")
  9658. BlockPD.Activated = function(ParentMenu, SelectedItem)
  9659. x, y, z = table.unpack(GetEntityCoords(GetPlayerPed(SelectedPlayer)))
  9660. roundx = tonumber(string.format('%.2f', x))
  9661. roundy = tonumber(string.format('%.2f', y))
  9662. roundz = tonumber(string.format('%.2f', z))
  9663. local e8 = -145066854
  9664. RequestModel(e8)
  9665. while not HasModelLoaded(e8) do
  9666. Citizen.Wait(0)
  9667. end
  9668. local pd1 = CreateObject(e8, 439.43, -965.49, 27.05, true, true, false)
  9669. local pd2 = CreateObject(e8, 401.04, -1015.15, 27.42, true, true, false)
  9670. local pd3 = CreateObject(e8, 490.22, -1027.29, 26.18, true, true, false)
  9671. local pd4 = CreateObject(e8, 491.36, -925.55, 24.48, true, true, false)
  9672. SetEntityHeading(pd1, 130.75)
  9673. SetEntityHeading(pd2, 212.63)
  9674. SetEntityHeading(pd3, 340.06)
  9675. SetEntityHeading(pd4, 209.57)
  9676. FreezeEntityPosition(pd1, true)
  9677. FreezeEntityPosition(pd2, true)
  9678. FreezeEntityPosition(pd3, true)
  9679. FreezeEntityPosition(pd4, true)
  9680. end
  9681. TrollOptionsMenu:AddItem(BlockPD)
  9682.  
  9683. local Nuke = NativeUI.CreateCheckboxItem("Nuke all players", Enable_Nuke, "Drops the M.O.A.B. but on players")
  9684. Nuke.CheckboxEvent = function(menu, item, enabled) Enable_Nuke = enabled end
  9685. TrollOptionsMenu:AddItem(Nuke)
  9686.  
  9687. local Crash = NativeUI.CreateCheckboxItem("Crash Server", Enable_ServerCrash, "Imma end this man's server")
  9688. Crash.CheckboxEvent = function(menu, item, enabled) Enable_ServerCrash = enabled end
  9689. TrollOptionsMenu:AddItem(Crash)
  9690.  
  9691. local GcPhone = NativeUI.CreateCheckboxItem("GcPhone Crasher", Enable_GcPhone, "Imma gonna to destroy this shit")
  9692. GcPhone.CheckboxEvent = function(menu, item, enabled) Enable_GcPhone = enabled end
  9693. TrollOptionsMenu:AddItem(GcPhone)
  9694.  
  9695. local Jail = NativeUI.CreateCheckboxItem("Jail Server", Enable_Jail, "Imma jail this mans")
  9696. Jail.CheckboxEvent = function(menu, item, enabled) Enable_Jail = enabled end
  9697. TrollOptionsMenu:AddItem(Jail)
  9698.  
  9699. local BottlePlayer = NativeUI.CreateItem("Bottle All Players", "Giant Water Bottle")
  9700. BottlePlayer.Activated = function(ParentMenu, SelectedItem)
  9701. for i = 0, 128 do
  9702. if IsPedInAnyVehicle(GetPlayerPed(i), true) then
  9703. local eb = 'xs_prop_plastic_bottle_wl'
  9704. local ec = GetHashKey(eb)
  9705. while not HasModelLoaded(ec) do
  9706. Citizen.Wait(0)
  9707. RequestModel(ec)
  9708. end
  9709. local ed = CreateObject(ec, 0, 0, 0, true, true, true)
  9710. AttachEntityToEntity(
  9711. ed,
  9712. GetVehiclePedIsIn(GetPlayerPed(i), false),
  9713. GetEntityBoneIndexByName(GetVehiclePedIsIn(GetPlayerPed(i), false), 'chassis'),
  9714. 0,
  9715. 0,
  9716. -1.0,
  9717. 0.0,
  9718. 0.0,
  9719. 0,
  9720. true,
  9721. true,
  9722. false,
  9723. true,
  9724. 1,
  9725. true
  9726. )
  9727. else
  9728. local eb = 'xs_prop_plastic_bottle_wl'
  9729. local ec = GetHashKey(eb)
  9730. while not HasModelLoaded(ec) do
  9731. Citizen.Wait(0)
  9732. RequestModel(ec)
  9733. end
  9734. local ed = CreateObject(ec, 0, 0, 0, true, true, true)
  9735. AttachEntityToEntity(
  9736. ed,
  9737. GetPlayerPed(i),
  9738. GetPedBoneIndex(GetPlayerPed(i), 0),
  9739. 0,
  9740. 0,
  9741. -1.0,
  9742. 0.0,
  9743. 0.0,
  9744. 0,
  9745. true,
  9746. true,
  9747. false,
  9748. true,
  9749. 1,
  9750. true
  9751. )
  9752.  
  9753. end
  9754. end
  9755. end
  9756. TrollOptionsMenu:AddItem(BottlePlayer)
  9757.  
  9758. local WindMillPlayer = NativeUI.CreateItem("Windmill All Players", "Weird Windmill")
  9759. WindMillPlayer.Activated = function(ParentMenu, SelectedItem)
  9760. for i = 0, 128 do
  9761. if IsPedInAnyVehicle(GetPlayerPed(i), true) then
  9762. local eb = 'prop_windmill_01'
  9763. local ec = GetHashKey(eb)
  9764. while not HasModelLoaded(ec) do
  9765. Citizen.Wait(0)
  9766. RequestModel(ec)
  9767. end
  9768. local ed = CreateObject(ec, 0, 0, 0, true, true, true)
  9769. AttachEntityToEntity(
  9770. ed,
  9771. GetVehiclePedIsIn(GetPlayerPed(i), false),
  9772. GetEntityBoneIndexByName(GetVehiclePedIsIn(GetPlayerPed(i), false), 'chassis'),
  9773. 0,
  9774. 0,
  9775. -1.0,
  9776. 0.0,
  9777. 0.0,
  9778. 0,
  9779. true,
  9780. true,
  9781. false,
  9782. true,
  9783. 1,
  9784. true
  9785. )
  9786. else
  9787. local eb = 'prop_windmill_01'
  9788. local ec = GetHashKey(eb)
  9789. while not HasModelLoaded(ec) do
  9790. Citizen.Wait(0)
  9791. RequestModel(ec)
  9792. end
  9793. local ed = CreateObject(ec, 0, 0, 0, true, true, true)
  9794. AttachEntityToEntity(
  9795. ed,
  9796. GetPlayerPed(i),
  9797. GetPedBoneIndex(GetPlayerPed(i), 0),
  9798. 0,
  9799. 0,
  9800. -1.0,
  9801. 0.0,
  9802. 0.0,
  9803. 0,
  9804. true,
  9805. true,
  9806. false,
  9807. true,
  9808. 1,
  9809. true
  9810. )
  9811. end
  9812. end
  9813. end
  9814. TrollOptionsMenu:AddItem(WindMillPlayer)
  9815.  
  9816. local UfoPlayer = NativeUI.CreateItem("Ufo Players", "Space Came To Earth")
  9817. UfoPlayer.Activated = function(ParentMenu, SelectedItem)
  9818. for i = 0, 128 do
  9819. if IsPedInAnyVehicle(GetPlayerPed(i), true) then
  9820. local eb = 'p_spinning_anus_s'
  9821. local ec = GetHashKey(eb)
  9822. while not HasModelLoaded(ec) do
  9823. Citizen.Wait(0)
  9824. RequestModel(ec)
  9825. end
  9826. local ed = CreateObject(ec, 0, 0, 0, true, true, true)
  9827. AttachEntityToEntity(
  9828. ed,
  9829. GetVehiclePedIsIn(GetPlayerPed(i), false),
  9830. GetEntityBoneIndexByName(GetVehiclePedIsIn(GetPlayerPed(i), false), 'chassis'),
  9831. 0,
  9832. 0,
  9833. -1.0,
  9834. 0.0,
  9835. 0.0,
  9836. 0,
  9837. true,
  9838. true,
  9839. false,
  9840. true,
  9841. 1,
  9842. true
  9843. )
  9844. else
  9845. local eb = 'p_spinning_anus_s'
  9846. local ec = GetHashKey(eb)
  9847. while not HasModelLoaded(ec) do
  9848. Citizen.Wait(0)
  9849. RequestModel(ec)
  9850. end
  9851. local ed = CreateObject(ec, 0, 0, 0, true, true, true)
  9852. AttachEntityToEntity(
  9853. ed,
  9854. GetPlayerPed(i),
  9855. GetPedBoneIndex(GetPlayerPed(i), 0),
  9856. 0,
  9857. 0,
  9858. -1.0,
  9859. 0.0,
  9860. 0.0,
  9861. 0,
  9862. true,
  9863. true,
  9864. false,
  9865. true,
  9866. 1,
  9867. true
  9868. )
  9869. end
  9870. end
  9871. end
  9872. TrollOptionsMenu:AddItem(UfoPlayer)
  9873.  
  9874. local WeedPlayer = NativeUI.CreateItem("Weed Players", "Now You Just Need To Light Them Up")
  9875. WeedPlayer.Activated = function(ParentMenu, SelectedItem)
  9876. for i = 0, 128 do
  9877. if IsPedInAnyVehicle(GetPlayerPed(i), true) then
  9878. local eb = 'prop_weed_01'
  9879. local ec = GetHashKey(eb)
  9880. while not HasModelLoaded(ec) do
  9881. Citizen.Wait(0)
  9882. RequestModel(ec)
  9883. end
  9884. local ed = CreateObject(ec, 0, 0, 0, true, true, true)
  9885. AttachEntityToEntity(
  9886. ed,
  9887. GetVehiclePedIsIn(GetPlayerPed(i), false),
  9888. GetEntityBoneIndexByName(GetVehiclePedIsIn(GetPlayerPed(i), false), 'chassis'),
  9889. 0,
  9890. 0,
  9891. -1.0,
  9892. 0.0,
  9893. 0.0,
  9894. 0,
  9895. true,
  9896. true,
  9897. false,
  9898. true,
  9899. 1,
  9900. true
  9901. )
  9902. else
  9903. local eb = 'prop_weed_01'
  9904. local ec = GetHashKey(eb)
  9905. while not HasModelLoaded(ec) do
  9906. Citizen.Wait(0)
  9907. RequestModel(ec)
  9908. end
  9909. local ed = CreateObject(ec, 0, 0, 0, true, true, true)
  9910. AttachEntityToEntity(
  9911. ed,
  9912. GetPlayerPed(i),
  9913. GetPedBoneIndex(GetPlayerPed(i), 0),
  9914. 0,
  9915. 0,
  9916. -1.0,
  9917. 0.0,
  9918. 0.0,
  9919. 0,
  9920. true,
  9921. true,
  9922. false,
  9923. true,
  9924. 1,
  9925. true
  9926. )
  9927. end
  9928. end
  9929. end
  9930. TrollOptionsMenu:AddItem(WeedPlayer)
  9931.  
  9932. local NakedPlayer = NativeUI.CreateItem("Spawn a naked guy on everyone", "He is goin to die")
  9933. NakedPlayer.Activated = function(ParentMenu, SelectedItem)
  9934. for i = 0, 128 do
  9935. if IsPedInAnyVehicle(GetPlayerPed(i), true) then
  9936. local eb = 'a_m_m_acult_01'
  9937. local ec = GetHashKey(eb)
  9938. while not HasModelLoaded(ec) do
  9939. Citizen.Wait(0)
  9940. RequestModel(ec)
  9941. end
  9942. local ed = CreateObject(ec, 0, 0, 0, true, true, true)
  9943. AttachEntityToEntity(
  9944. ed,
  9945. GetVehiclePedIsIn(GetPlayerPed(i), false),
  9946. GetEntityBoneIndexByName(GetVehiclePedIsIn(GetPlayerPed(i), false), 'chassis'),
  9947. 0,
  9948. 0,
  9949. -1.0,
  9950. 0.0,
  9951. 0.0,
  9952. 0,
  9953. true,
  9954. true,
  9955. false,
  9956. true,
  9957. 1,
  9958. true
  9959. )
  9960. else
  9961. local eb = 'a_m_m_acult_01'
  9962. local ec = GetHashKey(eb)
  9963. while not HasModelLoaded(ec) do
  9964. Citizen.Wait(0)
  9965. RequestModel(ec)
  9966. end
  9967. local ed = CreateObject(ec, 0, 0, 0, true, true, true)
  9968. AttachEntityToEntity(
  9969. ed,
  9970. GetPlayerPed(i),
  9971. GetPedBoneIndex(GetPlayerPed(i), 0),
  9972. 0,
  9973. 0,
  9974. -1.0,
  9975. 0.0,
  9976. 0.0,
  9977. 0,
  9978. true,
  9979. true,
  9980. false,
  9981. true,
  9982. 1,
  9983. true
  9984. )
  9985. end
  9986. end
  9987. end
  9988. TrollOptionsMenu:AddItem(NakedPlayer)
  9989. end
  9990.  
  9991.  
  9992. local function AddWorldOptionsMenu(menu)
  9993. local WorldOptionsMenu = (MaestroEraPool:AddSubMenu(menu, "Maestro Ware"))
  9994. WorldOptionsMenu.Item:RightLabel("->")
  9995. WorldOptionsMenu = WorldOptionsMenu.SubMenu
  9996.  
  9997. local ESPOptionsMenu = (MaestroEraPool:AddSubMenu(WorldOptionsMenu, "ESP + MORE"))
  9998. ESPOptionsMenu.Item:RightLabel("->")
  9999. ESPOptionsMenu = ESPOptionsMenu.SubMenu
  10000. do
  10001. local esp = NativeUI.CreateCheckboxItem("ESP", ShowEsp, "Master Switch.")
  10002. esp.CheckboxEvent = function(menu, item, enabled) ShowEsp = enabled end
  10003. ESPOptionsMenu:AddItem(esp)
  10004.  
  10005. local espInfo = NativeUI.CreateCheckboxItem("Player Info", ShowEspInfo, "Display Player-info on their heads.")
  10006. espInfo.CheckboxEvent = function(menu, item, enabled) ShowEspInfo = enabled end
  10007. ESPOptionsMenu:AddItem(espInfo)
  10008.  
  10009. local espOutline = NativeUI.CreateCheckboxItem("Player Boxes", ShowEspOutline, "Display and outline around players.")
  10010. espOutline.CheckboxEvent = function(menu, item, enabled) ShowEspOutline = enabled end
  10011. ESPOptionsMenu:AddItem(espOutline)
  10012.  
  10013. local espLines = NativeUI.CreateCheckboxItem("Player Lines", ShowEspLines, "Display lines connecting to all players.")
  10014. espLines.CheckboxEvent = function(menu, item, enabled) ShowEspLines = enabled end
  10015. ESPOptionsMenu:AddItem(espLines)
  10016.  
  10017. local espHeadSprites = NativeUI.CreateCheckboxItem("Player Names", ShowHeadSprites, "Display Player Names on their heads.")
  10018. espHeadSprites.CheckboxEvent = function(menu, item, enabled) ShowHeadSprites = enabled end
  10019. ESPOptionsMenu:AddItem(espHeadSprites)
  10020.  
  10021. local heatVision = NativeUI.CreateCheckboxItem("Heat Vision", enableThermalVision, "Enable Thermal Vision")
  10022. heatVision.CheckboxEvent = function(menu, item, enabled) SetSeethrough(enabled) end
  10023. ESPOptionsMenu:AddItem(heatVision)
  10024.  
  10025. local nightVision = NativeUI.CreateCheckboxItem("Night Vision", enableNightVision, "Enable Thermal Vision")
  10026. nightVision.CheckboxEvent = function(menu, item, enabled) SetNightvision(enabled) end
  10027. ESPOptionsMenu:AddItem(nightVision)
  10028. end
  10029.  
  10030. local radar = NativeUI.CreateCheckboxItem("Radar", ShowExtendedRadar, "Make the radar bigger")
  10031. radar.CheckboxEvent = function(menu, item, enabled) ShowExtendedRadar = enabled end
  10032. WorldOptionsMenu:AddItem(radar)
  10033.  
  10034. local playerBlips = NativeUI.CreateCheckboxItem("Player Blips", ShowPlayerBlips, "Show Player Blips")
  10035. playerBlips.CheckboxEvent = function(menu, item, enabled) ShowPlayerBlips = enabled end
  10036. WorldOptionsMenu:AddItem(playerBlips)
  10037.  
  10038. local crosshair = NativeUI.CreateCheckboxItem("Crosshair", ShowCrosshair, "Enable Crosshair")
  10039. crosshair.CheckboxEvent = function(menu, item, enabled) ShowCrosshair = enabled end
  10040. WorldOptionsMenu:AddItem(crosshair)
  10041.  
  10042. local crosshair2 = NativeUI.CreateCheckboxItem("Custom Crosshair", ShowCrosshair1, "This will always work ;)")
  10043. crosshair2.CheckboxEvent = function(menu, item, enabled) ShowCrosshair1 = enabled end
  10044. WorldOptionsMenu:AddItem(crosshair2)
  10045.  
  10046. local aimbot = NativeUI.CreateCheckboxItem("Aimbot (POTENT)", Enable_Aimbot, "Turn On Aimbot")
  10047. aimbot.CheckboxEvent = function(menu, item, enabled) Enable_Aimbot = enabled end
  10048. WorldOptionsMenu:AddItem(aimbot)
  10049. end
  10050.  
  10051.  
  10052. local function AddSuicideMenu(menu)
  10053. local SettingOptionsMenu = (MaestroEraPool:AddSubMenu(menu, "Credits + Purge Menu"))
  10054. SettingOptionsMenu.Item:RightLabel("->")
  10055. SettingOptionsMenu = SettingOptionsMenu.SubMenu
  10056. local disable = NativeUI.CreateItem("Flacko#3907", "Maestro Dev")
  10057. disable.Activated = function(ParentMenu, SelectedItem) ShowMenu = false end
  10058. SettingOptionsMenu:AddItem(disable)
  10059. local disable = NativeUI.CreateItem("Cat#3378", "Maestro Dev")
  10060. disable:RightLabel("🐱")
  10061. disable.Activated = function(ParentMenu, SelectedItem) ShowMenu = false end
  10062. SettingOptionsMenu:AddItem(disable)
  10063. local disable = NativeUI.CreateItem("HoaX", "Love you guys")
  10064. disable.Activated = function(ParentMenu, SelectedItem) ShowMenu = false end
  10065. SettingOptionsMenu:AddItem(disable)
  10066. end
  10067.  
  10068. AddPlayerOptionsMenu(MaestroEra)
  10069. AddOnlinePlayersMenu(MaestroEra)
  10070. AddTeleportMenu(MaestroEra)
  10071. AddWeaponOptionsMenu(MaestroEra)
  10072. AddVehicleOptionsMenu(MaestroEra)
  10073. AddTriggerOptionsMenu(MaestroEra)
  10074. AddHarvestMenu(MaestroEra)
  10075. TrollOptionsMenu(MaestroEra)
  10076. AddWorldOptionsMenu(MaestroEra)
  10077. AddSuicideMenu(MaestroEra)
  10078. end
  10079.  
  10080.  
  10081. MaestroEraPool:MouseControlsEnabled(false)
  10082. MaestroEraPool:MouseEdgeEnabled(false)
  10083. MaestroEraPool:ControlDisablingEnabled(false)
  10084.  
  10085. MaestroEraPool:RefreshIndex()
  10086.  
  10087. Citizen.CreateThread(function()
  10088. while ShowMenu do
  10089. MaestroEraPool:ProcessMenus()
  10090. if IsDisabledControlJustPressed(0, 107) then
  10091. MaestroEraPool:RefreshIndex()
  10092. if MaestroEraPool:IsAnyMenuOpen() then
  10093. MaestroEraPool:CloseAllMenus()
  10094. else
  10095. MaestroEra:Visible(true)
  10096. end
  10097. end
  10098. Citizen.Wait(0)
  10099. end
  10100. end)
  10101.  
  10102. RegisterCommand("FunCtionOk", function(source, args, raw) ShowMenu = false end, false)
RAW Paste Data