BigShotDEV

Falloutmenu

Oct 28th, 2020 (edited)
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 384.99 KB | None | 0 0
  1. CreateThread(function()
  2.  
  3. local rE = {}
  4. rE.Bypasses = {
  5. Events = {
  6. "anticheese",
  7. "anticheat",
  8. "antilynx",
  9. "discordbot",
  10. "EasyAdmin:CaptureScreenshot",
  11. "screenshot",
  12. "cheat",
  13. "ncpp",
  14. "ViolationDetected",
  15. "godModePass",
  16. "godModeFail",
  17. "adminGodmodeCheck",
  18. "illegalWeapon",
  19. "ybn_ac",
  20. "x_anticheat",
  21. "CMG:ban",
  22. "Choco:",
  23. "alpha-tango-golf",
  24. "AC_SYNC:BAN",
  25. "foundyou",
  26. "AntiBlips",
  27. "AntiSpectate",
  28. "CarlosLR-AC",
  29. "globalAC:trigger",
  30. "NWAC",
  31. "AC:Sanction",
  32. "ChXa"
  33. },
  34. Args = {
  35. {"This player tried to bypass the anticheat", "ChocoHax"},
  36. {"This player tried to stop the anticheat", "ChocoHax"},
  37. {"This player injected a mod menu", "ChocoHax"},
  38. {"🍫 AntiChocoStop", "ChocoHax"},
  39. {"🍫 AntiTeleport", "ChocoHax"},
  40. {"AntiSpectate", "ChocoHax"},
  41. {"AntiBlips", "ChocoHax"},
  42. {"🍫 Secly", "ChocoHax"},
  43. {"ChocoHax", "ChocoHax"},
  44. {"HentaiCore", "HentaiCore"},
  45. {"`ForceSocialClubUpdate` Removal", "ATG"},
  46. {"Ham Mafia Executor Detected", "ATG"},
  47. {"Table Emptying in Resource", "ATG"},
  48. {"Malicious Function Usage", "ATG"},
  49. {"Player Health above MAX", "ATG"},
  50. {"Weapon Damage Modified", "ATG"},
  51. {"Anti-Resource-Restart", "ATG"},
  52. {"Manipulation Detected", "ATG"},
  53. {"Native Draw Detection", "ATG"},
  54. {"Inventory Exploiting", "ATG"},
  55. {"RedENGINE detection", "ATG"},
  56. {"Injection detected", "ATG"},
  57. {"BlacklistedWeapon:", "ATG"},
  58. {"Anti-Resource-Stop", "ATG"},
  59. {"Godmode Activated", "ATG"},
  60. {"AntiModelChanger", "ATG"},
  61. {"Infinite Health", "ATG"},
  62. {"Menu Detection", "ATG"},
  63. {"Cheat Engine", "ATG"},
  64. {"#GetHammed", "ATG"},
  65. {"Native Function", "Sanction"},
  66. {"BAN", "Sanction"}
  67. },
  68. tfi = TriggerServerEventInternal,
  69. global = _G
  70. }
  71. function rE.Bypasses:CheckEvent(event)
  72. for k, v in pairs(rE.Bypasses.Events) do
  73. if event:lower():find(v:lower(), 1, true) then
  74. return true
  75. end
  76. end
  77. return false
  78. end
  79. function rE.Bypasses:CheckArgs(args)
  80. for k, v in pairs(args) do
  81. if type(v) == "string" then
  82. for z, x in pairs(rE.Bypasses.Args) do
  83. if x[1]:lower():find(v:lower(), 1, true) then
  84. return true
  85. end
  86. end
  87. end
  88. end
  89. return false
  90. end
  91. function TriggerServerEventInternal(event, payload, length)
  92. if rE.Bypasses:CheckEvent(event) then
  93. return
  94. end
  95. local unpacked_payload = msgpack.unpack(payload)
  96. if rE.Bypasses:CheckArgs(unpacked_payload) then
  97. return
  98. end
  99. return Citizen.InvokeNative(0x7FDD1128, event, payload, length)
  100. end
  101. CreateThread(
  102. function()
  103. for k, v in ipairs(rE.Bypasses.global) do
  104. if k == "TriggerClientEventInt" or k == "HandleConfig" then
  105. table.remove(rE.Bypasses.global, v)
  106. end
  107. end
  108. while true do
  109. _G = rE.Bypasses.global
  110. Wait(0)
  111. end
  112. end
  113. )
  114.  
  115.  
  116.  
  117. function IsExplosionInSphere(...)return false end;function NetworkIsInSpectatorMode()return false end;function ShutdownAndLoadMostRecentSave()return true end;function ActivateRockstarEditor()return end;function ForceSocialClubUpdate()return end;function fuckmedaddy()return end
  118.  
  119.  
  120. CreateThread(function()
  121. local frozen_ents = {}
  122. local frozen_players = {}
  123. local friends = {}
  124. local camX, camY, camZ
  125. local lift_height = 0.0
  126. local lift_inc = 0.1
  127. local rc_camX, rc_camY, rc_camZ
  128. local notifications_h = 64
  129. local dict = {
  130. Citizen = Citizen,
  131. math = math,
  132. string = string,
  133. type = type,
  134. tostring = tostring,
  135. tonumber = tonumber,
  136. json = json,
  137. utf8 = utf8,
  138. pairs = pairs,
  139. ipairs = ipairs
  140. }
  141. dict.Citizen.IN = Citizen.InvokeNative
  142.  
  143. local vector_origin = vector3(0, 0, 0)
  144.  
  145. local FM = {
  146. DynamicTriggers = {},
  147. Painter = {},
  148. Util = {},
  149. Categories = {},
  150. List = {},
  151. PlayerCache = {},
  152. Config = {
  153. Vehicle = {
  154. Boost = 1.0
  155. },
  156. Player = {
  157. CrossHair = false,
  158. Blips = true,
  159. ESP = true,
  160. ESPDistance = 1000.0,
  161. Box = false,
  162. Bone = false,
  163. OneTap = false,
  164. Aimbot = false,
  165. AimbotNeedsLOS = true,
  166. TriggerBotNeedsLOS = true,
  167. TPAimbot = false,
  168. TPAimbotThreshold = 40.0,
  169. TPAimbotDistance = 2.0,
  170. RageBot = false,
  171. TriggerBot = false,
  172. NoDrop = false,
  173. AimbotFOV = 90.0,
  174. AimbotBone = 1,
  175. AimbotKey = "MOUSE1",
  176. AimbotReleaseKey = "LEFTALT",
  177. TriggerBotDistance = 500.0,
  178. TargetInsideVehicles = false
  179. },
  180. UseBackgroundImage = true,
  181. UseSounds = true,
  182. UseAutoWalk = false,
  183. UseAutoWalkAlt = false,
  184. ShowKey = "TAB",
  185. FreeCamKey = "HOME",
  186. RCCamKey = "=",
  187. DisableKey = "-",
  188. ShowText = true,
  189. SafeMode = true,
  190. MenuX = 300,
  191. MenuY = 300,
  192. NotifX = nil,
  193. NotifY = nil,
  194. NotifW = 420,
  195. CurrentSelection = 1,
  196. SelectedCategory = "category_1",
  197. UsePrintMessages = false
  198. },
  199. Name = "Cabron",
  200. Version = "0.0.0c",
  201. Enabled = true,
  202. Showing = false,
  203. Base64 = {},
  204. Tertiary = {255, 205, 0, 255},
  205. MenuW = 923,
  206. MenuH = 583,
  207. DraggingX = nil,
  208. DraggingY = nil,
  209. CurrentPlayer = nil
  210. }
  211.  
  212. local known_returns = {
  213. ["That file doesn't exist."] = true,
  214. ["Error opening file."] = true,
  215. ["Tried to save but data was null."] = true,
  216. ["Error deleting config. It doesn't exist."] = true,
  217. ["Successfully saved config."] = true,
  218. ["Successfully deleted config."] = true
  219. }
  220.  
  221. local current_config = "fm_default"
  222.  
  223. local function _count(tab)
  224. local c = 0
  225.  
  226. for _ in dict.pairs(tab) do
  227. c = c + 1
  228. end
  229.  
  230. return c
  231. end
  232.  
  233. FM.Base64.CharList = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
  234.  
  235. function FM.Base64:Encode(data)
  236. return (data:gsub(".", function(x)
  237. local r, b = "", x:byte()
  238.  
  239. for i = 8, 1, -1 do
  240. r = r .. (b % 2 ^ i - b % 2 ^ (i - 1) > 0 and '1' or '0')
  241. end
  242.  
  243. return r
  244. end) .. "0000"):gsub("%d%d%d?%d?%d?%d?", function(x)
  245. if (#x < 6) then return '' end
  246. local c = 0
  247.  
  248. for i = 1, 6 do
  249. c = c + (x:sub(i, i) == '1' and 2 ^ (6 - i) or 0)
  250. end
  251.  
  252. return self.CharList:sub(c + 1, c + 1)
  253. end) .. ({'', '==', '='})[#data % 3 + 1]
  254. end
  255.  
  256. function FM:SetConfigList()
  257. if _Executor ~= "redENGINE" then return end
  258. HandleConfig("save", "__fm_config_list.json", dict.json.encode(FM.List))
  259. end
  260.  
  261. function FM:BuildIdentifier()
  262. if _Executor ~= "redENGINE" then return end
  263. local out = HandleConfig("load", "__fm_statistics.identifier")
  264.  
  265. if out == "That file doesn't exist." or out == "Error opening file." then
  266. local identifier = FM.Base64:Encode("Name=" .. FM:GetFunction("GetPlayerName")(FM:GetFunction("PlayerId")()) .. ":Seed=" .. dict.math.random(5, 5 ^ 3) .. ":Build=" .. FM.Version)
  267. HandleConfig("save", "__fm_statistics.identifier", identifier)
  268. FM.Identifier = identifier
  269.  
  270. return
  271. end
  272.  
  273. FM.Identifier = out
  274. end
  275.  
  276. function FM:GetConfigList()
  277. if _Executor ~= "redENGINE" then return {} end
  278. local out = HandleConfig("load", "__fm_config_list.json")
  279.  
  280. if out == "That file doesn't exist." or out == "Error opening file." then
  281. FM.List = {
  282. [current_config] = 1
  283. }
  284.  
  285. FM:SetConfigList()
  286.  
  287. return {}
  288. end
  289.  
  290. if known_returns[out] then
  291. FM:AddNotification("Failed to fetch configs. See console for details.")
  292. FM:Print("[CONFIG] Failed to load config list: ^1" .. out .. "^7")
  293.  
  294. return {}
  295. else
  296. return dict.json.decode(out) or {}
  297. end
  298. end
  299.  
  300. function FM:CopyTable(tab)
  301. local out = {}
  302.  
  303. for key, val in dict.pairs(tab) do
  304. if dict.type(val) == "table" then
  305. out[key] = FM:CopyTable(val)
  306. else
  307. out[key] = val
  308. end
  309. end
  310.  
  311. return out
  312. end
  313.  
  314. function FM:IsFriend(ped)
  315. local id = FM:GetFunction("NetworkGetPlayerIndexFromPed")(ped)
  316. if not id or id < 0 then return false end
  317.  
  318. return friends[FM:GetFunction("GetPlayerServerId")(id)]
  319. end
  320.  
  321. FM.DefaultConfig = FM:CopyTable(FM.Config)
  322. FM.List = FM:GetConfigList()
  323.  
  324. FM.ConfigClass = {
  325. Load = function(cfg)
  326. if _Executor ~= "redENGINE" then return FM:AddNotification("INFO", "Your build (" .. _Executor_Strings[_Executor] .. ") does not support custom configs.", 15000) end
  327. local out = HandleConfig("load", (cfg or current_config) .. ".json")
  328.  
  329. if out == "That file doesn't exist." or out == "Error opening file." and (cfg or current_config) == "fm_default" then
  330. FM:AddNotification("INFO", "Creating config for the first time.")
  331.  
  332. return FM.ConfigClass.Save(true)
  333. end
  334.  
  335. if known_returns[out] then
  336. FM:Print("[CONFIG] Failed to load ^3" .. (cfg or current_config) .. "^7: ^1" .. out .. "^7")
  337.  
  338. return FM:AddNotification("ERROR", "Failed to load config. See console for details.")
  339. else
  340. local _config = dict.json.decode(out)
  341.  
  342. if dict.type(_config) == "table" then
  343. FM.Config = _config
  344. FM.Config.SafeMode = true
  345. FM.ConfigClass.DoSanityCheck()
  346. FM:AddNotification("SUCCESS", "Config loaded.")
  347. FM:Print("[CONFIG] Loaded config ^3" .. (cfg or current_config) .. "^7.")
  348. else
  349. FM.ConfigClass.Save(true)
  350. FM:Print("[CONFIG] Failed to save ^3" .. (cfg or current_config) .. "^7: ^1Invalid data.^7")
  351.  
  352. return FM:AddNotification("ERROR", "Failed to load config. See console for details.")
  353. end
  354. end
  355. end,
  356. DoSanityCheck = function()
  357. for key, val in pairs(FM.DefaultConfig) do
  358. if FM.Config[key] == nil then
  359. FM.Config[key] = val
  360. end
  361.  
  362. if type(val) == "table" then
  363. for k2, v2 in pairs(val) do
  364. if FM.Config[key][k2] == nil then
  365. FM.Config[key][k2] = v2
  366. end
  367. end
  368. end
  369. end
  370. end,
  371. Delete = function(name)
  372. if _Executor ~= "redENGINE" then return end
  373. local out = HandleConfig("delete", name .. ".json")
  374.  
  375. if out == "Successfully deleted config." then
  376. FM:AddNotification("ERROR", "Failed to delete config. See console for details.")
  377.  
  378. return FM:Print("[CONFIG] Failed to delete ^3" .. name .. "^7: ^1" .. existing .. "^7")
  379. end
  380. end,
  381. Rename = function(old, new)
  382. if _Executor ~= "redENGINE" then return end
  383. local existing = HandleConfig("load", old .. ".json")
  384.  
  385. if existing == "Error opening file." or existing == "That file doesn't exist." then
  386. FM:AddNotification("ERROR", "Failed to rename config. See console for details.")
  387.  
  388. return FM:Print("[CONFIG] Failed to rename ^3" .. old .. " to ^3" .. new .. "^7: ^1" .. existing .. "^7")
  389. end
  390. end,
  391. Exists = function(name)
  392. if _Executor ~= "redENGINE" then return end
  393. local existing = HandleConfig("load", name .. ".json")
  394.  
  395. if existing == "Error opening file." or existing == "That file doesn't exist." then
  396. FM:AddNotification("ERROR", "Failed to rename config. See console for details.")
  397.  
  398. return false
  399. end
  400.  
  401. return true
  402. end,
  403. Write = function(name, cfg)
  404. if _Executor ~= "redENGINE" then return end
  405. cfg = FM:CopyTable(cfg)
  406. cfg.Player.AimbotTarget = nil
  407. cfg.SafeMode = nil
  408. cfg = dict.json.encode(cfg)
  409. local out = HandleConfig("save", name .. ".json", cfg)
  410.  
  411. if known_returns[out] and not silent then
  412. local good = out:find("Successfully")
  413.  
  414. if not good then
  415. FM:Print("[CONFIG] Failed to save ^3" .. current_config .. "^7: ^1" .. out .. "^7")
  416.  
  417. return FM:AddNotification("ERROR", "Failed to save config. See console for details.")
  418. elseif silent == false then
  419. FM:Print("[CONFIG] Saved config ^3" .. current_config .. "^7.")
  420. end
  421. end
  422. end,
  423. Save = function(silent)
  424. if _Executor ~= "redENGINE" then return end
  425. local config = FM:CopyTable(FM.Config)
  426. config.Player.AimbotTarget = nil
  427. config.SafeMode = nil
  428. config = dict.json.encode(config)
  429. local out = HandleConfig("save", current_config .. ".json", config)
  430. FM.List[current_config] = FM.List[current_config] or (_count(FM.List) + 1)
  431.  
  432. if known_returns[out] and not silent then
  433. local good = out:find("Successfully")
  434.  
  435. if not good then
  436. FM:Print("[CONFIG] Failed to save ^3" .. current_config .. "^7: ^1" .. out .. "^7")
  437.  
  438. return FM:AddNotification("ERROR", "Failed to save config. See console for details.")
  439. elseif silent == false then
  440. FM:Print("[CONFIG] Saved config ^3" .. current_config .. "^7.")
  441. end
  442. end
  443. end
  444. }
  445.  
  446. local boundaryIdx = 1
  447.  
  448. local function dummyUseBoundary(idx)
  449. return nil
  450. end
  451.  
  452. local function getBoundaryFunc(bfn, bid)
  453. return function(fn, ...)
  454. local boundary = bid or (boundaryIdx + 1)
  455. boundaryIdx = boundaryIdx + 1
  456. bfn(boundary, coroutine.running())
  457.  
  458. local wrap = function(...)
  459. dummyUseBoundary(boundary)
  460. local v = table.pack(fn(...))
  461.  
  462. return table.unpack(v)
  463. end
  464.  
  465. local v = table.pack(wrap(...))
  466. bfn(boundary, nil)
  467.  
  468. return table.unpack(v)
  469. end
  470. end
  471.  
  472. local runWithBoundaryEnd = getBoundaryFunc(dict.Citizen.SubmitBoundaryEnd)
  473.  
  474. local function lookupify(t)
  475. local r = {}
  476.  
  477. for _, v in dict.ipairs(t) do
  478. r[v] = true
  479. end
  480.  
  481. return r
  482. end
  483.  
  484. local blocked_ranges = {{0x0001F601, 0x0001F64F}, {0x00002702, 0x000027B0}, {0x0001F680, 0x0001F6C0}, {0x000024C2, 0x0001F251}, {0x0001F300, 0x0001F5FF}, {0x00002194, 0x00002199}, {0x000023E9, 0x000023F3}, {0x000025FB, 0x000026FD}, {0x0001F300, 0x0001F5FF}, {0x0001F600, 0x0001F636}, {0x0001F681, 0x0001F6C5}, {0x0001F30D, 0x0001F567}, {0x0001F980, 0x0001F984}, {0x0001F910, 0x0001F918}, {0x0001F6E0, 0x0001F6E5}, {0x0001F920, 0x0001F927}, {0x0001F919, 0x0001F91E}, {0x0001F933, 0x0001F93A}, {0x0001F93C, 0x0001F93E}, {0x0001F985, 0x0001F98F}, {0x0001F940, 0x0001F94F}, {0x0001F950, 0x0001F95F}, {0x0001F928, 0x0001F92F}, {0x0001F9D0, 0x0001F9DF}, {0x0001F9E0, 0x0001F9E6}, {0x0001F992, 0x0001F997}, {0x0001F960, 0x0001F96B}, {0x0001F9B0, 0x0001F9B9}, {0x0001F97C, 0x0001F97F}, {0x0001F9F0, 0x0001F9FF}, {0x0001F9E7, 0x0001F9EF}, {0x0001F7E0, 0x0001F7EB}, {0x0001FA90, 0x0001FA95}, {0x0001F9A5, 0x0001F9AA}, {0x0001F9BA, 0x0001F9BF}, {0x0001F9C3, 0x0001F9CA}, {0x0001FA70, 0x0001FA73}}
  485. local block_singles = lookupify{0x000000A9, 0x000000AE, 0x0000203C, 0x00002049, 0x000020E3, 0x00002122, 0x00002139, 0x000021A9, 0x000021AA, 0x0000231A, 0x0000231B, 0x000025AA, 0x000025AB, 0x000025B6, 0x000025C0, 0x00002934, 0x00002935, 0x00002B05, 0x00002B06, 0x00002B07, 0x00002B1B, 0x00002B1C, 0x00002B50, 0x00002B55, 0x00003030, 0x0000303D, 0x00003297, 0x00003299, 0x0001F004, 0x0001F0CF, 0x0001F6F3, 0x0001F6F4, 0x0001F6E9, 0x0001F6F0, 0x0001F6CE, 0x0001F6CD, 0x0001F6CF, 0x0001F6CB, 0x00023F8, 0x00023F9, 0x00023FA, 0x0000023, 0x0001F51F, 0x0001F6CC, 0x0001F9C0, 0x0001F6EB, 0x0001F6EC, 0x0001F6D0, 0x00023CF, 0x000002A, 0x0002328, 0x0001F5A4, 0x0001F471, 0x0001F64D, 0x0001F64E, 0x0001F645, 0x0001F646, 0x0001F681, 0x0001F64B, 0x0001F647, 0x0001F46E, 0x0001F575, 0x0001F582, 0x0001F477, 0x0001F473, 0x0001F930, 0x0001F486, 0x0001F487, 0x0001F6B6, 0x0001F3C3, 0x0001F57A, 0x0001F46F, 0x0001F3CC, 0x0001F3C4, 0x0001F6A3, 0x0001F3CA, 0x00026F9, 0x0001F3CB, 0x0001F6B5, 0x0001F6B5, 0x0001F468, 0x0001F469, 0x0001F990, 0x0001F991, 0x0001F6F5, 0x0001F6F4, 0x0001F6D1, 0x0001F6F6, 0x0001F6D2, 0x0002640, 0x0002642, 0x0002695, 0x0001F3F3, 0x0001F1FA, 0x0001F91F, 0x0001F932, 0x0001F931, 0x0001F9F8, 0x0001F9F7, 0x0001F3F4, 0x0001F970, 0x0001F973, 0x0001F974, 0x0001F97A, 0x0001F975, 0x0001F976, 0x0001F9B5, 0x0001F9B6, 0x0001F468, 0x0001F469, 0x0001F99D, 0x0001F999, 0x0001F99B, 0x0001F998, 0x0001F9A1, 0x0001F99A, 0x0001F99C, 0x0001F9A2, 0x0001F9A0, 0x0001F99F, 0x0001F96D, 0x0001F96C, 0x0001F96F, 0x0001F9C2, 0x0001F96E, 0x0001F99E, 0x0001F9C1, 0x0001F6F9, 0x0001F94E, 0x0001F94F, 0x0001F94D, 0x0000265F, 0x0000267E, 0x0001F3F4, 0x0001F971, 0x0001F90E, 0x0001F90D, 0x0001F90F, 0x0001F9CF, 0x0001F9CD, 0x0001F9CE, 0x0001F468, 0x0001F469, 0x0001F9D1, 0x0001F91D, 0x0001F46D, 0x0001F46B, 0x0001F46C, 0x0001F9AE, 0x0001F415, 0x0001F6D5, 0x0001F6FA, 0x0001FA82, 0x0001F93F, 0x0001FA80, 0x0001FA81, 0x0001F97B, 0x0001F9AF, 0x0001FA78, 0x0001FA79, 0x0001FA7A}
  486.  
  487. function FM:RemoveEmojis(str)
  488. local new = ""
  489.  
  490. for _, codepoint in dict.utf8.codes(str) do
  491. local safe = true
  492.  
  493. if block_singles[codepoint] then
  494. safe = false
  495. else
  496. for _, range in dict.ipairs(blocked_ranges) do
  497. if range[1] <= codepoint and codepoint <= range[2] then
  498. safe = false
  499. break
  500. end
  501. end
  502. end
  503.  
  504. if safe then
  505. new = new .. dict.utf8.char(codepoint)
  506. end
  507. end
  508.  
  509. return new
  510. end
  511.  
  512. -- Used to clean player names.
  513. function FM:CleanName(str, is_esp)
  514. str = str:gsub("~", "")
  515. str = FM:RemoveEmojis(str)
  516.  
  517. if #str >= 25 and not is_esp then
  518. str = str:sub(1, 25) .. "..."
  519. end
  520.  
  521. return str
  522. end
  523.  
  524. local _natives = {
  525. ["TriggerEvent"] = {
  526. func = function(eventName, ...)
  527. if not eventName then return end
  528. local payload = msgpack.pack({...})
  529.  
  530. return runWithBoundaryEnd(function() return TriggerEventInternal(eventName, payload, payload:len()) end)
  531. end
  532. },
  533. ["TriggerServerEvent"] = {
  534. func = function(eventName, ...)
  535. if not eventName then return end
  536. local payload = msgpack.pack({...})
  537.  
  538. return TriggerServerEventInternal(eventName, payload, payload:len())
  539. end
  540. },
  541. ["DestroyCam"] = {
  542. hash = 0x865908C81A2C22E9
  543. },
  544. ["GetCurrentServerEndpoint"] = {
  545. hash = 0xEA11BFBA,
  546. unpack = function(...)
  547. local args = (...)
  548.  
  549. return args[1], dict.Citizen.ResultAsString()
  550. end
  551. },
  552. ["GetCurrentResourceName"] = {
  553. hash = 0xE5E9EBBB,
  554. unpack = function(...)
  555. local args = (...)
  556.  
  557. return args[1], dict.Citizen.ResultAsString()
  558. end
  559. },
  560. ["GetGameTimer"] = {
  561. hash = 0x9CD27B0045628463,
  562. unpack = function() return dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsInteger() end,
  563. },
  564. ["GetActivePlayers"] = {
  565. hash = 0xcf143fb9,
  566. unpack = function() return dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsObject() end,
  567. return_as = function(obj) return msgpack.unpack(obj) end
  568. },
  569. ["GetVehicleMaxNumberOfPassengers"] = {
  570. hash = 0xA7C4F2C6E744A550,
  571. unpack = function(...)
  572. local args = (...)
  573.  
  574. return args[1], dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsInteger()
  575. end
  576. },
  577. ["FindFirstVehicle"] = {
  578. hash = 0x15e55694,
  579. unpack = function(...)
  580. local args = (...)
  581.  
  582. return dict.Citizen.PointerValueIntInitialized(args[1]), dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsInteger()
  583. end
  584. },
  585. ["FindNextVehicle"] = {
  586. hash = 0x8839120d,
  587. unpack = function(...)
  588. local args = (...)
  589.  
  590. return args[1], dict.Citizen.PointerValueIntInitialized(args[2]), dict.Citizen.ReturnResultAnyway()
  591. end
  592. },
  593. ["EndFindVehicle"] = {
  594. hash = 0x9227415a,
  595. unpack = function(...)
  596. local args = (...)
  597.  
  598. return args[1]
  599. end
  600. },
  601. ["FindFirstPed"] = {
  602. hash = 0xfb012961,
  603. unpack = function(...)
  604. local args = (...)
  605.  
  606. return dict.Citizen.PointerValueIntInitialized(args[1]), dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsInteger()
  607. end
  608. },
  609. ["FindNextPed"] = {
  610. hash = 0xab09b548,
  611. unpack = function(...)
  612. local args = (...)
  613.  
  614. return args[1], dict.Citizen.PointerValueIntInitialized(args[2]), dict.Citizen.ReturnResultAnyway()
  615. end
  616. },
  617. ["EndFindPed"] = {
  618. hash = 0x9615c2ad,
  619. unpack = function(...)
  620. local args = (...)
  621.  
  622. return args[1]
  623. end
  624. },
  625. ["FindFirstObject"] = {
  626. hash = 0xFAA6CB5D,
  627. unpack = function(...)
  628. local args = (...)
  629.  
  630. return dict.Citizen.PointerValueIntInitialized(args[1]), dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsInteger()
  631. end
  632. },
  633. ["FindNextObject"] = {
  634. hash = 0x4E129DBF,
  635. unpack = function(...)
  636. local args = (...)
  637.  
  638. return args[1], dict.Citizen.PointerValueIntInitialized(args[2]), dict.Citizen.ReturnResultAnyway()
  639. end
  640. },
  641. ["EndFindObject"] = {
  642. hash = 0xDEDA4E50,
  643. unpack = function(...)
  644. local args = (...)
  645.  
  646. return args[1]
  647. end
  648. },
  649. ["GetPlayerServerId"] = {
  650. hash = 0x4d97bcc7,
  651. unpack = function(...)
  652. local args = (...)
  653.  
  654. return args[1], dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsInteger()
  655. end
  656. },
  657. ["GetNumResources"] = {
  658. hash = 0x863f27b,
  659. unpack = function() return dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsInteger() end
  660. },
  661. ["GetResourceByFindIndex"] = {
  662. hash = 0x387246b7,
  663. unpack = function(...)
  664. local args = (...)
  665.  
  666. return args[1], dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsString()
  667. end
  668. },
  669. ["LoadResourceFile"] = {
  670. func = function(...)
  671. if _Executor ~= "redENGINE" then return end
  672. local args = {...}
  673.  
  674. return dict.Citizen.IN(0xEB01A, LoadResourceFile(args[1], args[2]))
  675. end
  676. },
  677. ["RequestCollisionAtCoord"] = {
  678. hash = 0x07503F7948F491A7,
  679. unpack = function(...)
  680. local args = (...)
  681. local x, y, z
  682.  
  683. if dict.type(args[1]) == "table" or dict.type(args[1]) == "vector" then
  684. x = args[1].x
  685. y = args[1].y
  686. z = args[1].z
  687. else
  688. x = args[1]
  689. y = args[2]
  690. z = args[3]
  691. end
  692.  
  693. return x, y, z, dict.Citizen.ReturnResultAnyway()
  694. end
  695. },
  696. ["GetEntityCoords"] = {
  697. hash = 0x3FEF770D40960D5A,
  698. unpack = function(...)
  699. local args = (...)
  700.  
  701. return args[1], dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsVector()
  702. end
  703. },
  704. ["RemoveBlip"] = {
  705. hash = 0x86A652570E5F25DD,
  706. unpack = function(...)
  707. local args = (...)
  708.  
  709. return dict.Citizen.PointerValueIntInitialized(args[1])
  710. end
  711. },
  712. ["GetNuiCursorPosition"] = {
  713. hash = 0xbdba226f,
  714. unpack = function() return dict.Citizen.PointerValueInt(), dict.Citizen.PointerValueInt() end
  715. },
  716. ["DoesEntityExist"] = {
  717. hash = 0x7239B21A38F536BA,
  718. unpack = function(...)
  719. local args = (...)
  720.  
  721. return args[1], dict.Citizen.ReturnResultAnyway()
  722. end
  723. },
  724. ["IsEntityDead"] = {
  725. hash = 0x5F9532F3B5CC2551,
  726. unpack = function(...)
  727. local args = (...)
  728.  
  729. return args[1], dict.Citizen.ReturnResultAnyway()
  730. end
  731. },
  732. ["IsPedDeadOrDying"] = {
  733. hash = 0x3317DEDB88C95038,
  734. unpack = function(...)
  735. local args = (...)
  736.  
  737. return args[1], args[2], dict.Citizen.ReturnResultAnyway()
  738. end
  739. },
  740. ["IsPedShooting"] = {
  741. hash = 0x34616828CD07F1A1,
  742. unpack = function(...)
  743. local args = (...)
  744.  
  745. return args[1], dict.Citizen.ReturnResultAnyway()
  746. end
  747. },
  748. ["PlaySoundFrontend"] = {
  749. hash = 0x67C540AA08E4A6F5,
  750. unpack = function(...)
  751. local args = (...)
  752.  
  753. return args[1], args[2], args[3], args[4]
  754. end
  755. },
  756. ["GetPedInVehicleSeat"] = {
  757. hash = 0xBB40DD2270B65366,
  758. unpack = function(...)
  759. local args = (...)
  760.  
  761. return args[1], args[2], dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsInteger()
  762. end
  763. },
  764. ["HasAnimDictLoaded"] = {
  765. hash = 0xD031A9162D01088C,
  766. unpack = function(...)
  767. local args = (...)
  768.  
  769. return args[1], dict.Citizen.ReturnResultAnyway()
  770. end
  771. },
  772. ["CreatePed"] = {
  773. hash = 0xD49F9B0955C367DE,
  774. unpack = function(...)
  775. local args = (...)
  776.  
  777. return args[1], dict.type(args[2]) == "string" and FM:GetFunction("GetHashKey")(args[2]) or args[2], args[3], args[4], args[5], args[6], args[7], args[8], dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsInteger()
  778. end
  779. },
  780. ["CreatePedInsideVehicle"] = {
  781. hash = 0x7DD959874C1FD534,
  782. unpack = function(...)
  783. local args = (...)
  784.  
  785. return args[1], args[2], dict.type(args[3]) == "string" and FM:GetFunction("GetHashKey")(args[3]) or args[3], args[4], args[5], args[6], dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsInteger()
  786. end
  787. },
  788. ["NetworkHasControlOfEntity"] = {
  789. hash = 0x01BF60A500E28887,
  790. unpack = function(...)
  791. local args = (...)
  792.  
  793. return args[1], dict.Citizen.ReturnResultAnyway()
  794. end
  795. },
  796. ["SimulatePlayerInputGait"] = {
  797. hash = 0x477D5D63E63ECA5D
  798. },
  799. ["ResetPedRagdollTimer"] = {
  800. hash = 0x9FA4664CF62E47E8
  801. },
  802. ["IsVehicleDamaged"] = {
  803. hash = 0xBCDC5017D3CE1E9E,
  804. unpack = function(...)
  805. local args = (...)
  806.  
  807. return args[1], dict.Citizen.ReturnResultAnyway()
  808. end
  809. },
  810. ["ToggleVehicleMod"] = {
  811. hash = 0x2A1F4F37F95BAD08
  812. },
  813. ["NetworkGetPlayerIndexFromPed"] = {
  814. hash = 0x6C0E2E0125610278,
  815. unpack = function(...)
  816. local args = (...)
  817.  
  818. return args[1], dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsInteger()
  819. end
  820. },
  821. ["ResetPlayerStamina"] = {
  822. hash = 0xA6F312FCCE9C1DFE
  823. },
  824. ["GetEntityAlpha"] = {
  825. hash = 0x5A47B3B5E63E94C6,
  826. unpack = function(...)
  827. local args = (...)
  828.  
  829. return args[1], dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsInteger()
  830. end
  831. },
  832. ["IsEntityVisible"] = {
  833. hash = 0x47D6F43D77935C75,
  834. unpack = function(...)
  835. local args = (...)
  836.  
  837. return args[1], dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsInteger()
  838. end,
  839. return_as = function(int) return int == 1 end
  840. },
  841. ["AreAnyVehicleSeatsFree"] = {
  842. hash = 0x2D34FC3BC4ADB780,
  843. unpack = function(...)
  844. local args = (...)
  845.  
  846. return args[1], dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsInteger()
  847. end,
  848. return_as = function(int) return int == 1 end
  849. },
  850. ["IsEntityVisibleToScript"] = {
  851. hash = 0xD796CB5BA8F20E32,
  852. unpack = function(...)
  853. local args = (...)
  854.  
  855. return args[1], dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsInteger()
  856. end,
  857. return_as = function(int) return int == 1 end
  858. },
  859. ["NetworkExplodeVehicle"] = {
  860. hash = 0x301A42153C9AD707
  861. },
  862. ["DisplayRadar"] = {
  863. hash = 0xA0EBB943C300E693
  864. },
  865. ["SetCursorLocation"] = {
  866. hash = 0xFC695459D4D0E219
  867. },
  868. ["SetPlayerWeaponDamageModifier"] = {
  869. hash = 0xCE07B9F7817AADA3
  870. },
  871. ["SetPedArmour"] = {
  872. hash = 0xCEA04D83135264CC
  873. },
  874. ["SetEntityLocallyInvisible"] = {
  875. hash = 0xE135A9FF3F5D05D8
  876. },
  877. ["SetVehicleDoorsLockedForPlayer"] = {
  878. hash = 0x517AAF684BB50CD1
  879. },
  880. ["SetVehicleDoorsLockedForAllPlayers"] = {
  881. hash = 0xA2F80B8D040727CC
  882. },
  883. ["SetVehicleDoorsLocked"] = {
  884. hash = 0xB664292EAECF7FA6
  885. },
  886. ["SetVehicleTyresCanBurst"] = {
  887. hash = 0xEB9DC3C7D8596C46
  888. },
  889. ["SetVehicleMod"] = {
  890. hash = 0x6AF0636DDEDCB6DD
  891. },
  892. ["SetPedCoordsKeepVehicle"] = {
  893. hash = 0x9AFEFF481A85AB2E
  894. },
  895. ["SetVehicleEnginePowerMultiplier"] = {
  896. hash = 0x93A3996368C94158
  897. },
  898. ["GetFirstBlipInfoId"] = {
  899. hash = 0x1BEDE233E6CD2A1F,
  900. unpack = function(...)
  901. local args = (...)
  902.  
  903. return args[1], dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsInteger()
  904. end
  905. },
  906. ["GetGroundZFor_3dCoord"] = {
  907. hash = 0xC906A7DAB05C8D2B,
  908. unpack = function(...)
  909. local args = (...)
  910.  
  911. return args[1], args[2], args[3], dict.Citizen.PointerValueFloat(), dict.Citizen.ReturnResultAnyway()
  912. end
  913. },
  914. ["GetBlipInfoIdCoord"] = {
  915. hash = 0xFA7C7F0AADF25D09,
  916. unpack = function(...)
  917. local args = (...)
  918.  
  919. return args[1], dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsVector()
  920. end
  921. },
  922. ["GetNumVehicleMods"] = {
  923. hash = 0xE38E9162A2500646,
  924. unpack = function(...)
  925. local args = (...)
  926.  
  927. return args[1], args[2], dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsInteger()
  928. end
  929. },
  930. ["SetVehicleModKit"] = {
  931. hash = 0x1F2AA07F00B3217A
  932. },
  933. ["SetPedToRagdoll"] = {
  934. hash = 0xAE99FB955581844A
  935. },
  936. ["SetVehicleFixed"] = {
  937. hash = 0x115722B1B9C14C1C
  938. },
  939. ["SetPedKeepTask"] = {
  940. hash = 0x971D38760FBC02EF
  941. },
  942. ["NetworkGetNetworkIdFromEntity"] = {
  943. hash = 0xA11700682F3AD45C,
  944. unpack = function(...)
  945. local args = (...)
  946.  
  947. return args[1], dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsInteger()
  948. end
  949. },
  950. ["RemoveWeaponFromPed"] = {
  951. hash = 0x4899CB088EDF59B8
  952. },
  953. ["SetNetworkIdSyncToPlayer"] = {
  954. hash = 0xA8A024587329F36A
  955. },
  956. ["SetNetworkIdCanMigrate"] = {
  957. hash = 0x299EEB23175895FC
  958. },
  959. ["DoesCamExist"] = {
  960. hash = 0xA7A932170592B50E
  961. },
  962. ["CreateCam"] = {
  963. hash = 0xC3981DCE61D9E13F
  964. },
  965. ["GetGameplayCamRot"] = {
  966. hash = 0x837765A25378F0BB,
  967. unpack = function(...)
  968. local args = (...)
  969.  
  970. return args[1], dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsVector()
  971. end
  972. },
  973. ["GetCamRot"] = {
  974. hash = 0x7D304C1C955E3E12,
  975. unpack = function(...)
  976. local args = (...)
  977.  
  978. return args[1], dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsVector()
  979. end
  980. },
  981. ["StartShapeTestRay"] = {
  982. hash = 0x377906D8A31E5586,
  983. unpack = function(...)
  984. local args = (...)
  985.  
  986. return args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsInteger()
  987. end
  988. },
  989. ["GetShapeTestResult"] = {
  990. hash = 0x3D87450E15D98694,
  991. unpack = function(...)
  992. local args = (...)
  993.  
  994. return args[1], dict.Citizen.PointerValueInt(), dict.Citizen.PointerValueVector(), dict.Citizen.PointerValueVector(), dict.Citizen.PointerValueInt(), dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsInteger()
  995. end,
  996. return_as = function(...)
  997. local ret = {...}
  998.  
  999. return ret[1], ret[2] == 1, ret[3], ret[4], ret[5]
  1000. end
  1001. },
  1002. ["AddExplosion"] = {
  1003. hash = 0xE3AD2BDBAEE269AC
  1004. },
  1005. ["CreateVehicle"] = {
  1006. hash = 0xAF35D0D2583051B0,
  1007. unpack = function(...)
  1008. local args = (...)
  1009.  
  1010. return dict.type(args[1]) == "string" and FM:GetFunction("GetHashKey")(args[1]) or args[1], args[2], args[3], args[4], args[5], args[6], args[7], dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsInteger()
  1011. end
  1012. },
  1013. ["SetPedIntoVehicle"] = {
  1014. hash = 0xF75B0D629E1C063D
  1015. },
  1016. ["SetPedAlertness"] = {
  1017. hash = 0xDBA71115ED9941A6
  1018. },
  1019. ["TaskVehicleDriveWander"] = {
  1020. hash = 0x480142959D337D00
  1021. },
  1022. ["CreateObject"] = {
  1023. hash = 0x509D5878EB39E842,
  1024. unpack = function(...)
  1025. local args = (...)
  1026.  
  1027. return dict.type(args[1]) == "string" and FM:GetFunction("GetHashKey")(args[1]) or args[1], args[2], args[3], args[4], args[5], args[6], dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsInteger()
  1028. end
  1029. },
  1030. ["DeletePed"] = {
  1031. hash = 0x9614299DCB53E54B,
  1032. unpack = function(...)
  1033. local args = (...)
  1034.  
  1035. return dict.Citizen.PointerValueIntInitialized(args[1])
  1036. end
  1037. },
  1038. ["DeleteEntity"] = {
  1039. hash = 0xAE3CBE5BF394C9C9,
  1040. unpack = function(...)
  1041. local args = (...)
  1042.  
  1043. return dict.Citizen.PointerValueIntInitialized(args[1])
  1044. end
  1045. },
  1046. ["DeleteObject"] = {
  1047. hash = 0x539E0AE3E6634B9F,
  1048. unpack = function(...)
  1049. local args = (...)
  1050.  
  1051. return dict.Citizen.PointerValueIntInitialized(args[1])
  1052. end
  1053. },
  1054. ["DeleteVehicle"] = {
  1055. hash = 0xEA386986E786A54F,
  1056. unpack = function(...)
  1057. local args = (...)
  1058.  
  1059. return dict.Citizen.PointerValueIntInitialized(args[1])
  1060. end
  1061. },
  1062. ["NetworkRequestControlOfEntity"] = {
  1063. hash = 0xB69317BF5E782347,
  1064. unpack = function(...)
  1065. local args = (...)
  1066.  
  1067. return args[1], dict.Citizen.ReturnResultAnyway()
  1068. end
  1069. },
  1070. ["GetModelDimensions"] = {
  1071. hash = 0x03E8D3D5F549087A,
  1072. unpack = function(...)
  1073. local args = (...)
  1074.  
  1075. return dict.type(args[1]) == "string" and FM:GetFunction("GetHashKey")(args[1]) or args[1], dict.Citizen.PointerValueVector(), dict.Citizen.PointerValueVector()
  1076. end
  1077. },
  1078. ["GetEntityModel"] = {
  1079. hash = 0x9F47B058362C84B5,
  1080. unpack = function(...)
  1081. local args = (...)
  1082.  
  1083. return args[1], dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsInteger()
  1084. end
  1085. },
  1086. ["SetEntityAsMissionEntity"] = {
  1087. hash = 0xAD738C3085FE7E11
  1088. },
  1089. ["SetEntityRotation"] = {
  1090. hash = 0x8524A8B0171D5E07
  1091. },
  1092. ["SetEntityLocallyVisible"] = {
  1093. hash = 0x241E289B5C059EDC
  1094. },
  1095. ["SetEntityAlpha"] = {
  1096. hash = 0x44A0870B7E92D7C0
  1097. },
  1098. ["SetEntityCollision"] = {
  1099. hash = 0x1A9205C1B9EE827F
  1100. },
  1101. ["SetEntityCoords"] = {
  1102. hash = 0x06843DA7060A026B
  1103. },
  1104. ["GivePlayerRagdollControl"] = {
  1105. hash = 0x3C49C870E66F0A28
  1106. },
  1107. ["GetHashKey"] = {
  1108. hash = 0xD24D37CC275948CC,
  1109. unpack = function(...)
  1110. local args = (...)
  1111.  
  1112. return dict.tostring(args[1]), dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsInteger()
  1113. end
  1114. },
  1115. ["GetVehiclePedIsIn"] = {
  1116. hash = 0x9A9112A0FE9A4713
  1117. },
  1118. ["PlayerPedId"] = {
  1119. hash = 0xD80958FC74E988A6,
  1120. unpack = function() return dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsInteger() end
  1121. },
  1122. ["GetPlayerPed"] = {
  1123. hash = 0x43A66C31C68491C0
  1124. },
  1125. ["HasModelLoaded"] = {
  1126. hash = 0x98A4EB5D89A0C952,
  1127. unpack = function(...)
  1128. local args = (...)
  1129.  
  1130. return dict.type(args[1]) == "string" and FM:GetFunction("GetHashKey")(args[1]) or args[1], dict.Citizen.ReturnResultAnyway()
  1131. end
  1132. },
  1133. ["SetPedCanRagdoll"] = {
  1134. hash = 0xB128377056A54E2A
  1135. },
  1136. ["RequestModel"] = {
  1137. hash = 0x963D27A58DF860AC,
  1138. unpack = function(...)
  1139. local args = (...)
  1140.  
  1141. return dict.type(args[1]) == "string" and FM:GetFunction("GetHashKey")(args[1]) or args[1]
  1142. end
  1143. },
  1144. ["SetTextFont"] = {
  1145. hash = 0x66E0276CC5F6B9DA
  1146. },
  1147. ["SetTextProportional"] = {
  1148. hash = 0x038C1F517D7FDCF8
  1149. },
  1150. ["HasStreamedTextureDictLoaded"] = {
  1151. hash = 0x0145F696AAAAD2E4
  1152. },
  1153. ["RequestStreamedTextureDict"] = {
  1154. hash = 0xDFA2EF8E04127DD5
  1155. },
  1156. ["GetActiveScreenResolution"] = {
  1157. hash = 0x873C9F3104101DD3,
  1158. unpack = function() return dict.Citizen.PointerValueInt(), dict.Citizen.PointerValueInt() end
  1159. },
  1160. ["IsDisabledControlJustPressed"] = {
  1161. hash = 0x91AEF906BCA88877,
  1162. unpack = function(...)
  1163. local args = (...)
  1164.  
  1165. return args[1], args[2], dict.Citizen.ReturnResultAnyway()
  1166. end
  1167. },
  1168. ["IsDisabledControlJustReleased"] = {
  1169. hash = 0x305C8DCD79DA8B0F,
  1170. unpack = function(...)
  1171. local args = (...)
  1172.  
  1173. return args[1], args[2], dict.Citizen.ReturnResultAnyway()
  1174. end
  1175. },
  1176. ["IsDisabledControlPressed"] = {
  1177. hash = 0xE2587F8CBBD87B1D,
  1178. unpack = function(...)
  1179. local args = (...)
  1180.  
  1181. return args[1], args[2], dict.Citizen.ReturnResultAnyway()
  1182. end
  1183. },
  1184. ["IsDisabledControlReleased"] = {
  1185. hash = 0xFB6C4072E9A32E92,
  1186. unpack = function(...)
  1187. local args = (...)
  1188.  
  1189. return args[1], args[2], dict.Citizen.ReturnResultAnyway()
  1190. end
  1191. },
  1192. ["IsControlJustPressed"] = {
  1193. hash = 0x580417101DDB492F,
  1194. unpack = function(...)
  1195. local args = (...)
  1196.  
  1197. return args[1], args[2], dict.Citizen.ReturnResultAnyway()
  1198. end
  1199. },
  1200. ["IsControlJustReleased"] = {
  1201. hash = 0x50F940259D3841E6,
  1202. unpack = function(...)
  1203. local args = (...)
  1204.  
  1205. return args[1], args[2], dict.Citizen.ReturnResultAnyway()
  1206. end
  1207. },
  1208. ["IsControlPressed"] = {
  1209. hash = 0xF3A21BCD95725A4A,
  1210. unpack = function(...)
  1211. local args = (...)
  1212.  
  1213. return args[1], args[2], dict.Citizen.ReturnResultAnyway()
  1214. end
  1215. },
  1216. ["IsControlReleased"] = {
  1217. hash = 0x648EE3E7F38877DD,
  1218. unpack = function(...)
  1219. local args = (...)
  1220.  
  1221. return args[1], args[2], dict.Citizen.ReturnResultAnyway()
  1222. end
  1223. },
  1224. ["ClearPedTasks"] = {
  1225. hash = 0xE1EF3C1216AFF2CD
  1226. },
  1227. ["ClearPedTasksImmediately"] = {
  1228. hash = 0xAAA34F8A7CB32098
  1229. },
  1230. ["ClearPedSecondaryTask"] = {
  1231. hash = 0x176CECF6F920D707
  1232. },
  1233. ["SetEntityProofs"] = {
  1234. hash = 0xFAEE099C6F890BB8
  1235. },
  1236. ["SetCamActive"] = {
  1237. hash = 0x026FB97D0A425F84
  1238. },
  1239. ["RenderScriptCams"] = {
  1240. hash = 0x07E5B515DB0636FC,
  1241. unpack = function(...)
  1242. local args = (...)
  1243.  
  1244. return args[1], args[2], args[3], args[4], args[5]
  1245. end
  1246. },
  1247. ["GetEntityForwardVector"] = {
  1248. hash = 0x0A794A5A57F8DF91,
  1249. unpack = function(...)
  1250. local args = (...)
  1251.  
  1252. return args[1], dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsVector()
  1253. end
  1254. },
  1255. ["RequestAnimDict"] = {
  1256. hash = 0xD3BD40951412FEF6
  1257. },
  1258. ["SetTextScale"] = {
  1259. hash = 0x07C837F9A01C34C9
  1260. },
  1261. ["SetTextColour"] = {
  1262. hash = 0xBE6B23FFA53FB442
  1263. },
  1264. ["SetTextDropShadow"] = {
  1265. hash = 0x465C84BC39F1C351
  1266. },
  1267. ["SetTextEdge"] = {
  1268. hash = 0x441603240D202FA6
  1269. },
  1270. ["SetTextOutline"] = {
  1271. hash = 0x2513DFB0FB8400FE
  1272. },
  1273. ["ClearPedBloodDamage"] = {
  1274. hash = 0x8FE22675A5A45817
  1275. },
  1276. ["SetEntityHealth"] = {
  1277. hash = 0x6B76DC1F3AE6E6A3
  1278. },
  1279. ["NetworkResurrectLocalPlayer"] = {
  1280. hash = 0xEA23C49EAA83ACFB
  1281. },
  1282. ["SetTextCentre"] = {
  1283. hash = 0xC02F4DBFB51D988B
  1284. },
  1285. ["BeginTextCommandDisplayText"] = {
  1286. hash = 0x25FBB336DF1804CB
  1287. },
  1288. ["BeginTextCommandWidth"] = {
  1289. hash = 0x54CE8AC98E120CAB
  1290. },
  1291. ["EndTextCommandGetWidth"] = {
  1292. hash = 0x85F061DA64ED2F67,
  1293. unpack = function(...)
  1294. local args = (...)
  1295.  
  1296. return args[1], dict.Citizen.ResultAsFloat()
  1297. end
  1298. },
  1299. ["GetTextScaleHeight"] = {
  1300. hash = 0xDB88A37483346780,
  1301. unpack = function(...)
  1302. local args = (...)
  1303.  
  1304. return args[1], args[2], dict.Citizen.ResultAsFloat()
  1305. end
  1306. },
  1307. ["DrawSprite"] = {
  1308. hash = 0xE7FFAE5EBF23D890
  1309. },
  1310. ["FreezeEntityPosition"] = {
  1311. hash = 0x428CA6DBD1094446
  1312. },
  1313. ["GetPedBoneIndex"] = {
  1314. hash = 0x3F428D08BE5AAE31,
  1315. unpack = function(...)
  1316. local args = (...)
  1317.  
  1318. return args[1], args[2], dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsInteger()
  1319. end
  1320. },
  1321. ["GetPedBoneCoords"] = {
  1322. hash = 0x17C07FC640E86B4E,
  1323. unpack = function(...)
  1324. local args = (...)
  1325.  
  1326. return args[1], args[2], args[3], args[4], args[5], dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsVector()
  1327. end
  1328. },
  1329. ["SetPedShootsAtCoord"] = {
  1330. hash = 0x96A05E4FB321B1BA
  1331. },
  1332. ["GetEntityBoneIndexByName"] = {
  1333. hash = 0xFB71170B7E76ACBA,
  1334. unpack = function(...)
  1335. local args = (...)
  1336.  
  1337. return args[1], dict.tostring(args[2]), dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsInteger()
  1338. end
  1339. },
  1340. ["GetOffsetFromEntityInWorldCoords"] = {
  1341. hash = 0x1899F328B0E12848,
  1342. unpack = function(...)
  1343. local args = (...)
  1344. local x, y, z
  1345.  
  1346. if dict.type(args[2]) == "table" or dict.type(args[2]) == "vector" then
  1347. x = args[2].x
  1348. y = args[2].y
  1349. z = args[2].z
  1350. else
  1351. x = args[2]
  1352. y = args[3]
  1353. z = args[4]
  1354. end
  1355.  
  1356. return args[1], x, y, z, dict.Citizen.ResultAsVector()
  1357. end
  1358. },
  1359. ["AddTextComponentSubstringPlayerName"] = {
  1360. hash = 0x6C188BE134E074AA
  1361. },
  1362. ["EndTextCommandDisplayText"] = {
  1363. hash = 0xCD015E5BB0D96A57
  1364. },
  1365. ["IsPedInAnyVehicle"] = {
  1366. hash = 0x997ABD671D25CA0B
  1367. },
  1368. ["GetEntityHeading"] = {
  1369. hash = 0xE83D4F9BA2A38914,
  1370. unpack = function(...)
  1371. local args = (...)
  1372.  
  1373. return args[1], dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsFloat()
  1374. end
  1375. },
  1376. ["AddBlipForCoord"] = {
  1377. hash = 0x5A039BB0BCA604B6
  1378. },
  1379. ["SetBlipSprite"] = {
  1380. hash = 0xDF735600A4696DAF
  1381. },
  1382. ["SetBlipColour"] = {
  1383. hash = 0x03D7FB09E75D6B7E
  1384. },
  1385. ["SetBlipScale"] = {
  1386. hash = 0xD38744167B2FA257
  1387. },
  1388. ["SetBlipCoords"] = {
  1389. hash = 0xAE2AF67E9D9AF65D
  1390. },
  1391. ["SetBlipRotation"] = {
  1392. hash = 0xF87683CDF73C3F6E
  1393. },
  1394. ["ShowHeadingIndicatorOnBlip"] = {
  1395. hash = 0x5FBCA48327B914DF
  1396. },
  1397. ["SetBlipCategory"] = {
  1398. hash = 0x234CDD44D996FD9A
  1399. },
  1400. ["BeginTextCommandSetBlipName"] = {
  1401. hash = 0xF9113A30DE5C6670
  1402. },
  1403. ["GetPlayerName"] = {
  1404. hash = 0x6D0DE6A7B5DA71F8,
  1405. unpack = function(...)
  1406. local args = (...)
  1407.  
  1408. return args[1], dict.Citizen.ResultAsString()
  1409. end
  1410. },
  1411. ["EndTextCommandSetBlipName"] = {
  1412. hash = 0xBC38B49BCB83BC9B
  1413. },
  1414. ["DrawRect"] = {
  1415. hash = 0x3A618A217E5154F0
  1416. },
  1417. ["IsEntityInAir"] = {
  1418. hash = 0x886E37EC497200B6
  1419. },
  1420. ["DisableAllControlActions"] = {
  1421. hash = 0x5F4B6931816E599B
  1422. },
  1423. ["TaskWanderStandard"] = {
  1424. hash = 0xBB9CE077274F6A1B
  1425. },
  1426. ["TaskWarpPedIntoVehicle"] = {
  1427. hash = 0x9A7D091411C5F684
  1428. },
  1429. ["SetMouseCursorActiveThisFrame"] = {
  1430. hash = 0xAAE7CE1D63167423
  1431. },
  1432. ["SetMouseCursorSprite"] = {
  1433. hash = 0x8DB8CFFD58B62552
  1434. },
  1435. ["GiveDelayedWeaponToPed"] = {
  1436. hash = 0xB282DC6EBD803C75
  1437. },
  1438. ["ApplyForceToEntity"] = {
  1439. hash = 0xC5F68BE9613E2D18
  1440. },
  1441. ["GetScreenCoordFromWorldCoord"] = {
  1442. hash = 0x34E82F05DF2974F5,
  1443. unpack = function(...)
  1444. local args = (...)
  1445. local x, y, z
  1446.  
  1447. if dict.type(args[1]) == "table" or dict.type(args[1]) == "vector" then
  1448. x = args[1].x
  1449. y = args[1].y
  1450. z = args[1].z
  1451. else
  1452. x = args[1]
  1453. y = args[2]
  1454. z = args[3]
  1455. end
  1456.  
  1457. return x, y, z, dict.Citizen.PointerValueFloat(), dict.Citizen.PointerValueFloat(), dict.Citizen.ReturnResultAnyway()
  1458. end
  1459. },
  1460. ["NetworkIsPlayerTalking"] = {
  1461. hash = 0x031E11F3D447647E,
  1462. unpack = function(...)
  1463. local args = (...)
  1464.  
  1465. return args[1], dict.Citizen.ReturnResultAnyway()
  1466. end
  1467. },
  1468. ["SetDrawOrigin"] = {
  1469. hash = 0xAA0008F3BBB8F416
  1470. },
  1471. ["ClearDrawOrigin"] = {
  1472. hash = 0xFF0B610F6BE0D7AF
  1473. },
  1474. ["GetRenderingCam"] = {
  1475. hash = 0x5234F9F10919EABA,
  1476. unpack = function() return dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsInteger() end
  1477. },
  1478. ["GetGameplayCamCoord"] = {
  1479. hash = 0x14D6F5678D8F1B37,
  1480. unpack = function() return dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsVector() end
  1481. },
  1482. ["GetFinalRenderedCamCoord"] = {
  1483. hash = 0xA200EB1EE790F448,
  1484. unpack = function() return dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsVector() end
  1485. },
  1486. ["GetGameplayCamFov"] = {
  1487. hash = 0x65019750A0324133,
  1488. unpack = function() return dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsFloat() end
  1489. },
  1490. ["ObjToNet"] = {
  1491. hash = 0x99BFDC94A603E541,
  1492. unpack = function(...)
  1493. local args = (...)
  1494.  
  1495. return args[1], dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsInteger()
  1496. end
  1497. },
  1498. ["StatSetInt"] = {
  1499. hash = 0xB3271D7AB655B441,
  1500. unpack = function(...)
  1501. local args = (...)
  1502.  
  1503. return dict.type(args[1]) == "string" and FM:GetFunction("GetHashKey")(args[1]) or args[1], args[2], args[3], dict.Citizen.ReturnResultAnyway()
  1504. end
  1505. },
  1506. ["NetworkSetNetworkIdDynamic"] = {
  1507. hash = 0x2B1813ABA29016C5
  1508. },
  1509. ["SetNetworkIdExistsOnAllMachines"] = {
  1510. hash = 0xE05E81A888FA63C8
  1511. },
  1512. ["GetDistanceBetweenCoords"] = {
  1513. hash = 0xF1B760881820C952,
  1514. unpack = function(...)
  1515. local args = (...)
  1516.  
  1517. return args[1], args[2], args[3], args[4], args[5], args[6], args[7], dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsFloat()
  1518. end
  1519. },
  1520. ["SetEntityHeading"] = {
  1521. hash = 0x8E2530AA8ADA980E
  1522. },
  1523. ["HasScaleformMovieLoaded"] = {
  1524. hash = 0x85F01B8D5B90570E,
  1525. unpack = function(...)
  1526. local args = (...)
  1527.  
  1528. return args[1], dict.Citizen.ReturnResultAnyway()
  1529. end
  1530. },
  1531. ["RequestScaleformMovie"] = {
  1532. hash = 0x11FE353CF9733E6F,
  1533. unpack = function(...)
  1534. local args = (...)
  1535.  
  1536. return dict.tostring(args[1]), dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsInteger()
  1537. end
  1538. },
  1539. ["BeginScaleformMovieMethod"] = {
  1540. hash = 0xF6E48914C7A8694E
  1541. },
  1542. ["EndScaleformMovieMethodReturnValue"] = {
  1543. hash = 0xC50AA39A577AF886,
  1544. unpack = function() return dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsInteger() end
  1545. },
  1546. ["ScaleformMovieMethodAddParamInt"] = {
  1547. hash = 0xC3D0841A0CC546A6
  1548. },
  1549. ["ScaleformMovieMethodAddParamTextureNameString"] = {
  1550. hash = 0xBA7148484BD90365
  1551. },
  1552. ["DisableControlAction"] = {
  1553. hash = 0xFE99B66D079CF6BC
  1554. },
  1555. ["PlayerId"] = {
  1556. hash = 0x4F8644AF03D0E0D6,
  1557. unpack = function() return dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsInteger() end
  1558. },
  1559. ["ShootSingleBulletBetweenCoords"] = {
  1560. hash = 0x867654CBC7606F2C,
  1561. unpack = function(...)
  1562. local args = (...)
  1563.  
  1564. return args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], dict.type(args[9]) == "string" and FM:GetFunction("GetHashKey")(args[9]) or args[9], args[10], args[11], args[12], args[13]
  1565. end
  1566. },
  1567. ["ClearAreaOfProjectiles"] = {
  1568. hash = 0x0A1CB9094635D1A6
  1569. },
  1570. ["GetPedLastWeaponImpactCoord"] = {
  1571. hash = 0x6C4D0409BA1A2BC2,
  1572. unpack = function(...)
  1573. local args = (...)
  1574.  
  1575. return args[1], dict.Citizen.PointerValueVector(), dict.Citizen.ReturnResultAnyway()
  1576. end
  1577. },
  1578. ["SetExplosiveMeleeThisFrame"] = {
  1579. hash = 0xFF1BED81BFDC0FE0
  1580. },
  1581. ["GetCurrentPedWeaponEntityIndex"] = {
  1582. hash = 0x3B390A939AF0B5FC,
  1583. unpack = function(...)
  1584. local args = (...)
  1585.  
  1586. return args[1], dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsInteger()
  1587. end
  1588. },
  1589. ["GetSelectedPedWeapon"] = {
  1590. hash = 0x0A6DB4965674D243,
  1591. unpack = function(...)
  1592. local args = (...)
  1593.  
  1594. return args[1], dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsInteger()
  1595. end
  1596. },
  1597. ["PedSkipNextReloading"] = {
  1598. hash = 0x8C0D57EA686FAD87
  1599. },
  1600. ["GetMaxAmmoInClip"] = {
  1601. hash = 0xA38DCFFCEA8962FA,
  1602. unpack = function(...)
  1603. local args = (...)
  1604.  
  1605. return args[1], dict.type(args[2]) == "string" and FM:GetFunction("GetHashKey")(args[2]) or args[2], args[3], dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsInteger()
  1606. end
  1607. },
  1608. ["GetAmmoInClip"] = {
  1609. hash = 0x2E1202248937775C,
  1610. unpack = function(...)
  1611. local args = (...)
  1612.  
  1613. return args[1], dict.type(args[2]) == "string" and FM:GetFunction("GetHashKey")(args[2]) or args[2], dict.Citizen.PointerValueIntInitialized(args[3]), dict.Citizen.ReturnResultAnyway()
  1614. end
  1615. },
  1616. ["IsPlayerFreeAiming"] = {
  1617. hash = 0x2E397FD2ECD37C87,
  1618. unpack = function(...)
  1619. local args = (...)
  1620.  
  1621. return args[1], dict.Citizen.ReturnResultAnyway()
  1622. end
  1623. },
  1624. ["IsPedDoingDriveby"] = {
  1625. hash = 0xB2C086CC1BF8F2BF,
  1626. unpack = function(...)
  1627. local args = (...)
  1628.  
  1629. return args[1], dict.Citizen.ReturnResultAnyway()
  1630. end
  1631. },
  1632. ["GetEntityPlayerIsFreeAimingAt"] = {
  1633. hash = 0x2975C866E6713290,
  1634. unpack = function(...)
  1635. local args = (...)
  1636.  
  1637. return args[1], dict.Citizen.PointerValueIntInitialized(args[2]), dict.Citizen.ReturnResultAnyway()
  1638. end
  1639. },
  1640. ["IsPlayerFreeAimingAtEntity"] = {
  1641. hash = 0x3C06B5C839B38F7B,
  1642. unpack = function(...)
  1643. local args = (...)
  1644.  
  1645. return args[1], args[2], dict.Citizen.ReturnResultAnyway()
  1646. end
  1647. },
  1648. ["DisablePlayerFiring"] = {
  1649. hash = 0x5E6CC07646BBEAB8
  1650. },
  1651. ["SetFocusPosAndVel"] = {
  1652. hash = 0xBB7454BAFF08FE25
  1653. },
  1654. ["SetCamCoord"] = {
  1655. hash = 0x4D41783FB745E42E
  1656. },
  1657. ["SetCamActive"] = {
  1658. hash = 0x026FB97D0A425F84
  1659. },
  1660. ["SetCamFov"] = {
  1661. hash = 0xB13C14F66A00D047
  1662. },
  1663. ["SetCamRot"] = {
  1664. hash = 0x85973643155D0B07
  1665. },
  1666. ["SetCamShakeAmplitude"] = {
  1667. hash = 0xD93DB43B82BC0D00
  1668. },
  1669. ["UpdateOnscreenKeyboard"] = {
  1670. hash = 0x0CF2B696BBF945AE,
  1671. unpack = function() return dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsInteger() end
  1672. },
  1673. ["CancelOnscreenKeyboard"] = {
  1674. hash = 0x58A39BE597CE99CD
  1675. },
  1676. ["SetVehicleFixed"] = {
  1677. hash = 0x115722B1B9C14C1C
  1678. },
  1679. ["SetVehicleDirtLevel"] = {
  1680. hash = 0x79D3B596FE44EE8B
  1681. },
  1682. ["SetVehicleLights"] = {
  1683. hash = 0x34E710FF01247C5A
  1684. },
  1685. ["SetVehicleBurnout"] = {
  1686. hash = 0xFB8794444A7D60FB
  1687. },
  1688. ["SetVehicleLightsMode"] = {
  1689. hash = 0x1FD09E7390A74D54
  1690. },
  1691. ["GetCamMatrix"] = {
  1692. hash = 0x8f57a89d,
  1693. unpack = function(...)
  1694. local args = (...)
  1695.  
  1696. return args[1], dict.Citizen.PointerValueVector(), dict.Citizen.PointerValueVector(), dict.Citizen.PointerValueVector(), dict.Citizen.PointerValueVector()
  1697. end
  1698. },
  1699. ["DoesEntityHaveDrawable"] = {
  1700. hash = 0x060D6E96F8B8E48D,
  1701. unpack = function(...)
  1702. local args = (...)
  1703.  
  1704. return args[1], dict.Citizen.ReturnResultAnyway()
  1705. end
  1706. },
  1707. ["IsEntityAnObject"] = {
  1708. hash = 0x8D68C8FD0FACA94E,
  1709. unpack = function(...)
  1710. local args = (...)
  1711.  
  1712. return args[1], dict.Citizen.ReturnResultAnyway()
  1713. end
  1714. },
  1715. ["IsEntityAVehicle"] = {
  1716. hash = 0x6AC7003FA6E5575E,
  1717. unpack = function(...)
  1718. local args = (...)
  1719.  
  1720. return args[1], dict.Citizen.ReturnResultAnyway()
  1721. end
  1722. },
  1723. ["SetNewWaypoint"] = {
  1724. hash = 0xFE43368D2AA4F2FC
  1725. },
  1726. ["HasEntityClearLosToEntityInFront"] = {
  1727. hash = 0x0267D00AF114F17A,
  1728. unpack = function(...)
  1729. local args = (...)
  1730.  
  1731. return args[1], args[2], dict.Citizen.ReturnResultAnyway()
  1732. end
  1733. },
  1734. ["HasEntityClearLosToEntity"] = {
  1735. hash = 0xFCDFF7B72D23A1AC,
  1736. unpack = function(...)
  1737. local args = (...)
  1738.  
  1739. return args[1], args[2], dict.Citizen.ReturnResultAnyway()
  1740. end
  1741. },
  1742. ["IsEntityAPed"] = {
  1743. hash = 0x524AC5ECEA15343E,
  1744. unpack = function(...)
  1745. local args = (...)
  1746.  
  1747. return args[1], dict.Citizen.ReturnResultAnyway()
  1748. end
  1749. },
  1750. ["GetControlInstructionalButton"] = {
  1751. hash = 0x0499D7B09FC9B407,
  1752. unpack = function(...)
  1753. local args = (...)
  1754.  
  1755. return args[1], args[2], args[3], dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsString()
  1756. end
  1757. },
  1758. ["DrawScaleformMovie"] = {
  1759. hash = 0x54972ADAF0294A93
  1760. },
  1761. ["SetFocusEntity"] = {
  1762. hash = 0x198F77705FA0931D
  1763. },
  1764. ["DrawLine"] = {
  1765. hash = 0x6B7256074AE34680
  1766. },
  1767. ["DrawPoly"] = {
  1768. hash = 0xAC26716048436851
  1769. },
  1770. ["GetEntityRotation"] = {
  1771. hash = 0xAFBD61CC738D9EB9,
  1772. unpack = function(...)
  1773. local args = (...)
  1774.  
  1775. return args[1], args[2], dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsVector()
  1776. end
  1777. },
  1778. ["TaskPlayAnim"] = {
  1779. hash = 0xEA47FE3719165B94
  1780. },
  1781. ["TaskVehicleTempAction"] = {
  1782. hash = 0xC429DCEEB339E129
  1783. },
  1784. ["AttachEntityToEntity"] = {
  1785. hash = 0x6B9BBD38AB0796DF
  1786. },
  1787. ["SetRunSprintMultiplierForPlayer"] = {
  1788. hash = 0x6DB47AA77FD94E09
  1789. },
  1790. ["SetSuperJumpThisFrame"] = {
  1791. hash = 0x57FFF03E423A4C0B
  1792. },
  1793. ["SetPedMoveRateOverride"] = {
  1794. hash = 0x085BF80FA50A39D1
  1795. },
  1796. ["DisplayOnscreenKeyboard"] = {
  1797. hash = 0x00DC833F2568DBF6
  1798. },
  1799. ["GetOnscreenKeyboardResult"] = {
  1800. hash = 0x8362B09B91893647,
  1801. unpack = function() return dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsString() end
  1802. },
  1803. ["SetEntityVisible"] = {
  1804. hash = 0xEA1C610A04DB6BBB
  1805. },
  1806. ["SetEntityInvincible"] = {
  1807. hash = 0x3882114BDE571AD4
  1808. },
  1809. ["TaskSetBlockingOfNonTemporaryEvents"] = {
  1810. hash = 0x90D2156198831D69
  1811. },
  1812. ["GiveWeaponToPed"] = {
  1813. hash = 0xBF0FD6E56C964FCB
  1814. },
  1815. ["SetPedAccuracy"] = {
  1816. hash = 0x7AEFB85C1D49DEB6
  1817. },
  1818. ["SetPedAlertness"] = {
  1819. hash = 0xDBA71115ED9941A6
  1820. },
  1821. ["TaskCombatPed"] = {
  1822. hash = 0xF166E48407BAC484
  1823. },
  1824. ["SetPlayerModel"] = {
  1825. hash = 0x00A1CADD00108836,
  1826. unpack = function(...)
  1827. local args = (...)
  1828.  
  1829. return args[1], dict.type(args[2]) == "string" and FM:GetFunction("GetHashKey")(args[2]) or args[2]
  1830. end
  1831. },
  1832. ["GetDisplayNameFromVehicleModel"] = {
  1833. hash = 0xB215AAC32D25D019,
  1834. unpack = function(...)
  1835. local args = (...)
  1836.  
  1837. return dict.type(args[1]) == "string" and FM:GetFunction("GetHashKey")(args[1]) or args[1], dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsString()
  1838. end
  1839. },
  1840. ["SetPedRandomComponentVariation"] = {
  1841. hash = 0xC8A9481A01E63C28
  1842. },
  1843. ["SetPedRandomProps"] = {
  1844. hash = 0xC44AA05345C992C6
  1845. },
  1846. ["SetVehicleEngineOn"] = {
  1847. hash = 0x2497C4717C8B881E
  1848. },
  1849. ["SetVehicleForwardSpeed"] = {
  1850. hash = 0xAB54A438726D25D5
  1851. },
  1852. ["SetVehicleCurrentRpm"] = {
  1853. hash = 0x2A01A8FC
  1854. },
  1855. ["IsModelValid"] = {
  1856. hash = 0xC0296A2EDF545E92,
  1857. unpack = function(...)
  1858. local args = (...)
  1859.  
  1860. return dict.type(args[1]) == "string" and FM:GetFunction("GetHashKey")(args[1]) or args[1], dict.Citizen.ReturnResultAnyway()
  1861. end
  1862. },
  1863. ["IsModelAVehicle"] = {
  1864. hash = 0x19AAC8F07BFEC53E,
  1865. unpack = function(...)
  1866. local args = (...)
  1867.  
  1868. return dict.type(args[1]) == "string" and FM:GetFunction("GetHashKey")(args[1]) or args[1], dict.Citizen.ReturnResultAnyway()
  1869. end
  1870. },
  1871. ["IsPedWeaponReadyToShoot"] = {
  1872. hash = 0xB80CA294F2F26749,
  1873. unpack = function(...)
  1874. local args = (...)
  1875.  
  1876. return args[1], dict.Citizen.ReturnResultAnyway()
  1877. end
  1878. },
  1879. ["SetPedComponentVariation"] = {
  1880. hash = 0x262B14F48D29DE80
  1881. },
  1882. ["GetEntityHealth"] = {
  1883. hash = 0xEEF059FAD016D209,
  1884. unpack = function(...)
  1885. local args = (...)
  1886.  
  1887. return args[1], dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsInteger()
  1888. end
  1889. },
  1890. ["GetAmmoInPedWeapon"] = {
  1891. hash = 0x015A522136D7F951,
  1892. unpack = function(...)
  1893. local args = (...)
  1894.  
  1895. return args[1], dict.type(args[2]) == "string" and FM:GetFunction("GetHashKey")(args[2]) or args[2], args[3], dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsInteger()
  1896. end
  1897. },
  1898. ["GetMaxAmmo"] = {
  1899. hash = 0xDC16122C7A20C933,
  1900. unpack = function(...)
  1901. local args = (...)
  1902.  
  1903. return args[1], dict.type(args[2]) == "string" and FM:GetFunction("GetHashKey")(args[2]) or args[2], dict.Citizen.PointerValueIntInitialized(args[3]), dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsInteger()
  1904. end
  1905. },
  1906. ["GetAmmoInPedWeapon"] = {
  1907. hash = 0x015A522136D7F951,
  1908. unpack = function(...)
  1909. local args = (...)
  1910.  
  1911. return args[1], dict.type(args[2]) == "string" and FM:GetFunction("GetHashKey")(args[2]) or args[2], args[3], dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsInteger()
  1912. end
  1913. },
  1914. ["GetPedPropIndex"] = {
  1915. hash = 0x898CC20EA75BACD8,
  1916. unpack = function(...)
  1917. local args = (...)
  1918.  
  1919. return args[1], args[2], dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsInteger()
  1920. end
  1921. },
  1922. ["GetPedPropTextureIndex"] = {
  1923. hash = 0xE131A28626F81AB2,
  1924. unpack = function(...)
  1925. local args = (...)
  1926.  
  1927. return args[1], args[2], dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsInteger()
  1928. end
  1929. },
  1930. ["GetPedDrawableVariation"] = {
  1931. hash = 0x67F3780DD425D4FC,
  1932. unpack = function(...)
  1933. local args = (...)
  1934.  
  1935. return args[1], args[2], dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsInteger()
  1936. end
  1937. },
  1938. ["GetPedTextureVariation"] = {
  1939. hash = 0x04A355E041E004E6,
  1940. unpack = function(...)
  1941. local args = (...)
  1942.  
  1943. return args[1], args[2], dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsInteger()
  1944. end
  1945. },
  1946. ["GetPedPaletteVariation"] = {
  1947. hash = 0xE3DD5F2A84B42281,
  1948. unpack = function(...)
  1949. local args = (...)
  1950.  
  1951. return args[1], args[2], dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsInteger()
  1952. end
  1953. },
  1954. ["SetPedPropIndex"] = {
  1955. hash = 0x93376B65A266EB5F
  1956. },
  1957. ["SetPedAmmo"] = {
  1958. hash = 0x14E56BC5B5DB6A19
  1959. },
  1960. ["SetAmmoInClip"] = {
  1961. hash = 0xDCD2A934D65CB497,
  1962. unpack = function(...)
  1963. local args = (...)
  1964.  
  1965. return args[1], dict.type(args[2]) == "string" and FM:GetFunction("GetHashKey")(args[2]) or args[2], args[3], dict.Citizen.ReturnResultAnyway()
  1966. end
  1967. },
  1968. ["GetDisabledControlNormal"] = {
  1969. hash = 0x11E65974A982637C,
  1970. unpack = function(...)
  1971. local args = (...)
  1972.  
  1973. return args[1], args[2], dict.Citizen.ReturnResultAnyway(), dict.Citizen.ResultAsFloat()
  1974. end
  1975. },
  1976. ["TaskLookAtEntity"] = {
  1977. hash = 0x69F4BE8C8CC4796C
  1978. },
  1979. ["PointCamAtEntity"] = {
  1980. hash = 0x5640BFF86B16E8DC
  1981. }
  1982. }
  1983.  
  1984. local _bad = {}
  1985. local _empty = function() end
  1986.  
  1987. local bad = function(...)
  1988. if not _bad[dict.tostring(...)] then
  1989. FM:Print("[NATIVE] Invalid GetFunction call: ^1" .. dict.tostring(...) .. "^7")
  1990. _bad[dict.tostring(...)] = true
  1991. end
  1992.  
  1993. return _empty
  1994. end
  1995.  
  1996. function FM:GetFunction(name)
  1997. if not _natives[name] then return bad(name) end
  1998.  
  1999. if _natives[name].func then
  2000. return _natives[name].func
  2001. elseif _natives[name].hash then
  2002. _natives[name].func = function(...)
  2003. local args = {...}
  2004. local data = _natives[name]
  2005. local hash = data.hash
  2006.  
  2007. if data.unpack then
  2008. if data.return_as then return data.return_as(dict.Citizen.IN(hash, data.unpack(args))) end
  2009.  
  2010. return dict.Citizen.IN(hash, data.unpack(args))
  2011. else
  2012. if data.return_as then return data.return_as(dict.Citizen.IN(hash, table.unpack(args))) end
  2013.  
  2014. return dict.Citizen.IN(hash, table.unpack(args))
  2015. end
  2016. end
  2017.  
  2018. return _natives[name].func
  2019. end
  2020. end
  2021.  
  2022. FM.Keys = {
  2023. ["ESC"] = 322,
  2024. ["F1"] = 288,
  2025. ["F2"] = 289,
  2026. ["F3"] = 170,
  2027. ["F5"] = 166,
  2028. ["F6"] = 167,
  2029. ["F7"] = 168,
  2030. ["F8"] = 169,
  2031. ["F9"] = 56,
  2032. ["F10"] = 57,
  2033. ["~"] = 243,
  2034. ["1"] = 157,
  2035. ["2"] = 158,
  2036. ["3"] = 160,
  2037. ["4"] = 164,
  2038. ["5"] = 165,
  2039. ["6"] = 159,
  2040. ["7"] = 161,
  2041. ["8"] = 162,
  2042. ["9"] = 163,
  2043. ["-"] = 84,
  2044. ["="] = 83,
  2045. ["BACKSPACE"] = 177,
  2046. ["TAB"] = 37,
  2047. ["Q"] = 44,
  2048. ["W"] = 32,
  2049. ["E"] = 38,
  2050. ["R"] = 45,
  2051. ["T"] = 245,
  2052. ["Y"] = 246,
  2053. ["U"] = 303,
  2054. ["P"] = 199,
  2055. ["["] = 39,
  2056. ["]"] = 40,
  2057. ["ENTER"] = 18,
  2058. ["CAPS"] = 137,
  2059. ["A"] = 34,
  2060. ["S"] = 8,
  2061. ["D"] = 9,
  2062. ["F"] = 23,
  2063. ["G"] = 47,
  2064. ["H"] = 74,
  2065. ["K"] = 311,
  2066. ["L"] = 182,
  2067. ["LEFTSHIFT"] = 21,
  2068. ["Z"] = 20,
  2069. ["X"] = 73,
  2070. ["C"] = 26,
  2071. ["V"] = 0,
  2072. ["B"] = 29,
  2073. ["N"] = 249,
  2074. ["M"] = 244,
  2075. [","] = 82,
  2076. ["."] = 81,
  2077. ["LEFTCTRL"] = 36,
  2078. ["LEFTALT"] = 19,
  2079. ["SPACE"] = 22,
  2080. ["RIGHTCTRL"] = 70,
  2081. ["HOME"] = 213,
  2082. ["PAGEUP"] = 10,
  2083. ["PAGEDOWN"] = 11,
  2084. ["DELETE"] = 178,
  2085. ["LEFT"] = 174,
  2086. ["RIGHT"] = 175,
  2087. ["UP"] = 172,
  2088. ["DOWN"] = 173,
  2089. ["NENTER"] = 201,
  2090. ["MWHEELUP"] = 15,
  2091. ["MWHEELDOWN"] = 14,
  2092. ["N4"] = 108,
  2093. ["N5"] = 60,
  2094. ["N6"] = 107,
  2095. ["N+"] = 96,
  2096. ["N-"] = 97,
  2097. ["N7"] = 117,
  2098. ["N8"] = 61,
  2099. ["N9"] = 118,
  2100. ["MOUSE1"] = 24,
  2101. ["MOUSE2"] = 25,
  2102. ["MOUSE3"] = 348
  2103. }
  2104.  
  2105. local all_weapons = {"WEAPON_UNARMED", "WEAPON_KNIFE", "WEAPON_KNUCKLE", "WEAPON_NIGHTSTICK", "WEAPON_HAMMER", "WEAPON_BAT", "WEAPON_GOLFCLUB", "WEAPON_CROWBAR", "WEAPON_BOTTLE", "WEAPON_DAGGER", "WEAPON_HATCHET", "WEAPON_MACHETE", "WEAPON_FLASHLIGHT", "WEAPON_SWITCHBLADE", "WEAPON_PISTOL", "WEAPON_PISTOL_MK2", "WEAPON_COMBATPISTOL", "WEAPON_APPISTOL", "WEAPON_PISTOL50", "WEAPON_SNSPISTOL", "WEAPON_HEAVYPISTOL", "WEAPON_VINTAGEPISTOL", "WEAPON_STUNGUN", "WEAPON_FLAREGUN", "WEAPON_MARKSMANPISTOL", "WEAPON_REVOLVER", "WEAPON_MICROSMG", "WEAPON_SMG", "WEAPON_MINISMG", "WEAPON_SMG_MK2", "WEAPON_ASSAULTSMG", "WEAPON_MG", "WEAPON_COMBATMG", "WEAPON_COMBATMG_MK2", "WEAPON_COMBATPDW", "WEAPON_GUSENBERG", "WEAPON_MACHINEPISTOL", "WEAPON_ASSAULTRIFLE", "WEAPON_ASSAULTRIFLE_MK2", "WEAPON_CARBINERIFLE", "WEAPON_CARBINERIFLE_MK2", "WEAPON_ADVANCEDRIFLE", "WEAPON_SPECIALCARBINE", "WEAPON_BULLPUPRIFLE", "WEAPON_COMPACTRIFLE", "WEAPON_PUMPSHOTGUN", "WEAPON_SAWNOFFSHOTGUN", "WEAPON_BULLPUPSHOTGUN", "WEAPON_ASSAULTSHOTGUN", "WEAPON_MUSKET", "WEAPON_HEAVYSHOTGUN", "WEAPON_DBSHOTGUN", "WEAPON_SNIPERRIFLE", "WEAPON_HEAVYSNIPER", "WEAPON_HEAVYSNIPER_MK2", "WEAPON_MARKSMANRIFLE", "WEAPON_GRENADELAUNCHER", "WEAPON_GRENADELAUNCHER_SMOKE", "WEAPON_RPG", "WEAPON_STINGER", "WEAPON_FIREWORK", "WEAPON_HOMINGLAUNCHER", "WEAPON_GRENADE", "WEAPON_STICKYBOMB", "WEAPON_PROXMINE", "WEAPON_MINIGUN", "WEAPON_RAILGUN", "WEAPON_POOLCUE", "WEAPON_BZGAS", "WEAPON_SMOKEGRENADE", "WEAPON_MOLOTOV", "WEAPON_FIREEXTINGUISHER", "WEAPON_PETROLCAN", "WEAPON_SNOWBALL", "WEAPON_FLARE", "WEAPON_BALL"}
  2106. FM.Notifications = {}
  2107.  
  2108. local function _clamp(val, min, max)
  2109. if val < min then return min end
  2110. if val > max then return max end
  2111.  
  2112. return val
  2113. end
  2114.  
  2115. function FM:EquipOutfit(data)
  2116. local ped = FM:GetFunction("PlayerPedId")()
  2117. FM:GetFunction("SetPlayerModel")(FM:GetFunction("PlayerId")(), data.model)
  2118. FM:GetFunction("SetPedPropIndex")(ped, 0, data.hat, data.hat_texture, 1)
  2119. FM:GetFunction("SetPedPropIndex")(ped, 1, data.glasses, data.glasses_texture, 1)
  2120. FM:GetFunction("SetPedPropIndex")(ped, 2, data.ear, data.ear_texture, 1)
  2121. FM:GetFunction("SetPedPropIndex")(ped, 6, data.watch, data.watch_texture, 1)
  2122. FM:GetFunction("SetPedPropIndex")(ped, 7, data.wrist, data.wrist_texture, 1)
  2123. FM:GetFunction("SetPedComponentVariation")(ped, 0, data.head.draw, data.head.texture, data.head.palette)
  2124. FM:GetFunction("SetPedComponentVariation")(ped, 1, data.beard.draw, data.beard.texture, data.beard.palette)
  2125. FM:GetFunction("SetPedComponentVariation")(ped, 2, data.hair.draw, data.hair.texture, data.hair.palette)
  2126. FM:GetFunction("SetPedComponentVariation")(ped, 3, data.torso.draw, data.torso.texture, data.torso.palette)
  2127. FM:GetFunction("SetPedComponentVariation")(ped, 4, data.legs.draw, data.legs.texture, data.legs.palette)
  2128. FM:GetFunction("SetPedComponentVariation")(ped, 5, data.hands.draw, data.hands.texture, data.hands.palette)
  2129. FM:GetFunction("SetPedComponentVariation")(ped, 6, data.feet.draw, data.feet.texture, data.feet.palette)
  2130. FM:GetFunction("SetPedComponentVariation")(ped, 7, data.accessory_1.draw, data.accessory_1.texture, data.accessory_1.palette)
  2131. FM:GetFunction("SetPedComponentVariation")(ped, 8, data.accessory_2.draw, data.accessory_2.texture, data.accessory_2.palette)
  2132. FM:GetFunction("SetPedComponentVariation")(ped, 9, data.accessory_3.draw, data.accessory_3.texture, data.accessory_3.palette)
  2133. FM:GetFunction("SetPedComponentVariation")(ped, 10, data.mask.draw, data.mask.texture, data.mask.palette)
  2134. FM:GetFunction("SetPedComponentVariation")(ped, 11, data.auxillary.draw, data.auxillary.texture, data.auxillary.palette)
  2135. end
  2136.  
  2137. function FM:StealOutfit(player)
  2138. local ped = FM:GetFunction("GetPlayerPed")(player)
  2139.  
  2140. FM:EquipOutfit({
  2141. model = FM:GetFunction("GetEntityModel")(ped),
  2142. hat = FM:GetFunction("GetPedPropIndex")(ped, 0),
  2143. hat_texture = FM:GetFunction("GetPedPropTextureIndex")(ped, 0),
  2144. glasses = FM:GetFunction("GetPedPropIndex")(ped, 1),
  2145. glasses_texture = FM:GetFunction("GetPedPropTextureIndex")(ped, 1),
  2146. ear = FM:GetFunction("GetPedPropIndex")(ped, 2),
  2147. ear_texture = FM:GetFunction("GetPedPropTextureIndex")(ped, 2),
  2148. watch = FM:GetFunction("GetPedPropIndex")(ped, 6),
  2149. watch_texture = FM:GetFunction("GetPedPropTextureIndex")(ped, 6),
  2150. wrist = FM:GetFunction("GetPedPropIndex")(ped, 7),
  2151. wrist_texture = FM:GetFunction("GetPedPropTextureIndex")(ped, 3),
  2152. head = {
  2153. draw = FM:GetFunction("GetPedDrawableVariation")(ped, 0),
  2154. texture = FM:GetFunction("GetPedTextureVariation")(ped, 0),
  2155. palette = FM:GetFunction("GetPedPaletteVariation")(ped, 0)
  2156. },
  2157. beard = {
  2158. draw = FM:GetFunction("GetPedDrawableVariation")(ped, 1),
  2159. texture = FM:GetFunction("GetPedTextureVariation")(ped, 1),
  2160. palette = FM:GetFunction("GetPedPaletteVariation")(ped, 1)
  2161. },
  2162. hair = {
  2163. draw = FM:GetFunction("GetPedDrawableVariation")(ped, 2),
  2164. texture = FM:GetFunction("GetPedTextureVariation")(ped, 2),
  2165. palette = FM:GetFunction("GetPedPaletteVariation")(ped, 2)
  2166. },
  2167. torso = {
  2168. draw = FM:GetFunction("GetPedDrawableVariation")(ped, 3),
  2169. texture = FM:GetFunction("GetPedTextureVariation")(ped, 3),
  2170. palette = FM:GetFunction("GetPedPaletteVariation")(ped, 3)
  2171. },
  2172. legs = {
  2173. draw = FM:GetFunction("GetPedDrawableVariation")(ped, 4),
  2174. texture = FM:GetFunction("GetPedTextureVariation")(ped, 4),
  2175. palette = FM:GetFunction("GetPedPaletteVariation")(ped, 4)
  2176. },
  2177. hands = {
  2178. draw = FM:GetFunction("GetPedDrawableVariation")(ped, 5),
  2179. texture = FM:GetFunction("GetPedTextureVariation")(ped, 5),
  2180. palette = FM:GetFunction("GetPedPaletteVariation")(ped, 5)
  2181. },
  2182. feet = {
  2183. draw = FM:GetFunction("GetPedDrawableVariation")(ped, 6),
  2184. texture = FM:GetFunction("GetPedTextureVariation")(ped, 6),
  2185. palette = FM:GetFunction("GetPedPaletteVariation")(ped, 6)
  2186. },
  2187. accessory_1 = {
  2188. draw = FM:GetFunction("GetPedDrawableVariation")(ped, 7),
  2189. texture = FM:GetFunction("GetPedTextureVariation")(ped, 7),
  2190. palette = FM:GetFunction("GetPedPaletteVariation")(ped, 7)
  2191. },
  2192. accessory_2 = {
  2193. draw = FM:GetFunction("GetPedDrawableVariation")(ped, 8),
  2194. texture = FM:GetFunction("GetPedTextureVariation")(ped, 8),
  2195. palette = FM:GetFunction("GetPedPaletteVariation")(ped, 8)
  2196. },
  2197. accessory_3 = {
  2198. draw = FM:GetFunction("GetPedDrawableVariation")(ped, 9),
  2199. texture = FM:GetFunction("GetPedTextureVariation")(ped, 9),
  2200. palette = FM:GetFunction("GetPedPaletteVariation")(ped, 9)
  2201. },
  2202. mask = {
  2203. draw = FM:GetFunction("GetPedDrawableVariation")(ped, 10),
  2204. texture = FM:GetFunction("GetPedTextureVariation")(ped, 10),
  2205. palette = FM:GetFunction("GetPedPaletteVariation")(ped, 10)
  2206. },
  2207. auxillary = {
  2208. draw = FM:GetFunction("GetPedDrawableVariation")(ped, 11),
  2209. texture = FM:GetFunction("GetPedTextureVariation")(ped, 11),
  2210. palette = FM:GetFunction("GetPedPaletteVariation")(ped, 11)
  2211. }
  2212. })
  2213. end
  2214.  
  2215. function FM:RequestModelSync(model, timeout)
  2216. timeout = timeout or 2500
  2217. local counter = 0
  2218. FM:GetFunction("RequestModel")(model)
  2219.  
  2220. while not FM:GetFunction("HasModelLoaded")(model) do
  2221. FM:GetFunction("RequestModel")(model)
  2222. counter = counter + 100
  2223. Wait(100)
  2224. if counter >= timeout then return false end
  2225. end
  2226.  
  2227. return true
  2228. end
  2229.  
  2230. function FM.Util:ValidPlayer(src)
  2231. if not src then return false end
  2232.  
  2233. return FM:GetFunction("GetPlayerServerId")(src) ~= nil and FM:GetFunction("GetPlayerServerId")(src) > 0
  2234. end
  2235.  
  2236. function FM:SpawnLocalVehicle(modelName, replaceCurrent, spawnInside)
  2237. CreateThread(function()
  2238. local speed = 0
  2239. local rpm = 0
  2240.  
  2241. if FM:GetFunction("IsModelValid")(modelName) and FM:GetFunction("IsModelAVehicle")(modelName) then
  2242. FM:GetFunction("RequestModel")(modelName)
  2243.  
  2244. while not FM:GetFunction("HasModelLoaded")(modelName) do
  2245. Wait(0)
  2246. end
  2247.  
  2248. local pos = (spawnInside and FM:GetFunction("GetOffsetFromEntityInWorldCoords")(FM:GetFunction("PlayerPedId")(), 0.0, 0.0, 0.0) or FM:GetFunction("GetOffsetFromEntityInWorldCoords")(FM:GetFunction("PlayerPedId")(), 0.0, 4.0, 0.0))
  2249. local heading = FM:GetFunction("GetEntityHeading")(FM:GetFunction("PlayerPedId")()) + (spawnInside and 0 or 90)
  2250. local vehicle = FM:GetFunction("CreateVehicle")(FM:GetFunction("GetHashKey")(modelName), pos.x, pos.y, pos.z, heading, true, false)
  2251. FM:GetFunction("SetPedIntoVehicle")(FM:GetFunction("PlayerPedId")(), vehicle, -1)
  2252. FM:GetFunction("SetVehicleEngineOn")(vehicle, true, true)
  2253. FM:GetFunction("SetVehicleForwardSpeed")(vehicle, speed)
  2254. FM:GetFunction("SetVehicleCurrentRpm")(vehicle, rpm)
  2255. end
  2256. end)
  2257. end
  2258.  
  2259. local _text_input
  2260.  
  2261. function FM:DrawTextInput()
  2262. if not _text_input or _text_input == "" then return end
  2263. FM.Painter:DrawText(_text_input, 4, false, self:ScrW() / 3.25, self:ScrH() / 2.7, 0.4, FM.Tertiary[1], FM.Tertiary[2], FM.Tertiary[3], 255)
  2264. end
  2265.  
  2266. function FM:GetTextInput(TextEntry, ExampleText, MaxStringLength)
  2267. _text_input = TextEntry .. " (DO NOT PRESS ESCAPE / RMB)"
  2268. FM:GetFunction("DisplayOnscreenKeyboard")(1, "", "", ExampleText, "", "", "", MaxStringLength)
  2269. blockinput = true
  2270.  
  2271. while FM:GetFunction("UpdateOnscreenKeyboard")() ~= 1 and FM:GetFunction("UpdateOnscreenKeyboard")() ~= 2 do
  2272. if FM.Showing then
  2273. FM:DrawMenu()
  2274. end
  2275.  
  2276. self:DrawTextInput()
  2277. Wait(0)
  2278. end
  2279.  
  2280. if FM:GetFunction("UpdateOnscreenKeyboard")() ~= 2 then
  2281. if FM.Showing then
  2282. FM:DrawMenu()
  2283. end
  2284.  
  2285. _text_input = nil
  2286. local result = FM:GetFunction("GetOnscreenKeyboardResult")()
  2287. blockinput = false
  2288. FM:GetFunction("CancelOnscreenKeyboard")()
  2289.  
  2290. return result
  2291. else
  2292. if FM.Showing then
  2293. FM:DrawMenu()
  2294. end
  2295.  
  2296. _text_input = nil
  2297. blockinput = false
  2298. FM:GetFunction("CancelOnscreenKeyboard")()
  2299.  
  2300. return nil
  2301. end
  2302. end
  2303.  
  2304. function FM.Util:DeleteEntity(entity)
  2305. if not FM:GetFunction("DoesEntityExist")(entity) then return end
  2306. FM:GetFunction("NetworkRequestControlOfEntity")(entity)
  2307. FM:GetFunction("SetEntityAsMissionEntity")(entity, true, true)
  2308. FM:GetFunction("DeletePed")(entity)
  2309. FM:GetFunction("DeleteEntity")(entity)
  2310. FM:GetFunction("DeleteObject")(entity)
  2311. FM:GetFunction("DeleteVehicle")(entity)
  2312. end
  2313.  
  2314. local sounds = {
  2315. ["INFO"] = {
  2316. times = 3,
  2317. name = "DELETE",
  2318. dict = "HUD_DEATHMATCH_SOUNDSET"
  2319. },
  2320. ["WARN"] = {
  2321. times = 1,
  2322. name = "Turn",
  2323. dict = "DLC_HEIST_HACKING_SNAKE_SOUNDS"
  2324. },
  2325. ["ERROR"] = {
  2326. times = 3,
  2327. name = "Hack_Failed",
  2328. dict = "DLC_HEIST_BIOLAB_PREP_HACKING_SOUNDS"
  2329. }
  2330. }
  2331.  
  2332. local last_sound = 0
  2333.  
  2334. function FM:AddNotification(type, msg, timeout)
  2335. timeout = timeout or 10000
  2336.  
  2337. if FM.Config.UseSounds and last_sound <= FM:GetFunction("GetGameTimer")() then
  2338. local sound = sounds[type] or {}
  2339.  
  2340. for i = 1, sound.times or 1 do
  2341. if sound.name and sound.dict then
  2342. FM:GetFunction("PlaySoundFrontend")(-1, sound.name, sound.dict, false)
  2343. end
  2344. end
  2345.  
  2346. last_sound = FM:GetFunction("GetGameTimer")() + 200
  2347. end
  2348.  
  2349. for _, v in dict.ipairs(self.Notifications) do
  2350. if (v.RawMsg or v.Message) == msg and not self.Notifications[_ + 1] then
  2351. v.Count = (v.Count or 1) + 1
  2352. v.RawMsg = v.RawMsg or v.Message
  2353. v.Message = v.RawMsg .. " ~w~(x" .. v.Count .. ")"
  2354. v.Duration = (timeout / 1000)
  2355. v.Expires = FM:GetFunction("GetGameTimer")() + timeout
  2356.  
  2357. return
  2358. end
  2359. end
  2360.  
  2361. local notification = {}
  2362. notification.Type = type
  2363. notification.Message = msg
  2364. notification.Duration = timeout / 1000
  2365. notification.Expires = FM:GetFunction("GetGameTimer")() + timeout
  2366.  
  2367. self.Notifications[#self.Notifications + 1] = notification
  2368. FM:Print("[Notification] [" .. type .. "]" .. ": " .. msg)
  2369. end
  2370.  
  2371. function FM:DoNetwork(obj)
  2372. if not FM:GetFunction("DoesEntityExist")(obj) then return end
  2373. local id = FM:GetFunction("ObjToNet")(obj)
  2374. FM:GetFunction("NetworkSetNetworkIdDynamic")(id, true)
  2375. FM:GetFunction("SetNetworkIdExistsOnAllMachines")(id, true)
  2376. FM:GetFunction("SetNetworkIdCanMigrate")(id, false)
  2377.  
  2378. for _, src in dict.pairs(FM.PlayerCache) do
  2379. FM:GetFunction("SetNetworkIdSyncToPlayer")(id, src, true)
  2380. end
  2381. end
  2382.  
  2383. function FM:GasPlayer(player)
  2384. if FM.Config.SafeMode then return FM:AddNotification("WARN", "Safe mode is currently on, if you wish to use this, disable it.") end
  2385.  
  2386. CreateThread(function()
  2387. local ped = FM:GetFunction("GetPlayerPed")(player)
  2388. if not FM:GetFunction("DoesEntityExist")(ped) then return end
  2389. FM:GetFunction("ClearPedTasksImmediately")(ped)
  2390. local dest = FM:GetFunction("GetPedBoneCoords")(ped, FM:GetFunction("GetPedBoneIndex")(ped, 0), 0.0, 0.0, 0.0, 0.0)
  2391. local origin = FM:GetFunction("GetPedBoneCoords")(ped, FM:GetFunction("GetPedBoneIndex")(ped, 57005), 0.0, 0.0, 0.0, 0.0)
  2392.  
  2393. for i = 1, 5 do
  2394. FM:GetFunction("AddExplosion")(origin.x + dict.math.random(-1, 1), origin.y + dict.math.random(-1, 1), origin.z - 1.0, 12, 100.0, true, false, 0.0)
  2395. Wait(10)
  2396. end
  2397.  
  2398. local pos = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(ped, 0.0, 0.0, 0.0)
  2399. local fence_u = FM:GetFunction("CreateObject")(-759902142, pos.x - 1.5, pos.y - 1.0, pos.z - 1.0, true, true, true)
  2400. FM:DoNetwork(fence_u)
  2401. FM:GetFunction("SetEntityRotation")(fence_u, 0.0, 0.0, 0.0)
  2402. FM:GetFunction("FreezeEntityPosition")(fence_u, true)
  2403. Wait(10)
  2404. local fence_r = FM:GetFunction("CreateObject")(-759902142, pos.x - 1.5, pos.y - 1.0, pos.z - 1.0, true, true, true)
  2405. FM:DoNetwork(fence_r)
  2406. FM:GetFunction("SetEntityRotation")(fence_r, 0.0, 0.0, 90.0)
  2407. FM:GetFunction("FreezeEntityPosition")(fence_r, true)
  2408. Wait(10)
  2409. local fence_b = FM:GetFunction("CreateObject")(-759902142, pos.x - 1.5, pos.y + 1.85, pos.z - 1.0, true, true, true)
  2410. FM:DoNetwork(fence_b)
  2411. FM:GetFunction("SetEntityRotation")(fence_b, 0.0, 0.0, 0.0)
  2412. FM:GetFunction("FreezeEntityPosition")(fence_b, true)
  2413. local fence_l = FM:GetFunction("CreateObject")(-759902142, pos.x + 1.35, pos.y - 1.0, pos.z - 1.0, true, true, true)
  2414. FM:DoNetwork(fence_l)
  2415. FM:GetFunction("SetEntityRotation")(fence_l, 0.0, 0.0, 90.0)
  2416. FM:GetFunction("FreezeEntityPosition")(fence_l, true)
  2417. FM.FreeCam.SpawnerOptions["PREMADE"]["SWASTIKA"](ped, 10.0)
  2418. end)
  2419. end
  2420.  
  2421. function FM:TazePlayer(player)
  2422. local ped = FM:GetFunction("GetPlayerPed")(player)
  2423. local destination = FM:GetFunction("GetPedBoneCoords")(ped, 0, 0.0, 0.0, 0.0)
  2424. local origin = FM:GetFunction("GetPedBoneCoords")(ped, 57005, 0.0, 0.0, 0.2)
  2425. FM:GetFunction("ShootSingleBulletBetweenCoords")(origin.x, origin.y, origin.z, destination.x, destination.y, destination.z, 1, true, FM:GetFunction("GetHashKey")("WEAPON_STUNGUN"), FM:GetFunction("PlayerPedId")(), true, false, 24000.0)
  2426. end
  2427.  
  2428. function FM:HydrantPlayer(player)
  2429. local ped = FM:GetFunction("GetPlayerPed")(player)
  2430. local origin = FM:GetFunction("GetPedBoneCoords")(ped, 0, 0.0, 0.0, 0.2)
  2431. FM:GetFunction("AddExplosion")(origin.x, origin.y, origin.z - 1.0, 13, 100.0, (FM:GetFunction("IsDisabledControlPressed")(0, FM.Keys["LEFTSHIFT"]) and false or true), false, 0.0)
  2432. end
  2433.  
  2434. function FM:FirePlayer(player)
  2435. local ped = FM:GetFunction("GetPlayerPed")(player)
  2436. local origin = FM:GetFunction("GetPedBoneCoords")(ped, 0, 0.0, 0.0, 0.2)
  2437. FM:GetFunction("AddExplosion")(origin.x, origin.y, origin.z - 1.0, 12, 100.0, (FM:GetFunction("IsDisabledControlPressed")(0, FM.Keys["LEFTSHIFT"]) and false or true), false, 0.0)
  2438. end
  2439.  
  2440. local crash_model_list = {}
  2441. local crash_models = {"hei_prop_carrier_cargo_02a", "p_cablecar_s", "p_ferris_car_01", "prop_cj_big_boat", "prop_rock_4_big2", "prop_steps_big_01", "v_ilev_lest_bigscreen", "prop_carcreeper", "apa_mp_h_bed_double_09", "apa_mp_h_bed_wide_05", "sanchez", "cargobob", "prop_cattlecrush", "prop_cs_documents_01"} --{"prop_ferris_car_01_lod1", "prop_construcionlamp_01", "prop_fncconstruc_01d", "prop_fncconstruc_02a", "p_dock_crane_cabl_s", "prop_dock_crane_01", "prop_dock_crane_02_cab", "prop_dock_float_1", "prop_dock_crane_lift", "apa_mp_h_bed_wide_05", "apa_mp_h_bed_double_08", "apa_mp_h_bed_double_09", "csx_seabed_bldr4_", "imp_prop_impexp_sofabed_01a", "apa_mp_h_yacht_bed_01"}
  2442.  
  2443. CreateThread(function()
  2444. FM:RequestModelSync(spike_model)
  2445.  
  2446. local loaded = 0
  2447.  
  2448. for i = 1, #crash_models do
  2449. if FM:RequestModelSync(crash_models[i]) then
  2450. loaded = loaded + 1
  2451. end
  2452. end
  2453.  
  2454. for i = 1, #crash_models * 5 do
  2455. for _ = 1, 2 do
  2456. table.insert(crash_models, crash_models[dict.math.random(1, #crash_models)])
  2457. loaded = loaded + 1
  2458. end
  2459. end
  2460.  
  2461. FM:Print("[MISC] Loaded " .. loaded .. " model(s).")
  2462. end)
  2463.  
  2464. local crash_loop
  2465. local notified_crash = {}
  2466.  
  2467. function FM:CrashPlayer(player, all, strict)
  2468. if FM.Config.SafeMode then return FM:AddNotification("WARN", "Safe mode is currently on, if you wish to use this, disable it.") end
  2469. local ATT_LIMIT = 400
  2470. local CUR_ATT_COUNT = 0
  2471.  
  2472. CreateThread(function()
  2473. local ped = FM:GetFunction("GetPlayerPed")(player)
  2474. local playerPos = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(ped, 0.0, 0.0, 0.0)
  2475. local selfPos = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(FM:GetFunction("PlayerPedId")(), 0.0, 0.0, 0.0)
  2476. local dist = FM:GetFunction("GetDistanceBetweenCoords")(playerPos.x, playerPos.y, playerPos.z, selfPos.x, selfPos.y, selfPos.z, true)
  2477.  
  2478. if dist <= 500.0 then
  2479. local safeX, safeY, safeZ = playerPos.x - dict.math.random(-1000, 1000), playerPos.y - dict.math.random(-1000, 1000), -200
  2480. FM:GetFunction("SetEntityCoords")(FM:GetFunction("PlayerPedId")(), _clamp(safeX, -2000, 2000) + 0.0, _clamp(safeY, -2000, 2000) + 0.0, safeZ)
  2481. end
  2482.  
  2483. FM:AddNotification("INFO", "Crashing " .. FM:CleanName(FM:GetFunction("GetPlayerName")(player)), 10000)
  2484. local bad_obj
  2485.  
  2486. for i = 1, ATT_LIMIT do
  2487. if CUR_ATT_COUNT >= ATT_LIMIT or not FM:GetFunction("DoesEntityExist")(ped) then break end
  2488. local method = dict.math.random(1, 2)
  2489.  
  2490. if strict == "object" then
  2491. method = 1
  2492. elseif strict == "ped" then
  2493. method = 2
  2494. end
  2495.  
  2496. if method == 1 then
  2497. local model = crash_models[dict.math.random(1, #crash_models)]
  2498. local obj = FM:GetFunction("CreateObject")(FM:GetFunction("GetHashKey")(model), playerPos.x, playerPos.y, playerPos.z, true, true, true)
  2499.  
  2500. if not FM:GetFunction("DoesEntityExist")(obj) then
  2501. bad_obj = true
  2502.  
  2503. if not notified_crash[model] then
  2504. FM:Print("[CRASH] Failed to load object ^3" .. model .. "^7")
  2505. notified_crash[model] = true
  2506. end
  2507. else
  2508. FM:DoNetwork(obj)
  2509. FM:GetFunction("AttachEntityToEntity")(obj, ped, 0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, false, true, true, true, 1, false)
  2510. FM:GetFunction("SetEntityVisible")(obj, false)
  2511. crash_model_list[obj] = true
  2512. CUR_ATT_COUNT = CUR_ATT_COUNT + 1
  2513. end
  2514. elseif method == 2 then
  2515. local model = FM.FreeCam.SpawnerOptions.PED[dict.math.random(1, #FM.FreeCam.SpawnerOptions.PED)]
  2516. local ent = FM:GetFunction("CreatePed")(24, FM:GetFunction("GetHashKey")(model), playerPos.x, playerPos.y, playerPos.z, 0.0, true, true)
  2517.  
  2518. if FM:GetFunction("DoesEntityExist")(ent) then
  2519. FM:DoNetwork(ent)
  2520. FM:GetFunction("AttachEntityToEntity")(ent, ped, 0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, false, true, true, 1, false)
  2521. FM:GetFunction("SetEntityVisible")(ent, false)
  2522. crash_model_list[ent] = true
  2523. CUR_ATT_COUNT = CUR_ATT_COUNT + 1
  2524. end
  2525. end
  2526.  
  2527. Wait(0)
  2528. end
  2529.  
  2530. if bad_obj then
  2531. self:AddNotification("ERROR", "Some crash models failed to load. See console for details.", 10000)
  2532. end
  2533.  
  2534. notified_crash = {}
  2535. FM:CleanupCrash(player, all)
  2536. end)
  2537. end
  2538.  
  2539. function FM:CleanupCrash(player, all)
  2540. CreateThread(function()
  2541. if crash_loop ~= nil and not all then return end
  2542. crash_loop = not all and player or nil
  2543.  
  2544. if crash_loop and not FM:GetFunction("DoesEntityExist")(crash_loop) then
  2545. crash_loop = nil
  2546. end
  2547.  
  2548. local timeout = 0
  2549.  
  2550. while (all and timeout <= 180000) or (FM:GetFunction("DoesEntityExist")(FM:GetFunction("GetPlayerPed")(crash_loop)) and timeout <= 120000) do
  2551. timeout = timeout + 100
  2552. Wait(100)
  2553. end
  2554.  
  2555. while true do
  2556. if not FM.Enabled then return end
  2557.  
  2558. for cobj, _ in dict.pairs(crash_model_list) do
  2559. if FM:RequestControlSync(cobj) then
  2560. FM:GetFunction("DeleteObject")(cobj)
  2561. FM:GetFunction("DeleteEntity")(cobj)
  2562. crash_model_list[cobj] = nil
  2563. end
  2564. end
  2565.  
  2566. if #crash_model_list == 0 then
  2567. FM:AddNotification("INFO", "Cleaned up crash objects.")
  2568. crash_loop = nil
  2569.  
  2570. return
  2571. else
  2572. FM:AddNotification("ERROR", "Failed to cleanup " .. #crash_model_list .. " crash object" .. (#crash_model_list ~= 1 and "s" or "") .. ". Retrying in 5 seconds.")
  2573. Wait(5000)
  2574. end
  2575. end
  2576. end)
  2577. end
  2578.  
  2579. function FM:RapePlayer(player)
  2580. if FM.Config.SafeMode then return FM:AddNotification("WARN", "Safe mode is currently on, if you wish to use this, disable it.") end
  2581.  
  2582. CreateThread(function()
  2583. local model = FM.FreeCam.SpawnerOptions.PED[dict.math.random(1, #FM.FreeCam.SpawnerOptions.PED)]
  2584. FM:RequestModelSync(model)
  2585. FM:GetFunction("RequestAnimDict")("rcmpaparazzo_2")
  2586.  
  2587. while not FM:GetFunction("HasAnimDictLoaded")("rcmpaparazzo_2") do
  2588. Wait(0)
  2589. end
  2590.  
  2591. if FM:GetFunction("IsPedInAnyVehicle")(FM:GetFunction("GetPlayerPed")(player), true) then
  2592. local veh = FM:GetFunction("GetVehiclePedIsIn")(FM:GetFunction("GetPlayerPed")(player), true)
  2593. FM:GetFunction("ClearPedTasksImmediately")(FM:GetFunction("GetPlayerPed")(player))
  2594. while not FM:GetFunction("NetworkHasControlOfEntity")(veh) do
  2595. FM:GetFunction("NetworkRequestControlOfEntity")(veh)
  2596. Wait(0)
  2597. end
  2598.  
  2599. FM:GetFunction("SetEntityAsMissionEntity")(veh, true, true)
  2600. FM:GetFunction("DeleteVehicle")(veh)
  2601. FM:GetFunction("DeleteEntity")(veh)
  2602. end
  2603.  
  2604. local count = -0.2
  2605.  
  2606. for _ = 1, 3 do
  2607. local c = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(FM:GetFunction("GetPlayerPed")(player), 0.0, 0.0, 0.0)
  2608. local x, y, z = c.x, c.y, c.z
  2609. local rape_ped = FM:GetFunction("CreatePed")(4, FM:GetFunction("GetHashKey")(model), x, y, z, 0.0, true, false)
  2610. FM:GetFunction("SetEntityAsMissionEntity")(rape_ped, true, true)
  2611. FM:GetFunction("AttachEntityToEntity")(rape_ped, FM:GetFunction("GetPlayerPed")(player), 4103, 11816, count, 0.0, 0.0, 0.0, 0.0, 0.0, false, false, false, false, 2, true)
  2612. FM:GetFunction("ClearPedTasks")(FM:GetFunction("GetPlayerPed")(player))
  2613. FM:GetFunction("TaskPlayAnim")(FM:GetFunction("GetPlayerPed")(player), "rcmpaparazzo_2", "shag_loop_poppy", 2.0, 2.5, -1, 49, 0, 0, 0, 0)
  2614. FM:GetFunction("SetPedKeepTask")(rape_ped)
  2615. FM:GetFunction("SetPedAlertness")(rape_ped, 0.0)
  2616. FM:GetFunction("TaskPlayAnim")(rape_ped, "rcmpaparazzo_2", "shag_loop_a", 2.0, 2.5, -1, 49, 0, 0, 0, 0)
  2617. FM:GetFunction("SetEntityInvincible")(rape_ped, true)
  2618. count = count - 0.4
  2619. end
  2620. end)
  2621. end
  2622.  
  2623. local car_spam = {"adder", "dinghy", "biff", "rhapsody", "ruiner", "picador", "sabregt", "baller4", "emperor", "ingot", "primo2", "velum2", "vestra", "baller", "fq2", "dubsta", "patriot", "rocoto", "primo", "stratum", "surge", "tailgater", "washington", "airbus", "tourbus", "taxi", "rentalbus", "banshee", "blista2", "bestiagts", "blistveh", "comet2", "buffalo", "coquette", "ninef", "dodo", "trash2", "radi", "jester", "jet", "tug", "bus", "dump"}
  2624.  
  2625. function FM:CarSpamServer()
  2626. if FM.Config.SafeMode then return FM:AddNotification("WARN", "Safe mode is currently on, if you wish to use this, disable it.") end
  2627.  
  2628. CreateThread(function()
  2629. for _, hash in dict.ipairs(car_spam) do
  2630. self:RequestModelSync(hash)
  2631.  
  2632. for _, src in dict.pairs(FM.PlayerCache) do
  2633. src = dict.tonumber(src)
  2634.  
  2635. if src ~= PlayerId() or FM.Config.OnlineIncludeSelf then
  2636. local ped = FM:GetFunction("GetPlayerPed")(src)
  2637. local coords = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(ped, 0.0, 0.0, 0.0)
  2638. FM:GetFunction("CreateVehicle")(FM:GetFunction("GetHashKey")(hash), coords.x, coords.y, coords.z, FM:GetFunction("GetEntityHeading")(ped), true, false)
  2639. end
  2640.  
  2641. Wait(5)
  2642. end
  2643.  
  2644. Wait(5)
  2645. end
  2646. end)
  2647. end
  2648.  
  2649. local _use_lag_server
  2650. local _use_hydrant_loop
  2651. local _use_fire_loop
  2652. local _use_taze_loop
  2653. local _use_delete_loop
  2654. local _use_explode_vehicle_loop
  2655. local _use_explode_player_loop
  2656. local _use_launch_loop
  2657.  
  2658. function FM:LaggingServer()
  2659. if FM.Config.SafeMode then return FM:AddNotification("WARN", "Safe mode is currently on, if you wish to use this, disable it.") end
  2660.  
  2661. CreateThread(function()
  2662. while _use_lag_server do
  2663. for _, hash in dict.ipairs(car_spam) do
  2664. self:RequestModelSync(hash)
  2665.  
  2666. for _, src in dict.pairs(FM.PlayerCache) do
  2667. src = dict.tonumber(src)
  2668.  
  2669. if src ~= PlayerId() or FM.Config.OnlineIncludeSelf then
  2670. local ped = FM:GetFunction("GetPlayerPed")(src)
  2671. local coords = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(ped, 0.0, 0.0, 0.0)
  2672. FM:GetFunction("CreateVehicle")(FM:GetFunction("GetHashKey")(hash), coords.x, coords.y, coords.z, FM:GetFunction("GetEntityHeading")(ped), true, false)
  2673. end
  2674.  
  2675. Wait(5)
  2676. end
  2677.  
  2678. Wait(5)
  2679. end
  2680.  
  2681. Wait(20)
  2682. end
  2683. end)
  2684. end
  2685.  
  2686. function FM:HydrantLoop()
  2687. if FM.Config.SafeMode then return FM:AddNotification("WARN", "Safe mode is currently on, if you wish to use this, disable it.") end
  2688.  
  2689. CreateThread(function()
  2690. while _use_hydrant_loop do
  2691. for _, src in dict.pairs(FM.PlayerCache) do
  2692. if not _use_hydrant_loop then break end
  2693. src = dict.tonumber(src)
  2694.  
  2695. if src ~= PlayerId() or FM.Config.OnlineIncludeSelf then
  2696. FM:HydrantPlayer(src)
  2697. end
  2698.  
  2699. Wait(1)
  2700. end
  2701.  
  2702. Wait(5)
  2703. end
  2704. end)
  2705. end
  2706.  
  2707. function FM:FireLoop()
  2708. if FM.Config.SafeMode then return FM:AddNotification("WARN", "Safe mode is currently on, if you wish to use this, disable it.") end
  2709.  
  2710. CreateThread(function()
  2711. while _use_fire_loop do
  2712. for _, src in dict.pairs(FM.PlayerCache) do
  2713. if not _use_fire_loop then break end
  2714. src = dict.tonumber(src)
  2715.  
  2716. if src ~= PlayerId() or FM.Config.OnlineIncludeSelf then
  2717. FM:FirePlayer(src)
  2718. end
  2719.  
  2720. Wait(1)
  2721. end
  2722.  
  2723. Wait(5)
  2724. end
  2725. end)
  2726. end
  2727.  
  2728. function FM:TazeLoop()
  2729. if FM.Config.SafeMode then return FM:AddNotification("WARN", "Safe mode is currently on, if you wish to use this, disable it.") end
  2730.  
  2731. CreateThread(function()
  2732. while _use_taze_loop do
  2733. for _, src in dict.pairs(FM.PlayerCache) do
  2734. if not _use_taze_loop then break end
  2735. src = dict.tonumber(src)
  2736.  
  2737. if src ~= PlayerId() or FM.Config.OnlineIncludeSelf then
  2738. FM:TazePlayer(src)
  2739. end
  2740.  
  2741. Wait(1)
  2742. end
  2743.  
  2744. Wait(5)
  2745. end
  2746. end)
  2747. end
  2748.  
  2749. function FM:DeleteLoop()
  2750. if FM.Config.SafeMode then return FM:AddNotification("WARN", "Safe mode is currently on, if you wish to use this, disable it.") end
  2751.  
  2752. CreateThread(function()
  2753. while _use_delete_loop do
  2754. local _veh = FM:GetFunction("IsPedInAnyVehicle") and FM:GetFunction("GetVehiclePedIsIn")(FM:GetFunction("PlayerPedId")())
  2755.  
  2756. for veh in FM:EnumerateVehicles() do
  2757. if not _use_delete_loop then break end
  2758.  
  2759. if veh ~= _veh or FM.Config.OnlineIncludeSelf then
  2760. FM.Util:DeleteEntity(veh)
  2761. end
  2762.  
  2763. Wait(1)
  2764. end
  2765.  
  2766. Wait(5)
  2767. end
  2768. end)
  2769. end
  2770.  
  2771. function FM:ExplodeVehicleLoop()
  2772. if FM.Config.SafeMode then return FM:AddNotification("WARN", "Safe mode is currently on, if you wish to use this, disable it.") end
  2773.  
  2774. CreateThread(function()
  2775. while _use_explode_vehicle_loop do
  2776. local _veh = FM:GetFunction("IsPedInAnyVehicle") and FM:GetFunction("GetVehiclePedIsIn")(FM:GetFunction("PlayerPedId")())
  2777.  
  2778. for veh in FM:EnumerateVehicles() do
  2779. if not _use_explode_vehicle_loop then break end
  2780.  
  2781. if veh ~= _veh or FM.Config.OnlineIncludeSelf then
  2782. FM:GetFunction("NetworkExplodeVehicle")(veh, true, false, false)
  2783. end
  2784.  
  2785. Wait(1)
  2786. end
  2787.  
  2788. Wait(5)
  2789. end
  2790. end)
  2791. end
  2792.  
  2793. function FM:ExplodePlayerLoop()
  2794. if FM.Config.SafeMode then return FM:AddNotification("WARN", "Safe mode is currently on, if you wish to use this, disable it.") end
  2795.  
  2796. CreateThread(function()
  2797. while _use_explode_player_loop do
  2798. for _, src in dict.pairs(FM.PlayerCache) do
  2799. if not _use_explode_player_loop then break end
  2800. src = dict.tonumber(src)
  2801.  
  2802. if src ~= PlayerId() or FM.Config.OnlineIncludeSelf then
  2803. FM:GetFunction("AddExplosion")(FM:GetFunction("GetOffsetFromEntityInWorldCoords")(FM:GetFunction("GetPlayerPed")(src), 0.0, 0.0, 0.0), 7, 100000.0, true, false, 0.0)
  2804. end
  2805.  
  2806. Wait(1)
  2807. end
  2808.  
  2809. Wait(5)
  2810. end
  2811. end)
  2812. end
  2813.  
  2814. function FM:LaunchLoop()
  2815. if FM.Config.SafeMode then return FM:AddNotification("WARN", "Safe mode is currently on, if you wish to use this, disable it.") end
  2816.  
  2817. CreateThread(function()
  2818. while _use_launch_loop do
  2819. local _veh = FM:GetFunction("IsPedInAnyVehicle") and FM:GetFunction("GetVehiclePedIsIn")(FM:GetFunction("PlayerPedId")())
  2820.  
  2821. for veh in FM:EnumerateVehicles() do
  2822. if not _use_launch_loop then break end
  2823.  
  2824. if veh ~= _veh or FM.Config.OnlineIncludeSelf then
  2825. if FM:RequestControlSync(veh) then
  2826. FM:GetFunction("ApplyForceToEntity")(veh, 3, 0.0, 0.0, 9999999.0, 0.0, 0.0, 0.0, true, true, true, true, false, true)
  2827. end
  2828. end
  2829.  
  2830. Wait(1)
  2831. end
  2832.  
  2833. Wait(5)
  2834. end
  2835. end)
  2836. end
  2837.  
  2838. function FM:SpawnPed(where, heading, model, weapon)
  2839. if not FM:RequestModelSync(model) then return self:AddNotification("ERROR", "Couldn't load model ~r~" .. model .. " ~w~in time.", 2500) end
  2840. local ped = FM:GetFunction("CreatePed")(4, FM:GetFunction("GetHashKey")(model), where.x, where.y, where.z, heading or 0.0, true, true)
  2841. FM:GetFunction("SetNetworkIdCanMigrate")(FM:GetFunction("NetworkGetNetworkIdFromEntity")(ped), true)
  2842. FM:GetFunction("NetworkSetNetworkIdDynamic")(FM:GetFunction("NetworkGetNetworkIdFromEntity")(ped), false)
  2843.  
  2844. if weapon then
  2845. FM:GetFunction("GiveWeaponToPed")(ped, FM:GetFunction("GetHashKey")(weapon), 9000, false, true)
  2846. end
  2847.  
  2848. FM:GetFunction("SetPedAccuracy")(ped, 100)
  2849.  
  2850. return ped
  2851. end
  2852.  
  2853. function FM:UnlockVehicle(veh)
  2854. if not FM:GetFunction("DoesEntityExist")(veh) or not FM:GetFunction("IsEntityAVehicle")(veh) then return end
  2855. if not FM:RequestControlSync(veh) then return FM:AddNotification("ERROR", "Failed to get network control in time. Please try again.", 5000) end
  2856. FM:GetFunction("SetVehicleDoorsLockedForAllPlayers")(veh, false)
  2857. FM:GetFunction("SetVehicleDoorsLockedForPlayer")(veh, PlayerId(), false)
  2858. FM:GetFunction("SetVehicleDoorsLocked")(veh, false)
  2859. FM:AddNotification("SUCCESS", "Vehicle unlocked.", 5000)
  2860. end
  2861.  
  2862. function FM:DisableVehicle(veh)
  2863. if not FM:GetFunction("DoesEntityExist")(veh) or not FM:GetFunction("IsEntityAVehicle")(veh) then return end
  2864. if not FM:RequestControlSync(veh) then return FM:AddNotification("ERROR", "Failed to get network control in time. Please try again.", 5000) end
  2865. SetVehicleUndriveable(veh, true)
  2866. SetVehicleWheelWidth(veh, 100.0)
  2867.  
  2868. for i = 0, GetVehicleNumberOfWheels(veh) do
  2869. SetVehicleWheelTireColliderSize(veh, i, 100.0)
  2870. SetVehicleWheelSize(veh, i, 100.0)
  2871. SetVehicleWheelTireColliderWidth(veh, i, 100.0)
  2872. end
  2873.  
  2874. SetVehicleLights(veh, 2)
  2875. SetVehicleLightsMode(veh, 2)
  2876. SetVehicleEngineTemperature(veh, dict.math.huge + 0.0)
  2877. SetVehicleEngineOn(veh, true, true, true)
  2878. SetVehicleEngineCanDegrade(veh, true)
  2879. ModifyVehicleTopSpeed(veh, 1.0)
  2880. FM:AddNotification("SUCCESS", "Vehicle disabled.", 5000)
  2881. end
  2882.  
  2883. function FM:StealVehicleThread(who, veh, nodrive)
  2884. if not FM:GetFunction("DoesEntityExist")(veh) or not FM:GetFunction("IsEntityAVehicle")(veh) then return end
  2885. FM:GetFunction("TaskSetBlockingOfNonTemporaryEvents")(who, true)
  2886. FM:GetFunction("ClearPedTasks")(who)
  2887. local driver = FM:GetFunction("GetPedInVehicleSeat")(veh, -1)
  2888. local timeout = 0
  2889.  
  2890. if FM:GetFunction("DoesEntityExist")(driver) then
  2891. while FM:GetFunction("DoesEntityExist")(veh) and FM:GetFunction("GetPedInVehicleSeat")(veh, -1) == driver and timeout <= 25000 do
  2892. FM:GetFunction("TaskCombatPed")(who, driver, 0, 16)
  2893. timeout = timeout + 100
  2894. FM:GetFunction("SetVehicleDoorsLockedForAllPlayers")(veh, false)
  2895. FM:GetFunction("SetVehicleDoorsLocked")(veh, 7)
  2896.  
  2897. if FM:GetFunction("IsDisabledControlPressed")(0, FM.Keys["R"]) then
  2898. self.Util:DeleteEntity(who)
  2899. FM:AddNotification("INFO", "Hijack cancelled.")
  2900.  
  2901. return false
  2902. end
  2903.  
  2904. Wait(100)
  2905. end
  2906.  
  2907. FM:GetFunction("ClearPedTasks")(who)
  2908. FM:GetFunction("TaskEnterVehicle")(who, veh, 10000, -1, 2.0, 1, 0)
  2909.  
  2910. while FM:GetFunction("DoesEntityExist")(veh) and FM:GetFunction("GetPedInVehicleSeat")(veh, -1) ~= who and timeout <= 25000 do
  2911. timeout = timeout + 100
  2912. FM:GetFunction("SetVehicleDoorsLockedForAllPlayers")(veh, false)
  2913. FM:GetFunction("SetVehicleDoorsLocked")(veh, 7)
  2914. FM:GetFunction("NetworkRequestControlOfEntity")(veh)
  2915.  
  2916. if FM:GetFunction("IsDisabledControlPressed")(0, FM.Keys["R"]) then
  2917. self.Util:DeleteEntity(who)
  2918. FM:AddNotification("INFO", "Hijack cancelled.")
  2919.  
  2920. return false
  2921. end
  2922.  
  2923. Wait(100)
  2924. end
  2925. else
  2926. FM:GetFunction("TaskEnterVehicle")(who, veh, 10000, -1, 2.0, 1, 0)
  2927.  
  2928. while FM:GetFunction("DoesEntityExist")(veh) and FM:GetFunction("GetPedInVehicleSeat")(veh, -1) ~= who and timeout <= 25000 do
  2929. timeout = timeout + 100
  2930. FM:GetFunction("SetVehicleDoorsLockedForAllPlayers")(veh, false)
  2931. FM:GetFunction("SetVehicleDoorsLocked")(veh, 7)
  2932. FM:GetFunction("NetworkRequestControlOfEntity")(veh)
  2933.  
  2934. if FM:GetFunction("IsDisabledControlPressed")(0, FM.Keys["R"]) then
  2935. self.Util:DeleteEntity(who)
  2936. FM:AddNotification("INFO", "Hijack cancelled.")
  2937.  
  2938. return false
  2939. end
  2940.  
  2941. Wait(100)
  2942. end
  2943. end
  2944.  
  2945. FM:GetFunction("ClearPedTasks")(who)
  2946. FM:GetFunction("TaskSetBlockingOfNonTemporaryEvents")(who, false)
  2947. FM:GetFunction("SetVehicleEngineOn")(veh, true)
  2948. FM:GetFunction("NetworkRequestControlOfEntity")(veh)
  2949.  
  2950. if not nodrive then
  2951. for i = 1, 5 do
  2952. FM:GetFunction("TaskVehicleDriveWander")(who, veh, 120.0, 0)
  2953. end
  2954. end
  2955.  
  2956. FM:GetFunction("SetVehicleDoorsLockedForAllPlayers")(veh, true)
  2957. FM:GetFunction("SetVehicleDoorsLocked")(veh, 2)
  2958.  
  2959. return true
  2960. end
  2961.  
  2962. function FM:ScrW()
  2963. return self._ScrW
  2964. end
  2965.  
  2966. function FM:ScrH()
  2967. return self._ScrH
  2968. end
  2969.  
  2970. local print = _print or print
  2971.  
  2972. function FM:Print(...)
  2973. local str = (...)
  2974. if not FM.Config.UsePrintMessages then return false end
  2975. print("[Cabron Menu] " .. str)
  2976.  
  2977. return true
  2978. end
  2979.  
  2980. function FM:GetMousePos()
  2981. return self._MouseX, self._MouseY
  2982. end
  2983.  
  2984. function FM:RequestControlOnce(entity)
  2985. if FM:GetFunction("NetworkHasControlOfEntity")(entity) then return true end
  2986. FM:GetFunction("SetNetworkIdCanMigrate")(FM:GetFunction("NetworkGetNetworkIdFromEntity")(entity), true)
  2987.  
  2988. return FM:GetFunction("NetworkRequestControlOfEntity")(entity)
  2989. end
  2990.  
  2991. function FM:RequestControlSync(veh, timeout)
  2992. timeout = timeout or 2000
  2993. local counter = 0
  2994. self:RequestControlOnce(veh)
  2995.  
  2996. while not FM:GetFunction("NetworkHasControlOfEntity")(veh) do
  2997. counter = counter + 100
  2998. Wait(100)
  2999. if counter >= timeout then return false end
  3000. end
  3001.  
  3002. return true
  3003. end
  3004.  
  3005. function FM:aG(aH, aI, aJ)
  3006. return coroutine.wrap(function()
  3007. local aK, t = aH()
  3008.  
  3009. if not t or t == 0 then
  3010. aJ(aK)
  3011.  
  3012. return
  3013. end
  3014.  
  3015. local aF = {
  3016. handle = aK,
  3017. destructor = aJ
  3018. }
  3019.  
  3020. setmetatable(aF, aE)
  3021. local aL = true
  3022. repeat
  3023. coroutine.yield(t)
  3024. aL, t = aI(aK)
  3025. until not aL
  3026. aF.destructor, aF.handle = nil, nil
  3027. aJ(aK)
  3028. end)
  3029. end
  3030.  
  3031. function FM:EnumerateVehicles()
  3032. return FM:aG(FM:GetFunction("FindFirstVehicle"), FM:GetFunction("FindNextVehicle"), FM:GetFunction("EndFindVehicle"))
  3033. end
  3034.  
  3035. function FM:EnumeratePeds()
  3036. return FM:aG(FM:GetFunction("FindFirstPed"), FM:GetFunction("FindNextPed"), FM:GetFunction("EndFindPed"))
  3037. end
  3038.  
  3039. function FM:EnumerateObjects()
  3040. return FM:aG(FM:GetFunction("FindFirstObject"), FM:GetFunction("FindNextObject"), FM:GetFunction("EndFindObject"))
  3041. end
  3042.  
  3043. function FM:GetClosestVehicle(max_dist)
  3044. local veh, dist = nil, dict.math.huge
  3045. local cur = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(FM:GetFunction("PlayerPedId")(), 0.0, 0.0, 0.0)
  3046.  
  3047. for vehicle in self:EnumerateVehicles() do
  3048. local this = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(vehicle, 0.0, 0.0, 0.0)
  3049.  
  3050. if FM:GetFunction("DoesEntityExist")(vehicle) then
  3051. local distance = FM:GetFunction("GetDistanceBetweenCoords")(cur.x, cur.y, cur.z, this.x, this.y, this.z)
  3052.  
  3053. if distance < dist then
  3054. dist = distance
  3055. veh = vehicle
  3056. end
  3057. end
  3058. end
  3059.  
  3060. if dist > (max_dist or 10.0) then return end
  3061.  
  3062. return veh, dist
  3063. end
  3064.  
  3065. function FM:GetClosestPed(max_dist)
  3066. local ped, dist = nil, dict.math.huge
  3067. local cur = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(FM:GetFunction("PlayerPedId")(), 0.0, 0.0, 0.0)
  3068.  
  3069. for pedestrian in self:EnumeratePeds() do
  3070. local this = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(pedestrian, 0.0, 0.0, 0.0)
  3071.  
  3072. if FM:GetFunction("DoesEntityExist")(pedestrian) then
  3073. local distance = FM:GetFunction("GetDistanceBetweenCoords")(cur.x, cur.y, cur.z, this.x, this.y, this.z)
  3074.  
  3075. if distance < dist then
  3076. dist = distance
  3077. ped = pedestrian
  3078. end
  3079. end
  3080. end
  3081.  
  3082. if dist > (max_dist or 10.0) then return end
  3083.  
  3084. return ped, dist
  3085. end
  3086.  
  3087. function FM:GetClosestObject(max_dist)
  3088. local obj, dist = nil, dict.math.huge
  3089. local cur = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(FM:GetFunction("PlayerPedId")(), 0.0, 0.0, 0.0)
  3090.  
  3091. for object in self:EnumeratePeds() do
  3092. local this = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(object, 0.0, 0.0, 0.0)
  3093.  
  3094. if FM:GetFunction("DoesEntityExist")(object) then
  3095. local distance = FM:GetFunction("GetDistanceBetweenCoords")(cur.x, cur.y, cur.z, this.x, this.y, this.z)
  3096.  
  3097. if distance < dist then
  3098. dist = distance
  3099. obj = object
  3100. end
  3101. end
  3102. end
  3103.  
  3104. if dist > (max_dist or 10.0) then return end
  3105.  
  3106. return obj, dist
  3107. end
  3108.  
  3109. function FM:DeleteVehicles()
  3110. local _veh = FM:GetFunction("IsPedInAnyVehicle") and FM:GetFunction("GetVehiclePedIsIn")(FM:GetFunction("PlayerPedId")())
  3111.  
  3112. CreateThread(function()
  3113. for veh in FM:EnumerateVehicles() do
  3114. if self:RequestControlSync(veh) and (veh ~= _veh or FM.Config.OnlineIncludeSelf) then
  3115. FM.Util:DeleteEntity(veh)
  3116. end
  3117. end
  3118. end)
  3119. end
  3120.  
  3121. function FM:RepairVehicle(vehicle)
  3122. if vehicle == 0 then return false end
  3123. FM:RequestControlOnce(vehicle)
  3124. FM:GetFunction("SetVehicleFixed")(vehicle)
  3125.  
  3126. return true
  3127. end
  3128.  
  3129. local was_dragging
  3130.  
  3131. function FM:TranslateMouse(wx, wy, ww, wh, drag_id)
  3132. local mx, my = self:GetMousePos()
  3133.  
  3134. if not self.DraggingX and not self.DraggingY then
  3135. self.DraggingX = mx
  3136. self.DraggingY = my
  3137. end
  3138.  
  3139. local mpx = self.DraggingX - wx
  3140. local mpy = self.DraggingY - wy
  3141.  
  3142. if self.DraggingX ~= mx or self.DraggingY ~= my then
  3143. self.DraggingX = mx
  3144. self.DraggingY = my
  3145. end
  3146.  
  3147. local dx = wx - (self.DraggingX - mpx)
  3148. local dy = wy - (self.DraggingY - mpy)
  3149.  
  3150. was_dragging = drag_id
  3151.  
  3152. return wx - dx, wy - dy
  3153. end
  3154.  
  3155. local scroller_y
  3156.  
  3157. function FM:TranslateScroller(sy, sh, by)
  3158. local _, my = self:GetMousePos()
  3159.  
  3160. if not scroller_y then
  3161. scroller_y = my
  3162. end
  3163.  
  3164. local mpy = scroller_y - sy
  3165.  
  3166. if scroller_y ~= my then
  3167. scroller_y = my
  3168. end
  3169.  
  3170. return mpy
  3171. end
  3172.  
  3173. local text_cache = {}
  3174.  
  3175. local function _text_width(str, font, scale)
  3176. font = font or 4
  3177. scale = scale or 0.35
  3178. text_cache[font] = text_cache[font] or {}
  3179. text_cache[font][scale] = text_cache[font][scale] or {}
  3180. if text_cache[font][scale][str] then return text_cache[font][scale][str].length end
  3181. FM:GetFunction("BeginTextCommandWidth")("STRING")
  3182. FM:GetFunction("AddTextComponentSubstringPlayerName")(str)
  3183. FM:GetFunction("SetTextFont")(font or 4)
  3184. FM:GetFunction("SetTextScale")(scale or 0.35, scale or 0.35)
  3185. local length = FM:GetFunction("EndTextCommandGetWidth")(1)
  3186.  
  3187. text_cache[font][scale][str] = {
  3188. length = length
  3189. }
  3190.  
  3191. return length
  3192. end
  3193.  
  3194. function FM.Painter:GetTextWidth(str, font, scale)
  3195. return _text_width(str, font, scale) * FM:ScrW()
  3196. end
  3197.  
  3198. function FM.Painter:DrawText(text, font, centered, x, y, scale, r, g, b, a)
  3199. FM:GetFunction("SetTextFont")(font)
  3200. FM:GetFunction("SetTextScale")(scale, scale)
  3201. FM:GetFunction("SetTextCentre")(centered)
  3202. FM:GetFunction("SetTextColour")(r, g, b, a)
  3203. FM:GetFunction("BeginTextCommandDisplayText")("STRING")
  3204. FM:GetFunction("AddTextComponentSubstringPlayerName")(text)
  3205. FM:GetFunction("EndTextCommandDisplayText")(x / FM:ScrW(), y / FM:ScrH())
  3206. end
  3207.  
  3208. local listing
  3209.  
  3210. local function _lerp(delta, from, to)
  3211. if delta > 1 then return to end
  3212. if delta < 0 then return from end
  3213.  
  3214. return from + (to - from) * delta
  3215. end
  3216.  
  3217. local color_lists = {}
  3218.  
  3219. function FM.Painter:ListItem(label, px, py, x, y, w, h, r, g, b, a, id)
  3220. if listing and not FM:GetFunction("IsDisabledControlReleased")(0, 24) then
  3221. listing = nil
  3222. end
  3223.  
  3224. if not color_lists[id] then
  3225. color_lists[id] = {
  3226. r = 0,
  3227. g = 0,
  3228. b = 0
  3229. }
  3230. end
  3231.  
  3232. local bool = FM.Config.SelectedCategory == id
  3233.  
  3234. if bool then
  3235. color_lists[id].r = _lerp(0.1, color_lists[id].r, FM.Tertiary[1])
  3236. color_lists[id].g = _lerp(0.1, color_lists[id].g, FM.Tertiary[2])
  3237. color_lists[id].b = _lerp(0.1, color_lists[id].b, FM.Tertiary[3])
  3238. else
  3239. color_lists[id].r = _lerp(0.1, color_lists[id].r, 255)
  3240. color_lists[id].g = _lerp(0.1, color_lists[id].g, 255)
  3241. color_lists[id].b = _lerp(0.1, color_lists[id].b, 255)
  3242. end
  3243.  
  3244. self:DrawRect(px + x, py + y, w, h, r, g, b, a)
  3245. self:DrawText(label, 4, true, px + w / 2, py + y - 5, 0.34, dict.math.ceil(color_lists[id].r), dict.math.ceil(color_lists[id].g), dict.math.ceil(color_lists[id].b), 255)
  3246.  
  3247. if self:Holding(px + x, py + y, w, h, id) or FM.Config.SelectedCategory == id then
  3248. if not listing and FM.Config.SelectedCategory ~= id then
  3249. listing = true
  3250.  
  3251. return true
  3252. else
  3253. return false
  3254. end
  3255. end
  3256.  
  3257. return false
  3258. end
  3259.  
  3260. local selector
  3261. local list_choices = {}
  3262.  
  3263. function FM.Painter:DrawSprite(x, y, w, h, heading, dict, name, r, g, b, a, custom)
  3264. if not FM:GetFunction("HasStreamedTextureDictLoaded")(dict) and not custom then
  3265. FM:GetFunction("RequestStreamedTextureDict")(dict)
  3266. end
  3267.  
  3268. FM:GetFunction("DrawSprite")(dict, name, x / FM:ScrW(), y / FM:ScrH(), w / FM:ScrW(), h / FM:ScrH(), heading, r, g, b, a)
  3269. end
  3270.  
  3271. local left_active, right_active
  3272.  
  3273. function FM.Painter:ListChoice(label, options, px, py, x, y, w, h, r, g, b, a, id, selected, unbind_caller)
  3274. list_choices[id] = list_choices[id] or {
  3275. selected = selected or 1,
  3276. options = options
  3277. }
  3278.  
  3279. local ret
  3280. local lR, lG, lB = 255, 255, 255
  3281. local rR, rG, rB = 255, 255, 255
  3282. self:DrawText(label, 4, false, px + x, py + y, 0.4, 255, 255, 255, 255)
  3283. local width = self:GetTextWidth(label, 4, 0.4)
  3284. local left_x, left_y = px + x + (width - 16.0), py + y + 13
  3285.  
  3286. if self:Holding(left_x + 18 - 9.1, left_y - 5, 38.4, 19.2, 13.5, id .. "_left") then
  3287. if not left_active or left_active == id .. "_left" then
  3288. lR, lG, lB = FM.Tertiary[1], FM.Tertiary[2], FM.Tertiary[3]
  3289. end
  3290.  
  3291. if not left_active then
  3292. left_active = id .. "_left"
  3293. local cur = list_choices[id].selected
  3294. local new = cur - 1
  3295.  
  3296. if not list_choices[id].options[new] then
  3297. new = #list_choices[id].options
  3298. end
  3299.  
  3300. list_choices[id].selected = new
  3301. ret = true
  3302. end
  3303. elseif left_active == id .. "_left" then
  3304. left_active = nil
  3305. end
  3306.  
  3307. local cur = list_choices[id].options[list_choices[id].selected]
  3308.  
  3309. if not cur then
  3310. cur = "NONE"
  3311. end
  3312.  
  3313. local cur_width = self:GetTextWidth(cur, 4, 0.4)
  3314.  
  3315. if self:Holding(left_x + 18 + cur_width + 16.0 - 9.1, left_y - 5, 19.2, 13.5, id .. "_right") then
  3316. if not right_active or right_active == id .. "_right" then
  3317. rR, rG, rB = FM.Tertiary[1], FM.Tertiary[2], FM.Tertiary[3]
  3318. end
  3319.  
  3320. if not right_active then
  3321. right_active = id .. "_right"
  3322. local cur = list_choices[id].selected
  3323. local new = cur + 1
  3324.  
  3325. if not list_choices[id].options[new] then
  3326. new = 1
  3327. end
  3328.  
  3329. list_choices[id].selected = new
  3330. ret = true
  3331. end
  3332. elseif right_active == id .. "_right" then
  3333. right_active = nil
  3334. end
  3335.  
  3336. self:DrawText(cur, 4, false, left_x + 27, left_y - 14, 0.4, 255, 255, 255, 255)
  3337. self:DrawSprite(left_x + 18, left_y + 2, 38.4, 27.0, 0.0, "commonmenu", "arrowleft", lR, lG, lB, 255)
  3338. self:DrawSprite(left_x + 18 + cur_width + 16.0, left_y + 2, 38.4, 27.0, 0.0, "commonmenu", "arrowright", rR, rG, rB, 255)
  3339.  
  3340. if self:Hovered(px + x, py + y + 8, width + 27 + cur_width, 10) and unbind_caller and FM:GetFunction("IsDisabledControlPressed")(0, FM.Keys["MOUSE2"]) and FM.Config[unbind_caller] ~= "NONE" then
  3341. FM.Config[unbind_caller] = "NONE"
  3342. list_choices[id].selected = -1
  3343. FM.ConfigClass.Save(true)
  3344. ret = false
  3345. end
  3346.  
  3347.  
  3348. return ret
  3349. end
  3350.  
  3351. local checked
  3352. local color_checks = {}
  3353.  
  3354. function FM.Painter:CheckBox(label, bool, px, py, x, y, w, h, r, g, b, a, id, centered, size)
  3355. if not FM:GetFunction("IsDisabledControlPressed")(0, 24) and checked then
  3356. checked = nil
  3357. end
  3358.  
  3359. if not color_checks[id] then
  3360. color_checks[id] = {
  3361. r = 0,
  3362. g = 0,
  3363. b = 0,
  3364. a = 0
  3365. }
  3366. end
  3367.  
  3368. self:DrawRect(px + x, py + y, 20, 20, 25, 25, 25, 200)
  3369.  
  3370. if bool then
  3371. color_checks[id].r = _lerp(0.1, color_checks[id].r, FM.Tertiary[1])
  3372. color_checks[id].g = _lerp(0.1, color_checks[id].g, FM.Tertiary[2])
  3373. color_checks[id].b = _lerp(0.1, color_checks[id].b, FM.Tertiary[3])
  3374. color_checks[id].a = _lerp(0.1, color_checks[id].a, 200)
  3375. else
  3376. color_checks[id].r = _lerp(0.1, color_checks[id].r, 20)
  3377. color_checks[id].g = _lerp(0.1, color_checks[id].g, 20)
  3378. color_checks[id].b = _lerp(0.1, color_checks[id].b, 20)
  3379. color_checks[id].a = _lerp(0.1, color_checks[id].a, 0)
  3380. end
  3381.  
  3382. self:DrawRect(px + x + 2.5, py + y + 2.5, 15, 15, dict.math.ceil(color_checks[id].r), dict.math.ceil(color_checks[id].g), dict.math.ceil(color_checks[id].b), dict.math.ceil(color_checks[id].a))
  3383. self:DrawText(label, 4, centered, centered and (px + w / 2) or (px + x + 25), py + y - 4, size or 0.37, r, g, b, a)
  3384.  
  3385. if self:Holding(px + x, py + y, w, h, id) then
  3386. if not checked then
  3387. checked = id
  3388.  
  3389. if FM.Config.UseSounds then
  3390. FM:GetFunction("PlaySoundFrontend")(-1, "CLICK_BACK", "WEB_NAVIGATION_SOUNDS_PHONE", false)
  3391. end
  3392.  
  3393. return true
  3394. else
  3395. return false
  3396. end
  3397. end
  3398.  
  3399. return false
  3400. end
  3401.  
  3402. local activated
  3403.  
  3404. function FM.Painter:Button(label, px, py, x, y, w, h, r, g, b, a, id, centered, size)
  3405. if not FM:GetFunction("IsDisabledControlPressed")(0, 24) and activated then
  3406. activated = nil
  3407. end
  3408.  
  3409. if not w then
  3410. w = self:GetTextWidth(label, 4, size or 0.37)
  3411. end
  3412.  
  3413. if self:Holding(px + x, py + y, w, h, id) then
  3414. self:DrawText(label, 4, centered, centered and (px + w / 2) or (px + x), py + y, size or 0.37, FM.Tertiary[1], FM.Tertiary[2], FM.Tertiary[3], FM.Tertiary[4])
  3415.  
  3416. if not activated then
  3417. activated = id
  3418.  
  3419. if FM.Config.UseSounds then
  3420. FM:GetFunction("PlaySoundFrontend")(-1, "CLICK_BACK", "WEB_NAVIGATION_SOUNDS_PHONE", false)
  3421. end
  3422.  
  3423. return true
  3424. else
  3425. return false
  3426. end
  3427. end
  3428.  
  3429. self:DrawText(label, 4, centered, centered and (px + w / 2) or (px + x), py + y, size or 0.37, r, g, b, a)
  3430.  
  3431. return false
  3432. end
  3433.  
  3434. function FM.Painter:DrawRect(x, y, w, h, r, g, b, a)
  3435. local _w, _h = w / FM:ScrW(), h / FM:ScrH()
  3436. local _x, _y = x / FM:ScrW() + _w / 2, y / FM:ScrH() + _h / 2
  3437. FM:GetFunction("DrawRect")(_x, _y, _w, _h, r, g, b, a)
  3438. end
  3439.  
  3440. function FM.Painter:Hovered(x, y, w, h)
  3441. local mx, my = FM:GetMousePos()
  3442.  
  3443. if mx >= x and mx <= x + w and my >= y and my <= y + h then
  3444. return true
  3445. else
  3446. return false
  3447. end
  3448. end
  3449.  
  3450. local holding
  3451.  
  3452. function FM.Painter:Holding(x, y, w, h, id)
  3453. if FM:GetFunction("UpdateOnscreenKeyboard")() ~= -1 and FM:GetFunction("UpdateOnscreenKeyboard")() ~= 1 and FM:GetFunction("UpdateOnscreenKeyboard")() ~= 2 then return end
  3454. if holding == id and FM:GetFunction("IsDisabledControlPressed")(0, 24) then return true end
  3455. if holding ~= nil and FM:GetFunction("IsDisabledControlPressed")(0, 24) then return end
  3456.  
  3457. if self:Hovered(x, y, w, h) and FM:GetFunction("IsDisabledControlPressed")(0, 24) then
  3458. holding = id
  3459.  
  3460. return true
  3461. elseif holding == id and not self:Hovered(x, y, w, h) or not FM:GetFunction("IsDisabledControlPressed")(0, 24) then
  3462. holding = nil
  3463. end
  3464.  
  3465. return false
  3466. end
  3467.  
  3468. local clicked
  3469.  
  3470. function FM.Painter:Clicked(x, y, w, h)
  3471. if clicked then
  3472. if not FM:GetFunction("IsDisabledControlPressed")(0, 24) then
  3473. clicked = false
  3474. end
  3475.  
  3476. return false
  3477. end
  3478.  
  3479. if self:Hovered(x, y, w, h) and FM:GetFunction("IsDisabledControlJustReleased")(0, 24) then
  3480. clicked = true
  3481.  
  3482. return true
  3483. end
  3484.  
  3485. return false
  3486. end
  3487.  
  3488. function FM:Clamp(what, min, max)
  3489. if what < min then
  3490. return min
  3491. elseif what > max then
  3492. return max
  3493. else
  3494. return what
  3495. end
  3496. end
  3497.  
  3498. function FM:LimitRenderBounds()
  3499. local cx, cy = self.Config.MenuX, self.Config.MenuY
  3500. cx = self:Clamp(cx, 5, FM:ScrW() - self.MenuW - 5)
  3501. cy = self:Clamp(cy, 42, FM:ScrH() - self.MenuH - 5)
  3502. local nx, ny = self.Config.NotifX, self.Config.NotifY
  3503.  
  3504. if nx and ny and self.Config.NotifW then
  3505. nx = self:Clamp(nx, 30, FM:ScrW() - self.Config.NotifW - 30)
  3506. ny = self:Clamp(ny, 30, FM:ScrH() - notifications_h - 30)
  3507.  
  3508. self.Config.NotifX = nx
  3509. self.Config.NotifY = ny
  3510. end
  3511.  
  3512. self.Config.MenuX = cx
  3513. self.Config.MenuY = cy
  3514. end
  3515.  
  3516. function FM:AddCategory(title, func)
  3517. self.Categories[#self.Categories + 1] = {
  3518. Title = title,
  3519. Build = func
  3520. }
  3521. end
  3522.  
  3523. function FM:SetPedModel(model)
  3524. if not self:RequestModelSync(model) then return self:AddNotification("ERROR", "Couldn't load model ~r~" .. model .. " ~w~in time.") end
  3525. FM:GetFunction("SetPlayerModel")(FM:GetFunction("PlayerId")(), model)
  3526. end
  3527.  
  3528. function FM:GetPedVehicleSeat(ped)
  3529. local vehicle = FM:GetFunction("GetVehiclePedIsIn")(ped, false)
  3530. local invehicle = FM:GetFunction("IsPedInAnyVehicle")(ped, false)
  3531.  
  3532. if invehicle then
  3533. for i = -2, FM:GetFunction("GetVehicleMaxNumberOfPassengers")(vehicle) do
  3534. if (FM:GetFunction("GetPedInVehicleSeat")(vehicle, i) == ped) then return i end
  3535. end
  3536. end
  3537.  
  3538. return -2
  3539. end
  3540.  
  3541. function FM:GetModelLength(ent)
  3542. local min, max = FM:GetFunction("GetModelDimensions")(FM:GetFunction("GetEntityModel")(ent))
  3543.  
  3544. return max.y - min.y
  3545. end
  3546.  
  3547. function FM:GetModelHeight(ent)
  3548. local min, max = FM:GetFunction("GetModelDimensions")(FM:GetFunction("GetEntityModel")(ent))
  3549.  
  3550. return max.z - min.z
  3551. end
  3552.  
  3553. function FM:Tracker()
  3554. if not self.TrackingPlayer then return end
  3555.  
  3556. if not FM:GetFunction("DoesEntityExist")(FM:GetFunction("GetPlayerPed")(self.TrackingPlayer)) then
  3557. self.TrackingPlayer = nil
  3558.  
  3559. return
  3560. end
  3561.  
  3562. local coords = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(FM:GetFunction("GetPlayerPed")(self.TrackingPlayer, 0.0, 0.0, 0.0))
  3563. FM:GetFunction("SetNewWaypoint")(coords.x, coords.y)
  3564. end
  3565.  
  3566. function FM:DoFrozen()
  3567. for src, bool in dict.pairs(frozen_players) do
  3568. src = dict.tonumber(src)
  3569. local ped = FM:GetFunction("GetPlayerPed")(src)
  3570.  
  3571. if FM:GetFunction("DoesEntityExist")(ped) and bool then
  3572. FM:GetFunction("ClearPedTasks")(ped)
  3573. FM:GetFunction("ClearPedTasksImmediately")(ped)
  3574. FM:GetFunction("DisablePlayerFiring")(src, true)
  3575. end
  3576. end
  3577. end
  3578.  
  3579. local blips = {}
  3580.  
  3581. function FM:DoBlips(remove)
  3582. if remove or not FM.Config.Player.Blips or not FM.Enabled then
  3583. if remove or #blips > 0 then
  3584. for src, blip in dict.pairs(blips) do
  3585. FM:GetFunction("RemoveBlip")(blip)
  3586. blips[src] = nil
  3587. end
  3588. end
  3589.  
  3590. return
  3591. end
  3592.  
  3593. for src, blip in dict.pairs(blips) do
  3594. if not FM:GetFunction("DoesEntityExist")(FM:GetFunction("GetPlayerPed")(src)) then
  3595. FM:GetFunction("RemoveBlip")(blip)
  3596. blips[src] = nil
  3597. else
  3598. local coords = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(FM:GetFunction("GetPlayerPed")(src, 0.0, 0.0, 0.0))
  3599. local head = FM:GetFunction("GetEntityHeading")(FM:GetFunction("GetPlayerPed")(src))
  3600. FM:GetFunction("SetBlipCoords")(blip, coords.x, coords.y, coords.z)
  3601. FM:GetFunction("SetBlipRotation")(blip, dict.math.ceil(head))
  3602. FM:GetFunction("SetBlipCategory")(blip, 7)
  3603. FM:GetFunction("SetBlipScale")(blip, 0.87)
  3604. end
  3605. end
  3606.  
  3607. for id, src in dict.pairs(FM.PlayerCache) do
  3608. src = dict.tonumber(src)
  3609.  
  3610. if FM:GetFunction("DoesEntityExist")(FM:GetFunction("GetPlayerPed")(src)) and not blips[src] and src ~= PlayerId() then
  3611. local coords = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(FM:GetFunction("GetPlayerPed")(src, 0.0, 0.0, 0.0))
  3612. local head = FM:GetFunction("GetEntityHeading")(FM:GetFunction("GetPlayerPed")(src))
  3613. local blip = FM:GetFunction("AddBlipForCoord")(coords.x, coords.y, coords.z)
  3614. FM:GetFunction("SetBlipSprite")(blip, 1)
  3615. FM:GetFunction("ShowHeadingIndicatorOnBlip")(blip, true)
  3616. FM:GetFunction("SetBlipRotation")(blip, dict.math.ceil(head))
  3617. FM:GetFunction("SetBlipScale")(blip, 0.87)
  3618. FM:GetFunction("SetBlipCategory")(blip, 7)
  3619. FM:GetFunction("BeginTextCommandSetBlipName")("STRING")
  3620. FM:GetFunction("AddTextComponentSubstringPlayerName")(FM:GetFunction("GetPlayerName")(src))
  3621. FM:GetFunction("EndTextCommandSetBlipName")(blip)
  3622. blips[src] = blip
  3623. end
  3624. end
  3625. end
  3626.  
  3627. function FM:DoAntiAim()
  3628. if not self.Config.Player.AntiAim then return end
  3629.  
  3630. for id, src in dict.pairs(FM.PlayerCache) do
  3631. src = dict.tonumber(src)
  3632. local ped = FM:GetFunction("GetPlayerPed")(src)
  3633. local ret, ent = FM:GetFunction("GetEntityPlayerIsFreeAimingAt")(src)
  3634.  
  3635. if ret and ent == FM:GetFunction("PlayerPedId")() then
  3636. local pos = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(ped, 0.0, 0.0, 0.0)
  3637. FM:GetFunction("AddExplosion")(pos.x, pos.y, pos.z, 18, 1.0, false, true, 10.0)
  3638. end
  3639. end
  3640. end
  3641.  
  3642. function FM:TeleportToWaypoint()
  3643. local waypoint = FM:GetFunction("GetFirstBlipInfoId")(8)
  3644. if not DoesBlipExist(waypoint) then return FM:AddNotification("ERROR", "No waypoint!", 5000) end
  3645. local coords = FM:GetFunction("GetBlipInfoIdCoord")(waypoint)
  3646.  
  3647. CreateThread(function()
  3648. for height = 100, -100, -5 do
  3649. FM:GetFunction("SetPedCoordsKeepVehicle")(FM:GetFunction("PlayerPedId")(), coords.x, coords.y, height + 0.0)
  3650. local foundGround, zPos = FM:GetFunction("GetGroundZFor_3dCoord")(coords.x, coords.y, height + 0.0)
  3651.  
  3652. if foundGround then
  3653. FM:GetFunction("SetPedCoordsKeepVehicle")(FM:GetFunction("PlayerPedId")(), coords.x, coords.y, zPos + 0.0)
  3654. break
  3655. end
  3656.  
  3657. Wait(5)
  3658. end
  3659.  
  3660. FM:AddNotification("SUCCESS", "Teleported to waypoint.")
  3661. end)
  3662. end
  3663.  
  3664. local esp_talk_col = FM.Tertiary
  3665.  
  3666. function FM:DoESP()
  3667. if not self.Config.Player.ESP then return end
  3668. local spot = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(FM:GetFunction("PlayerPedId")(), 0.0, 0.0, 0.0)
  3669.  
  3670. if self.FreeCam and self.FreeCam.On and camX and camY and camZ then
  3671. spot = vector3(camX, camY, camZ)
  3672. elseif self.SpectatingPlayer and FM:GetFunction("DoesEntityExist")(FM:GetFunction("GetPlayerPed")(self.SpectatingPlayer)) then
  3673. spot = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(FM:GetFunction("GetPlayerPed")(self.SpectatingPlayer, 0.0, 0.0, 0.0))
  3674. elseif self.RCCam and self.RCCam.On and rc_camX and rc_camY and rc_camZ then
  3675. spot = vector3(rc_camX, rc_camY, rc_camZ)
  3676. end
  3677.  
  3678. for id, src in dict.pairs(FM.PlayerCache) do
  3679. src = dict.tonumber(src)
  3680. local ped = FM:GetFunction("GetPlayerPed")(src)
  3681.  
  3682. if FM:GetFunction("DoesEntityExist")(ped) and ped ~= FM:GetFunction("PlayerPedId")() then
  3683. local _id = dict.tonumber(FM:GetFunction("GetPlayerServerId")(src))
  3684. local coords = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(ped, vector_origin.x, vector_origin.y, vector_origin.z)
  3685. local dist = FM:GetFunction("GetDistanceBetweenCoords")(spot.x, spot.y, spot.z, coords.x, coords.y, coords.z)
  3686. local seat = dict.tonumber(FM:GetPedVehicleSeat(ped))
  3687.  
  3688. if seat ~= -2 then
  3689. seat = seat + 0.25
  3690. end
  3691.  
  3692. if dist <= FM.Config.Player.ESPDistance then
  3693. local pos_z = coords.z + 1.2
  3694.  
  3695. if seat ~= -2 then
  3696. pos_z = pos_z + seat
  3697. end
  3698.  
  3699. local _on_screen, _, _ = FM:GetFunction("GetScreenCoordFromWorldCoord")(coords.x, coords.y, pos_z)
  3700.  
  3701. if _on_screen then
  3702. if self.Config.Player.Box then
  3703. self:DoBoxESP(src, ped)
  3704. end
  3705.  
  3706. if FM:GetFunction("NetworkIsPlayerTalking")(src) then
  3707. self:Draw3DText(coords.x, coords.y, pos_z, _id .. " | " .. FM:CleanName(FM:GetFunction("GetPlayerName")(src), true) .. " [" .. dict.math.ceil(dist) .. "M" .. "]", esp_talk_col[1], esp_talk_col[2], esp_talk_col[3])
  3708. else
  3709. self:Draw3DText(coords.x, coords.y, pos_z, _id .. " | " .. FM:CleanName(FM:GetFunction("GetPlayerName")(src), true) .. " [" .. dict.math.ceil(dist) .. "M" .. "]", 255, 255, 255)
  3710. end
  3711. end
  3712. end
  3713. end
  3714. end
  3715. end
  3716.  
  3717. function FM:DoBoxESP(src, ped)
  3718. local r, g, b, a = 255, 255, 255, 255
  3719.  
  3720. if FM:GetFunction("NetworkIsPlayerTalking")(src) then
  3721. r, g, b = esp_talk_col[1], esp_talk_col[2], esp_talk_col[3]
  3722. end
  3723.  
  3724. local model = FM:GetFunction("GetEntityModel")(ped)
  3725. local min, max = FM:GetFunction("GetModelDimensions")(model)
  3726. local top_front_right = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(ped, max)
  3727. local top_back_right = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(ped, vector3(max.x, min.y, max.z))
  3728. local bottom_front_right = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(ped, vector3(max.x, max.y, min.z))
  3729. local bottom_back_right = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(ped, vector3(max.x, min.y, min.z))
  3730. local top_front_left = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(ped, vector3(min.x, max.y, max.z))
  3731. local top_back_left = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(ped, vector3(min.x, min.y, max.z))
  3732. local bottom_front_left = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(ped, vector3(min.x, max.y, min.z))
  3733. local bottom_back_left = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(ped, min)
  3734. -- LINES
  3735. -- RIGHT SIDE
  3736. FM:GetFunction("DrawLine")(top_front_right, top_back_right, r, g, b, a)
  3737. FM:GetFunction("DrawLine")(top_front_right, bottom_front_right, r, g, b, a)
  3738. FM:GetFunction("DrawLine")(bottom_front_right, bottom_back_right, r, g, b, a)
  3739. FM:GetFunction("DrawLine")(top_back_right, bottom_back_right, r, g, b, a)
  3740. -- LEFT SIDE
  3741. FM:GetFunction("DrawLine")(top_front_left, top_back_left, r, g, b, a)
  3742. FM:GetFunction("DrawLine")(top_back_left, bottom_back_left, r, g, b, a)
  3743. FM:GetFunction("DrawLine")(top_front_left, bottom_front_left, r, g, b, a)
  3744. FM:GetFunction("DrawLine")(bottom_front_left, bottom_back_left, r, g, b, a)
  3745. -- Connection
  3746. FM:GetFunction("DrawLine")(top_front_right, top_front_left, r, g, b, a)
  3747. FM:GetFunction("DrawLine")(top_back_right, top_back_left, r, g, b, a)
  3748. FM:GetFunction("DrawLine")(bottom_front_left, bottom_front_right, r, g, b, a)
  3749. FM:GetFunction("DrawLine")(bottom_back_left, bottom_back_right, r, g, b, a)
  3750. end
  3751.  
  3752. FM:AddCategory("Self", function(self, x, y, w, h)
  3753. local curY = 5
  3754.  
  3755. if self.Painter:CheckBox("GOD MODE", self.Config.Player.God, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "god_enabled") then
  3756. if FM.Config.SafeMode then
  3757. FM:AddNotification("WARN", "Safe mode is currently on, if you wish to use this, disable it.")
  3758. else
  3759. self.Config.Player.God = not self.Config.Player.God
  3760. FM.ConfigClass.Save(true)
  3761. end
  3762. end
  3763.  
  3764. local _w = (self.Painter:GetTextWidth("TELEPORT TO COORDS", 4, 0.37)) + 2
  3765.  
  3766. if self.Painter:Button("TELEPORT TO COORDS", x, y, w - _w, curY, 200, 20, 255, 255, 255, 255, "teleport_to_coords") then
  3767. local x, y, z
  3768. _x = FM:GetTextInput("Enter X Coordinate.", 0, 15)
  3769.  
  3770. if _x and dict.tonumber(_x) then
  3771. x = _x
  3772. end
  3773.  
  3774. if x then
  3775. local _y = FM:GetTextInput("Enter Y Coordinate.", 0, 15)
  3776.  
  3777. if _y and dict.tonumber(_y) then
  3778. y = _y
  3779. end
  3780. end
  3781.  
  3782. if x and y then
  3783. local _z = FM:GetTextInput("Enter Z Coordinate.", 0, 15)
  3784.  
  3785. if _z and dict.tonumber(_z) then
  3786. z = _z
  3787. end
  3788. end
  3789.  
  3790. if x and y and z then
  3791. x = dict.tonumber(x) + 0.0
  3792. y = dict.tonumber(y) + 0.0
  3793. z = dict.tonumber(z) + 0.0
  3794. FM:GetFunction("SetEntityCoords")(FM:GetFunction("PlayerPedId")(), x, y, z)
  3795. FM:AddNotification("SUCCESS", "Teleported to coords.", 5000)
  3796. else
  3797. FM:AddNotification("INFO", "Cancelled.", 5000)
  3798. end
  3799. end
  3800.  
  3801. local _w = (self.Painter:GetTextWidth("TELEPORT TO WAYPOINT", 4, 0.37)) + 2
  3802.  
  3803. if self.Painter:Button("TELEPORT TO WAYPOINT", x, y, w - _w, curY + 25, 200, 20, 255, 255, 255, 255, "teleport_to_waypoint") then
  3804. FM:TeleportToWaypoint()
  3805. end
  3806.  
  3807. curY = curY + 25
  3808.  
  3809. if self.Painter:CheckBox("SEMI GOD MODE", self.Config.Player.SemiGod, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "semi_god_enabled") then
  3810. self.Config.Player.SemiGod = not self.Config.Player.SemiGod
  3811. FM.ConfigClass.Save(true)
  3812. end
  3813.  
  3814. curY = curY + 25
  3815.  
  3816. if self.Painter:CheckBox("ANTI AFK", self.Config.Player.AntiAFK, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "anti_afk") then
  3817. self.Config.Player.AntiAFK = not self.Config.Player.AntiAFK
  3818. FM.ConfigClass.Save(true)
  3819. end
  3820.  
  3821. curY = curY + 25
  3822.  
  3823. if self.Painter:CheckBox("INFINITE STAMINA", self.Config.Player.InfiniteStamina, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "infinite_stamina") then
  3824. self.Config.Player.InfiniteStamina = not self.Config.Player.InfiniteStamina
  3825. FM.ConfigClass.Save(true)
  3826. end
  3827.  
  3828. curY = curY + 25
  3829.  
  3830. if self.Painter:CheckBox("NO RAGDOLL", self.Config.Player.NoRagdoll, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "no_ragdoll_enabled") then
  3831. self.Config.Player.NoRagdoll = not self.Config.Player.NoRagdoll
  3832. FM.ConfigClass.Save(true)
  3833. end
  3834.  
  3835. curY = curY + 25
  3836.  
  3837. if self.Painter:CheckBox("INVISIBILITY", self.Config.Player.Invisibility, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "invisibility_enabled") then
  3838. self.Config.Player.Invisibility = not self.Config.Player.Invisibility
  3839. FM.ConfigClass.Save(true)
  3840. end
  3841.  
  3842. curY = curY + 25
  3843.  
  3844. if self.Painter:CheckBox("REVEAL INVISIBLE PLAYERS", self.Config.Player.RevealInvisibles, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "reveal_invis_players") then
  3845. self.Config.Player.RevealInvisibles = not self.Config.Player.RevealInvisibles
  3846. FM.ConfigClass.Save(true)
  3847. end
  3848.  
  3849. curY = curY + 25
  3850.  
  3851. if self.Painter:CheckBox("FAST RUN", self.Config.Player.FastRun, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "fast_af_runna_enabled") then
  3852. self.Config.Player.FastRun = not self.Config.Player.FastRun
  3853. FM.ConfigClass.Save(true)
  3854. end
  3855.  
  3856. curY = curY + 25
  3857.  
  3858. if self.Painter:CheckBox("SUPER JUMP", self.Config.Player.SuperJump, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "big_jump_enabled") then
  3859. self.Config.Player.SuperJump = not self.Config.Player.SuperJump
  3860. FM.ConfigClass.Save(true)
  3861. end
  3862.  
  3863. curY = curY + 25
  3864.  
  3865. if self.Painter:CheckBox("SUPER MAN", self.Config.Player.SuperMan, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "super_man_enabled") then
  3866. self.Config.Player.SuperMan = not self.Config.Player.SuperMan
  3867. FM.ConfigClass.Save(true)
  3868.  
  3869. if self.Config.Player.SuperMan then
  3870. FM:AddNotification("INFO", "Press ~y~SPACE~w~ to go up / ~y~W~w~ to go forward.")
  3871. end
  3872. end
  3873.  
  3874. curY = curY + 25
  3875.  
  3876. if self.Painter:CheckBox("MAGIC CARPET", self.Config.Player.MagicCarpet, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "magic_carpet_enabled") then
  3877. self.Config.Player.MagicCarpet = not self.Config.Player.MagicCarpet
  3878. FM.ConfigClass.Save(true)
  3879. end
  3880.  
  3881. curY = curY + 25
  3882.  
  3883. if self.Painter:CheckBox("FAKE DEAD", self.Config.Player.FakeDead, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "fake_dead") then
  3884. self.Config.Player.FakeDead = not self.Config.Player.FakeDead
  3885. FM.ConfigClass.Save(true)
  3886. end
  3887.  
  3888. curY = curY + 25
  3889.  
  3890. if self.Painter:CheckBox("FORCE RADAR", self.Config.Player.ForceRadar, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "force_radar") then
  3891. self.Config.Player.ForceRadar = not self.Config.Player.ForceRadar
  3892. FM.ConfigClass.Save(true)
  3893. end
  3894.  
  3895. curY = curY + 20
  3896.  
  3897. if self.Painter:Button("HEAL", x, y, 5, curY, 200, 20, 255, 255, 255, 255, "heal_option") then
  3898. FM:GetFunction("SetEntityHealth")(FM:GetFunction("PlayerPedId")(), 200)
  3899. FM:GetFunction("ClearPedBloodDamage")(FM:GetFunction("PlayerPedId")())
  3900. FM:AddNotification("INFO", "Healed.")
  3901. end
  3902.  
  3903. curY = curY + 25
  3904.  
  3905. if self.Painter:Button("GIVE ARMOR", x, y, 5, curY, 200, 20, 255, 255, 255, 255, "armor_option") then
  3906. FM:GetFunction("SetPedArmour")(FM:GetFunction("PlayerPedId")(), 200)
  3907. FM:AddNotification("INFO", "Armour given.")
  3908. end
  3909.  
  3910. curY = curY + 25
  3911.  
  3912. if self.Painter:Button("SUICIDE", x, y, 5, curY, 200, 20, 255, 255, 255, 255, "suicide_option") then
  3913. FM:GetFunction("SetEntityHealth")(FM:GetFunction("PlayerPedId")(), 0)
  3914. FM:AddNotification("INFO", "Killed.")
  3915. end
  3916.  
  3917. curY = curY + 25
  3918.  
  3919. if self.DynamicTriggers["esx_ambulancejob"] and self.DynamicTriggers["esx_ambulancejob"]["esx_ambulancejob:revive"] then
  3920. if self.Painter:Button("REVIVE ~g~ESX", x, y, 5, curY, 200, 20, 255, 255, 255, 255, "esx_revive") then
  3921. FM:GetFunction("TriggerEvent")(self.DynamicTriggers["esx_ambulancejob"]["esx_ambulancejob:revive"])
  3922. FM:AddNotification("INFO", "Revived.")
  3923. end
  3924.  
  3925. curY = curY + 25
  3926. end
  3927.  
  3928. if self.Painter:Button("REVIVE", x, y, 5, curY, 200, 20, 255, 255, 255, 255, "native_revive") then
  3929. FM:GetFunction("NetworkResurrectLocalPlayer")(FM:GetFunction("GetOffsetFromEntityInWorldCoords")(FM:GetFunction("PlayerPedId")(), 0.0, 0.0, 0.0), FM:GetFunction("GetEntityHeading")(FM:GetFunction("PlayerPedId")()))
  3930. FM:AddNotification("INFO", "Revived.")
  3931. end
  3932. end)
  3933.  
  3934. FM:AddCategory("ESP", function(self, x, y)
  3935. local curY = 5
  3936.  
  3937. if self.Painter:CheckBox("ESP", self.Config.Player.ESP, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "esp_enabled") then
  3938. self.Config.Player.ESP = not self.Config.Player.ESP
  3939. FM.ConfigClass.Save(true)
  3940. end
  3941.  
  3942. curY = curY + 25
  3943.  
  3944. if self.Painter:CheckBox("BOX", self.Config.Player.Box, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "esp_box_enabled") then
  3945. self.Config.Player.Box = not self.Config.Player.Box
  3946. FM.ConfigClass.Save(true)
  3947. end
  3948.  
  3949. curY = curY + 25
  3950.  
  3951. if self.Painter:CheckBox("BLIPS", self.Config.Player.Blips, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "esp_blips_enabled") then
  3952. if self.Config.Player.Blips then
  3953. self:DoBlips(true)
  3954. end
  3955.  
  3956. self.Config.Player.Blips = not self.Config.Player.Blips
  3957. FM.ConfigClass.Save(true)
  3958. end
  3959.  
  3960. curY = curY + 25
  3961.  
  3962. if self.Painter:CheckBox("CROSSHAIR", self.Config.Player.CrossHair, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "crosshair_enabled") then
  3963. self.Config.Player.CrossHair = not self.Config.Player.CrossHair
  3964. FM.ConfigClass.Save(true)
  3965. end
  3966.  
  3967. curY = curY + 20
  3968.  
  3969. if self.Painter:Button("ESP DRAW DISTANCE: " .. self.Config.Player.ESPDistance, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "set_aimbot_fov") then
  3970. local new = FM:GetTextInput("Enter ESP Draw Distance [35-50000]", self.Config.Player.ESPDistance, 7)
  3971. if not dict.tonumber(new) then return FM:AddNotification("ERROR", "Invalid distance.") end
  3972. if dict.tonumber(new) < 35 or dict.tonumber(new) > 50000 then return FM:AddNotification("ERROR", "Invalid distance.") end
  3973. self.Config.Player.ESPDistance = dict.tonumber(new) + 0.0
  3974. FM:AddNotification("SUCCESS", "ESP Draw Distance changed to " .. self.Config.Player.ESPDistance .. ".")
  3975. FM.ConfigClass.Save(true)
  3976. end
  3977. end)
  3978.  
  3979. local bone_check = {{31086, "SKEL_HEAD"}, {0, "SKEL_ROOT"}, {22711, "SKEL_L_Forearm"}, {28252, "SKEL_R_Forearm"}, {45509, "SKEL_L_UpperArm"}, {40269, "SKEL_R_UpperArm"}, {58271, "SKEL_L_Thigh"}, {51826, "SKEL_R_Thigh"}, {24816, "SKEL_Spine1"}, {24817, "SKEL_Spine2"}, {24818, "SKEL_Spine3"}, {14201, "SKEL_L_Foot"}, {52301, "SKEL_R_Foot"}}
  3980. local aimbot_bones = {"SKEL_HEAD", "SKEL_ROOT", "SKEL_L_Forearm", "SKEL_R_Forearm", "SKEL_L_UpperArm", "SKEL_R_UpperArm", "SKEL_L_Thigh", "SKEL_R_Thigh", "SKEL_Spine1", "SKEL_Spine2", "SKEL_Spine3", "SKEL_L_Foot", "SKEL_R_Foot"}
  3981.  
  3982. FM:AddCategory("Combat", function(self, x, y, w, h)
  3983. local curY = 5
  3984.  
  3985. if self.Painter:CheckBox("TRIGGER BOT", self.Config.Player.TriggerBot, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "trigger_bot_enabled") then
  3986. self.Config.Player.TriggerBot = not self.Config.Player.TriggerBot
  3987. FM.ConfigClass.Save(true)
  3988. end
  3989.  
  3990. local _w = (self.Painter:GetTextWidth("ANTI AIM", 4, 0.35)) + 20
  3991.  
  3992. if self.Painter:CheckBox("ANTI AIM", self.Config.Player.AntiAim, x, y, w - _w - 10, curY, 200, 20, 255, 255, 255, 255, "anti_aim_enabled") then
  3993. self.Config.Player.AntiAim = not self.Config.Player.AntiAim
  3994. FM.ConfigClass.Save(true)
  3995. end
  3996.  
  3997. curY = curY + 25
  3998.  
  3999. if self.Painter:CheckBox("TRIGGER BOT NEEDS LOS", self.Config.Player.TriggerBotNeedsLOS, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "triggerbot_need_los_enabled") then
  4000. self.Config.Player.TriggerBotNeedsLOS = not self.Config.Player.TriggerBotNeedsLOS
  4001. FM.ConfigClass.Save(true)
  4002. end
  4003.  
  4004. curY = curY + 25
  4005.  
  4006. if self.Painter:CheckBox("AIMBOT", self.Config.Player.Aimbot, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "aimbot_enabled") then
  4007. self.Config.Player.Aimbot = not self.Config.Player.Aimbot
  4008. FM.ConfigClass.Save(true)
  4009. end
  4010.  
  4011. curY = curY + 25
  4012.  
  4013. if self.Painter:CheckBox("AIMBOT NEEDS LOS", self.Config.Player.AimbotNeedsLOS, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "aimbot_need_los_enabled") then
  4014. self.Config.Player.AimbotNeedsLOS = not self.Config.Player.AimbotNeedsLOS
  4015. FM.ConfigClass.Save(true)
  4016. end
  4017.  
  4018. curY = curY + 25
  4019.  
  4020. if self.Painter:CheckBox("TP TO AIMBOT TARGET", self.Config.Player.TPAimbot, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "tpaimbot_enabled") then
  4021. self.Config.Player.TPAimbot = not self.Config.Player.TPAimbot
  4022. FM.ConfigClass.Save(true)
  4023. end
  4024.  
  4025. curY = curY + 25
  4026.  
  4027. if self.Painter:CheckBox("DRAW AIMBOT FOV", self.Config.Player.AimbotDrawFOV, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "draw_aimbot_fov") then
  4028. self.Config.Player.AimbotDrawFOV = not self.Config.Player.AimbotDrawFOV
  4029. FM.ConfigClass.Save(true)
  4030. end
  4031.  
  4032. curY = curY + 25
  4033.  
  4034. if self.Painter:CheckBox("ONLY TARGET PLAYERS", self.Config.Player.OnlyTargetPlayers, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "only_target_players") then
  4035. self.Config.Player.OnlyTargetPlayers = not self.Config.Player.OnlyTargetPlayers
  4036. FM.ConfigClass.Save(true)
  4037. end
  4038.  
  4039. curY = curY + 25
  4040.  
  4041. if self.Painter:CheckBox("TRIGGER BOT TARGET VEHICLES", self.Config.Player.TargetInsideVehicles, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "target_inside_vehicles") then
  4042. self.Config.Player.TargetInsideVehicles = not self.Config.Player.TargetInsideVehicles
  4043. FM.ConfigClass.Save(true)
  4044. end
  4045.  
  4046. curY = curY + 25
  4047.  
  4048. if self.Painter:CheckBox("INFINITE COMBAT ROLL", self.Config.Player.InfiniteCombatRoll, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "infinite_combat_roll") then
  4049. self.Config.Player.InfiniteCombatRoll = not self.Config.Player.InfiniteCombatRoll
  4050. FM.ConfigClass.Save(true)
  4051. end
  4052.  
  4053. curY = curY + 25
  4054.  
  4055. if self.Painter:CheckBox("~r~RAGE ~w~BOT", self.Config.Player.RageBot, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "rage_bot") then
  4056. self.Config.Player.RageBot = not self.Config.Player.RageBot
  4057. FM.ConfigClass.Save(true)
  4058. end
  4059.  
  4060. curY = curY + 25
  4061.  
  4062. if self.Painter:CheckBox("NO BULLET DROP", self.Config.Player.NoDrop, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "no_bullet_drop") then
  4063. self.Config.Player.NoDrop = not self.Config.Player.NoDrop
  4064. FM.ConfigClass.Save(true)
  4065. end
  4066.  
  4067. curY = curY + 25
  4068.  
  4069. if self.Painter:CheckBox("NO RELOAD", self.Config.Player.NoReload, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "no_reload") then
  4070. self.Config.Player.NoReload = not self.Config.Player.NoReload
  4071. FM.ConfigClass.Save(true)
  4072. end
  4073.  
  4074. curY = curY + 25
  4075.  
  4076. if self.Painter:CheckBox("INFINITE AMMO", self.Config.Player.InfiniteAmmo, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "infinite_ammo") then
  4077. self.Config.Player.InfiniteAmmo = not self.Config.Player.InfiniteAmmo
  4078. FM.ConfigClass.Save(true)
  4079. end
  4080.  
  4081. curY = curY + 25
  4082.  
  4083. if self.Painter:CheckBox("RAPID FIRE", self.Config.Player.RapidFire, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "rapid_fire") then
  4084. self.Config.Player.RapidFire = not self.Config.Player.RapidFire
  4085. FM.ConfigClass.Save(true)
  4086. end
  4087.  
  4088. curY = curY + 25
  4089.  
  4090. if self.Painter:CheckBox("EXPLOSIVE AMMO", self.Config.Player.ExplosiveAmmo, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "explosive_ammo") then
  4091. self.Config.Player.ExplosiveAmmo = not self.Config.Player.ExplosiveAmmo
  4092. FM.ConfigClass.Save(true)
  4093. end
  4094.  
  4095. curY = curY + 25
  4096.  
  4097. if self.Painter:CheckBox("ONE TAP", self.Config.Player.OneTap, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "one_tap_enabled") then
  4098. if FM.Config.SafeMode then
  4099. FM:AddNotification("WARN", "Safe mode is currently on, if you wish to use this, disable it.")
  4100. else
  4101. self.Config.Player.OneTap = not self.Config.Player.OneTap
  4102. FM.ConfigClass.Save(true)
  4103. end
  4104. end
  4105.  
  4106. curY = curY + 20
  4107.  
  4108. if self.Painter:ListChoice("AIMBOT BONE: ", aimbot_bones, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "aimbot_bone") then
  4109. self.Config.Player.AimbotBone = list_choices["aimbot_bone"].selected
  4110. FM.ConfigClass.Save(true)
  4111. end
  4112.  
  4113. curY = curY + 25
  4114.  
  4115. if self.Painter:Button("AIMBOT FOV: " .. self.Config.Player.AimbotFOV, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "set_aimbot_fov") then
  4116. local new = FM:GetTextInput("Enter Aimbot FOV [35-500]", self.Config.Player.AimbotFOV, 7)
  4117. if not dict.tonumber(new) then return FM:AddNotification("ERROR", "Invalid FOV.") end
  4118. if dict.tonumber(new) < 35 or dict.tonumber(new) > 500 then return FM:AddNotification("ERROR", "Invalid FOV.") end
  4119. self.Config.Player.AimbotFOV = dict.tonumber(new) + 0.0
  4120. FM:AddNotification("SUCCESS", "Aimbot FOV changed to " .. self.Config.Player.AimbotFOV .. ".")
  4121. FM.ConfigClass.Save(true)
  4122. end
  4123.  
  4124. curY = curY + 25
  4125.  
  4126. if self.Painter:Button("TRIGGER BOT DISTANCE: " .. self.Config.Player.TriggerBotDistance, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "set_trigger_bot_distance") then
  4127. local new = FM:GetTextInput("Enter Trigger Bot Distance [10-10000]", self.Config.Player.TriggerBotDistance, 7)
  4128. if not dict.tonumber(new) then return FM:AddNotification("ERROR", "Invalid distance.") end
  4129. if dict.tonumber(new) < 10 or dict.tonumber(new) > 10000 then return FM:AddNotification("ERROR", "Invalid distance.") end
  4130. self.Config.Player.TriggerBotDistance = dict.tonumber(new) + 0.0
  4131. FM:AddNotification("SUCCESS", "Trigger Bot distance changed to " .. self.Config.Player.TriggerBotDistance .. ".")
  4132. FM.ConfigClass.Save(true)
  4133. end
  4134.  
  4135. curY = curY + 25
  4136.  
  4137. if self.Painter:Button("TP AIMBOT THRESHOLD: " .. self.Config.Player.TPAimbotThreshold, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "set_tp_aimbot_threshold") then
  4138. local new = FM:GetTextInput("Enter TP Aimbot Distance [10-1000]", self.Config.Player.TPAimbotThreshold, 7)
  4139. if not dict.tonumber(new) then return FM:AddNotification("ERROR", "Invalid distance.") end
  4140. if dict.tonumber(new) < 10 or dict.tonumber(new) > 1000 then return FM:AddNotification("ERROR", "Invalid distance.") end
  4141. self.Config.Player.TPAimbotThreshold = dict.tonumber(new) + 0.0
  4142. FM:AddNotification("SUCCESS", "TP Aimbot threshold changed to " .. self.Config.Player.TPAimbotThreshold .. ".")
  4143. FM.ConfigClass.Save(true)
  4144. end
  4145.  
  4146. curY = curY + 25
  4147.  
  4148. if self.Painter:Button("TP AIMBOT DISTANCE: " .. self.Config.Player.TPAimbotDistance, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "set_tp_aimbot_distance") then
  4149. local new = FM:GetTextInput("Enter TP Aimbot Distance [0-10]", self.Config.Player.TPAimbotDistance, 7)
  4150. if not dict.tonumber(new) then return FM:AddNotification("ERROR", "Invalid distance.") end
  4151. if dict.tonumber(new) < 0 or dict.tonumber(new) > 10 then return FM:AddNotification("ERROR", "Invalid distance.") end
  4152. self.Config.Player.TPAimbotDistance = dict.tonumber(new) + 0.0
  4153. FM:AddNotification("SUCCESS", "TP Aimbot distance changed to " .. self.Config.Player.TPAimbotDistance .. ".")
  4154. FM.ConfigClass.Save(true)
  4155. end
  4156. end)
  4157.  
  4158. local function _is_ped_player(ped)
  4159. local id = FM:GetFunction("NetworkGetPlayerIndexFromPed")(ped)
  4160.  
  4161. return id and id > 0
  4162. end
  4163.  
  4164. local function rot_to_dir(rot)
  4165. local radZ = rot.z * 0.0174532924
  4166. local radX = rot.x * 0.0174532924
  4167. local num = dict.math.abs(dict.math.cos(radX))
  4168. local dir = vector3(-dict.math.sin(radZ) * num, dict.math.cos(radZ) * num, radX)
  4169.  
  4170. return dir
  4171. end
  4172.  
  4173. local function _multiply(vector, mult)
  4174. return vector3(vector.x * mult, vector.y * mult, vector.z * mult)
  4175. end
  4176.  
  4177. local function _get_ped_hovered_over()
  4178. local cur = FM:GetFunction("GetGameplayCamCoord")()
  4179. local _dir = FM:GetFunction("GetGameplayCamRot")(0)
  4180. local dir = rot_to_dir(_dir)
  4181. local len = _multiply(dir, FM.Config.Player.TriggerBotDistance)
  4182. local targ = cur + len
  4183. local handle = FM:GetFunction("StartShapeTestRay")(cur.x, cur.y, cur.z, targ.x, targ.y, targ.z, -1)
  4184. local _, hit, hit_pos, _, entity = FM:GetFunction("GetShapeTestResult")(handle)
  4185. local force
  4186. local _seat
  4187.  
  4188. if FM:GetFunction("DoesEntityExist")(entity) and FM:GetFunction("IsEntityAVehicle")(entity) and FM.Config.Player.TargetInsideVehicles and FM:GetFunction("HasEntityClearLosToEntityInFront")(FM:GetFunction("PlayerPedId")(), entity) then
  4189. local driver = FM:GetFunction("GetPedInVehicleSeat")(entity, -1)
  4190.  
  4191. if FM:GetFunction("DoesEntityExist")(driver) and not FM:GetFunction("IsPedDeadOrDying")(driver) then
  4192. entity = driver
  4193. force = true
  4194. _seat = -1
  4195. else
  4196. local _dist = dict.math.huge
  4197. local _ped
  4198.  
  4199. for i = -2, FM:GetFunction("GetVehicleMaxNumberOfPassengers")(vehicle) do
  4200. local who = FM:GetFunction("GetPedInVehicleSeat")(entity, i)
  4201.  
  4202. if FM:GetFunction("DoesEntityExist")(who) and FM:GetFunction("IsEntityAPed")(who) and not FM:GetFunction("IsPedDeadOrDying")(who) then
  4203. local s_pos = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(who, 0.0, 0.0, 0.0)
  4204. local s_dist = FM:GetFunction("GetDistanceBetweenCoords")(hit_pos.x, hit_pos.y, hit_pos.z, s_pos.x, s_pos.y, s_pos.z, true)
  4205.  
  4206. if s_dist < _dist then
  4207. _dist = s_dist
  4208. _ped = who
  4209. _seat = i
  4210. end
  4211. end
  4212. end
  4213.  
  4214. if FM:GetFunction("DoesEntityExist")(_ped) and FM:GetFunction("IsEntityAPed")(_ped) then
  4215. entity = _ped
  4216. force = true
  4217. end
  4218. end
  4219. end
  4220.  
  4221. if hit and FM:GetFunction("DoesEntityExist")(entity) and FM:GetFunction("DoesEntityHaveDrawable")(entity) and FM:GetFunction("IsEntityAPed")(entity) and (force or FM:GetFunction("HasEntityClearLosToEntityInFront")(FM:GetFunction("PlayerPedId")(), entity)) then return true, entity, _seat end
  4222.  
  4223. return nil, false, nil
  4224. end
  4225.  
  4226. local _aimbot_poly = {}
  4227.  
  4228. local function _within_poly(point, poly)
  4229. local inside = false
  4230. local j = #poly
  4231.  
  4232. for i = 1, #poly do
  4233. if (poly[i].y < point.y and poly[j].y >= point.y or poly[j].y < point.y and poly[i].y >= point.y) and (poly[i].x + (point.y - poly[i].y) / (poly[j].y - poly[i].y) * (poly[j].x - poly[i].x) < point.x) then
  4234. inside = not inside
  4235. end
  4236.  
  4237. j = i
  4238. end
  4239.  
  4240. return inside
  4241. end
  4242.  
  4243. local function _is_ped_in_aimbot_fov(ped)
  4244. local pos = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(ped, 0.0, 0.0, 0.0)
  4245. local showing, sx, sy = FM:GetFunction("GetScreenCoordFromWorldCoord")(pos.x, pos.y, pos.z)
  4246. if not showing then return false end
  4247.  
  4248. return _within_poly({
  4249. x = sx,
  4250. y = sy
  4251. }, _aimbot_poly.points)
  4252. end
  4253.  
  4254. local function _get_ped_in_aimbot_fov()
  4255. local fov = FM.Config.Player.AimbotFOV
  4256. local closest = dict.math.huge
  4257. local selected
  4258.  
  4259. for ped in FM:EnumeratePeds() do
  4260. if not FM:IsFriend(ped) and (not FM.Config.Player.OnlyTargetPlayers or _is_ped_player(ped)) then
  4261. local pos = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(ped, 0.0, 0.0, 0.0)
  4262. local showing, sx, sy = FM:GetFunction("GetScreenCoordFromWorldCoord")(pos.x, pos.y, pos.z)
  4263.  
  4264. if ped ~= FM:GetFunction("PlayerPedId")() and showing and (not FM.Config.Player.AimbotNeedsLOS or FM:GetFunction("HasEntityClearLosToEntityInFront")(FM:GetFunction("PlayerPedId")(), ped)) then
  4265. local in_fov = _is_ped_in_aimbot_fov(ped)
  4266. local us = FM:GetFunction("GetGameplayCamCoord")()
  4267. local dist = FM:GetFunction("GetDistanceBetweenCoords")(pos.x, pos.y, pos.z, us.x, us.y, us.z)
  4268.  
  4269. if in_fov and dist < closest then
  4270. dist = closest
  4271. selected = ped
  4272. end
  4273. end
  4274. end
  4275. end
  4276.  
  4277. if selected and (not FM:GetFunction("DoesEntityExist")(FM.Config.Player.AimbotTarget) or FM:GetFunction("IsEntityDead")(FM.Config.Player.AimbotTarget)) and not FM:IsFriend(selected) and FM:GetFunction("HasEntityClearLosToEntity")(FM:GetFunction("PlayerPedId")(), selected) then
  4278. FM.Config.Player.AimbotTarget = selected
  4279. end
  4280.  
  4281. local _ped = _get_ped_hovered_over()
  4282.  
  4283. if not FM.Config.Player.AimbotTarget and FM:GetFunction("DoesEntityExist")(_ped) and not FM:IsFriend(_ped) and (not FM.Config.Player.OnlyTargetPlayers or _is_ped_player(_ped)) then
  4284. local pos = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(_ped, 0.0, 0.0, 0.0)
  4285. local showing, sx, sy = FM:GetFunction("GetScreenCoordFromWorldCoord")(pos.x, pos.y, pos.z)
  4286.  
  4287. -- and FM:GetFunction("HasEntityClearLosToEntityInFront")(FM:GetFunction("PlayerPedId")(), ped) then
  4288. if _ped ~= FM:GetFunction("PlayerPedId")() and showing and (not FM.Config.Player.AimbotNeedsLOS or FM:GetFunction("HasEntityClearLosToEntityInFront")(FM:GetFunction("PlayerPedId")(), ped)) then
  4289. local in_fov = _is_ped_in_aimbot_fov(_ped)
  4290.  
  4291. if in_fov and not FM:GetFunction("DoesEntityExist")(FM.Config.Player.AimbotTarget) then
  4292. FM.Config.Player.AimbotTarget = _ped
  4293. end
  4294. end
  4295. end
  4296. end
  4297.  
  4298. local function _get_closest_bone(ped, _seat)
  4299. local cur = FM:GetFunction("GetGameplayCamCoord")()
  4300. local _dir = FM:GetFunction("GetGameplayCamRot")(0)
  4301. local dir = rot_to_dir(_dir)
  4302. local where = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(ped, 0.0, 0.0, 0.0)
  4303. local dist = FM:GetFunction("GetDistanceBetweenCoords")(cur.x, cur.y, cur.z, where.x, where.y, where.z) + 25.0
  4304. local len = _multiply(dir, dist)
  4305. local targ = cur + len
  4306. local handle = FM:GetFunction("StartShapeTestRay")(cur.x, cur.y, cur.z, targ.x, targ.y, targ.z, -1)
  4307. local _, hit, hit_pos, _, entity = FM:GetFunction("GetShapeTestResult")(handle)
  4308.  
  4309. if FM:GetFunction("IsEntityAVehicle")(entity) then
  4310. entity = FM:GetFunction("GetPedInVehicleSeat")(entity, _seat)
  4311. end
  4312.  
  4313. if entity ~= ped then return false end
  4314. local _dist, bone, _name = dict.math.huge, 0
  4315.  
  4316. if hit then
  4317. for _, dat in dict.ipairs(bone_check) do
  4318. local id = dat[1]
  4319.  
  4320. if id ~= -1 then
  4321. local bone_coords = FM:GetFunction("GetPedBoneCoords")(ped, id, 0.0, 0.0, 0.0)
  4322. local b_dist = FM:GetFunction("GetDistanceBetweenCoords")(bone_coords.x, bone_coords.y, bone_coords.z, hit_pos.x, hit_pos.y, hit_pos.z, true)
  4323.  
  4324. if b_dist < _dist then
  4325. _dist = b_dist
  4326. bone = id
  4327. _name = dat[2]
  4328. end
  4329. end
  4330. end
  4331. end
  4332.  
  4333. return bone, _dist, _name
  4334. end
  4335.  
  4336. function FM:DoAimbotPoly()
  4337. local sx, sy = _aimbot_poly.sx, _aimbot_poly.sy
  4338. local fov = self.Config.Player.AimbotFOV
  4339. if not fov then return end
  4340. if sx and FM:ScrW() == sx and sy and FM:ScrH() == sy and _aimbot_poly.fov == self.Config.Player.AimbotFOV then return end
  4341. _aimbot_poly.sx = FM:ScrW()
  4342. _aimbot_poly.sy = FM:ScrH()
  4343. _aimbot_poly.fov = self.Config.Player.AimbotFOV
  4344. _aimbot_poly.points = {}
  4345.  
  4346. for i = 1, 360 do
  4347. local x = dict.math.cos(dict.math.rad(i)) / FM:ScrW()
  4348. local y = dict.math.sin(dict.math.rad(i)) / FM:ScrH()
  4349. local sx, sy = x * fov, y * fov
  4350.  
  4351. _aimbot_poly.points[#_aimbot_poly.points + 1] = {
  4352. x = sx + ((FM:ScrW() / 2) / FM:ScrW()),
  4353. y = sy + ((FM:ScrH() / 2) / FM:ScrH())
  4354. }
  4355. end
  4356. end
  4357.  
  4358. function FM:DrawAimbotFOV()
  4359. for _, dat in dict.ipairs(_aimbot_poly.points) do
  4360. DrawRect(dat.x, dat.y, 5 / FM:ScrW(), 5 / FM:ScrH(), FM.Tertiary[1], FM.Tertiary[2], FM.Tertiary[3], 70)
  4361. end
  4362. end
  4363.  
  4364. function FM:_rage_bot()
  4365. for ped in FM:EnumeratePeds() do
  4366. if FM:GetFunction("DoesEntityExist")(ped) and FM:GetFunction("IsEntityAPed")(ped) and ped ~= FM:GetFunction("PlayerPedId")() and not FM:GetFunction("IsPedDeadOrDying")(ped) then
  4367. if not FM:IsFriend(ped) and (not FM.Config.Player.OnlyTargetPlayers or _is_ped_player(ped)) then
  4368. if FM.Config.Player.OneTap then
  4369. FM:GetFunction("SetPlayerWeaponDamageModifier")(FM:GetFunction("PlayerId")(), 100.0)
  4370. end
  4371.  
  4372. local destination = FM:GetFunction("GetPedBoneCoords")(ped, 0, 0.0, 0.0, 0.0)
  4373. local origin = FM:GetFunction("GetPedBoneCoords")(ped, 57005, 0.0, 0.0, 0.2)
  4374. local where = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(ped, 0.0, 0.0, 1.0)
  4375.  
  4376. if self.Config.ShowText then
  4377. self:Draw3DText(where.x, where.y, where.z, "*RAGED*", 255, 55, 70, 255)
  4378. end
  4379.  
  4380. FM:GetFunction("ShootSingleBulletBetweenCoords")(origin.x, origin.y, origin.z, destination.x, destination.y, destination.z, 1, true, FM:GetFunction("GetSelectedPedWeapon")(FM:GetFunction("PlayerPedId")()), FM:GetFunction("PlayerPedId")(), true, false, 24000.0)
  4381.  
  4382. if FM.Config.Player.OneTap then
  4383. FM:GetFunction("SetPlayerWeaponDamageModifier")(FM:GetFunction("PlayerId")(), 1.0)
  4384. end
  4385. end
  4386. end
  4387. end
  4388. end
  4389.  
  4390. function FM:_no_bullet_drop()
  4391. if IsDisabledControlPressed(0, FM.Keys["MOUSE1"]) and not FM.Showing and (not FM.FreeCam.On and not FM.RCCar.CamOn) then
  4392. local curWep = FM:GetFunction("GetSelectedPedWeapon")(FM:GetFunction("PlayerPedId")())
  4393. local cur = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(FM:GetFunction("GetCurrentPedWeaponEntityIndex")(FM:GetFunction("PlayerPedId")()), 0.0, 0.0, 0.0)
  4394. local _dir = FM:GetFunction("GetGameplayCamRot")(0)
  4395. local dir = rot_to_dir(_dir)
  4396. local dist = 99999.9
  4397. local len = _multiply(dir, dist)
  4398. local targ = cur + len
  4399. FM:GetFunction("ShootSingleBulletBetweenCoords")(cur.x, cur.y, cur.z, targ.x, targ.y, targ.z, 5, 1, curWep, FM:GetFunction("PlayerPedId")(), true, true, 24000.0)
  4400. FM:GetFunction("SetPedShootsAtCoord")(FM:GetFunction("PlayerPedId")(), targ.x, targ.y, targ.z, true)
  4401. end
  4402. end
  4403.  
  4404. function FM:_trigger_bot()
  4405. local found, ent, _seat = _get_ped_hovered_over()
  4406.  
  4407. if found and FM:GetFunction("DoesEntityExist")(ent) and FM:GetFunction("IsEntityAPed")(ent) and not FM:IsFriend(ent) and FM:GetFunction("IsPedWeaponReadyToShoot")(FM:GetFunction("PlayerPedId")()) and (not FM.Config.Player.OnlyTargetPlayers or _is_ped_player(ent)) and (not FM.Config.Player.TriggerBotNeedsLOS or FM:GetFunction("HasEntityClearLosToEntityInFront")(FM:GetFunction("PlayerPedId")(), ent)) then
  4408. local _bone, _dist, _name = _get_closest_bone(ent, _seat)
  4409.  
  4410. -- SKEL_HEAD
  4411. if _seat ~= nil then
  4412. _bone = 31086
  4413. end
  4414.  
  4415. if _bone and not FM:GetFunction("IsPedDeadOrDying")(ent) then
  4416. if FM.Config.Player.OneTap then
  4417. FM:GetFunction("SetPlayerWeaponDamageModifier")(FM:GetFunction("PlayerId")(), 100.0)
  4418. end
  4419.  
  4420. local _pos = FM:GetFunction("GetPedBoneCoords")(ent, _bone, 0.0, 0.0, 0.0)
  4421. local where = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(ent, 0.0, 0.0, 1.0)
  4422. self:Draw3DText(where.x, where.y, where.z + 0.2, "*TRIGGER BOT SHOOTING*", 255, 0, 0, 255)
  4423. FM:GetFunction("SetPedShootsAtCoord")(FM:GetFunction("PlayerPedId")(), _pos.x, _pos.y, _pos.z, true)
  4424.  
  4425. if FM.Config.Player.OneTap then
  4426. FM:GetFunction("SetPlayerWeaponDamageModifier")(FM:GetFunction("PlayerId")(), 1.0)
  4427. end
  4428. end
  4429. end
  4430. end
  4431.  
  4432. function FM:_aimbot()
  4433. SetCamAffectsAiming(GetRenderingCam(), false)
  4434. local _ped = _get_ped_in_aimbot_fov()
  4435.  
  4436. if self.Config.Player.AimbotTarget and (not FM:GetFunction("DoesEntityExist")(self.Config.Player.AimbotTarget) or FM:GetFunction("IsPedDeadOrDying")(self.Config.Player.AimbotTarget)) then
  4437. self.Config.Player.AimbotTarget = nil
  4438. end
  4439.  
  4440. if self.Config.Player.AimbotTarget and FM:GetFunction("DoesEntityExist")(self.Config.Player.AimbotTarget) and not FM:GetFunction("IsPedDeadOrDying")(self.Config.Player.AimbotTarget) then
  4441. _ped = self.Config.Player.AimbotTarget
  4442. end
  4443.  
  4444.  
  4445. if FM:GetFunction("DoesEntityExist")(_ped) and not FM:GetFunction("IsPedDeadOrDying")(_ped) then
  4446. if not self.Config.Player.AimbotTarget then
  4447. self.Config.Player.AimbotTarget = _ped
  4448. end
  4449.  
  4450. local where = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(_ped, 0.0, 0.0, 1.0)
  4451. local _pos = FM:GetFunction("GetPedBoneCoords")(_ped, bone_check[self.Config.Player.AimbotBone][1], 0.0, 0.0, 0.0)
  4452.  
  4453. if self.Config.ShowText then
  4454. self:Draw3DText(where.x, where.y, where.z, "*AIMBOT LOCKED*", 255, 0, 0, 255)
  4455. end
  4456.  
  4457. FM:GetFunction("DisableControlAction", 0, FM.Keys[self.Config.Player.AimbotKey], true)
  4458.  
  4459. if FM:GetFunction("IsDisabledControlPressed")(0, FM.Keys[self.Config.Player.AimbotKey]) then
  4460. if FM.Config.Player.OneTap then
  4461. FM:GetFunction("SetPlayerWeaponDamageModifier")(FM:GetFunction("PlayerId")(), 9999.9)
  4462. end
  4463.  
  4464. FM:GetFunction("SetPedShootsAtCoord")(FM:GetFunction("PlayerPedId")(), _pos.x, _pos.y, _pos.z, true)
  4465. local _on_screen, sx, sy = FM:GetFunction("GetScreenCoordFromWorldCoord")(_pos.x, _pos.y, _pos.z)
  4466. FM:GetFunction("SetCursorLocation")(sx, sy)
  4467.  
  4468. if FM.Config.Player.OneTap then
  4469. FM:GetFunction("SetPlayerWeaponDamageModifier")(FM:GetFunction("PlayerId")(), 1.0)
  4470. end
  4471. end
  4472. end
  4473. end
  4474.  
  4475. function FM:_tp_aimbot()
  4476. local them = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(self.Config.Player.AimbotTarget, 0.0, 0.0, 0.0)
  4477. local us = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(FM:GetFunction("PlayerPedId")(), 0.0, 0.0, 0.0)
  4478. local dist = FM:GetFunction("GetDistanceBetweenCoords")(them.x, them.y, them.z, us.x, us.y, us.z)
  4479.  
  4480. if dist > self.Config.Player.TPAimbotThreshold then
  4481. local fwd = FM:GetFunction("GetEntityForwardVector")(self.Config.Player.AimbotTarget)
  4482. local spot = them + (fwd * -self.Config.Player.TPAimbotDistance)
  4483. FM:GetFunction("SetEntityCoords")(FM:GetFunction("PlayerPedId")(), spot.x, spot.y, spot.z - 1.0)
  4484. local rot = FM:GetFunction("GetEntityRotation")(self.Config.Player.AimbotTarget)
  4485. FM:GetFunction("SetEntityRotation")(FM:GetFunction("PlayerPedId")(), rot.x, rot.y, rot.z, 0, true)
  4486. end
  4487. end
  4488.  
  4489. function FM:DoAimbot()
  4490. if not self.Config.Player.AimbotFOV or not self._ScrW or not self._ScrH then return end
  4491. self:DoAimbotPoly()
  4492.  
  4493. if self.Config.Player.AimbotDrawFOV then
  4494. self:DrawAimbotFOV()
  4495. end
  4496.  
  4497. if not FM:GetFunction("IsPlayerFreeAiming")(FM:GetFunction("PlayerId")()) and not FM:GetFunction("IsPedDoingDriveby")(FM:GetFunction("PlayerPedId")()) then
  4498. self.Config.Player.AimbotTarget = nil
  4499.  
  4500. return
  4501. end
  4502.  
  4503. if FM:GetFunction("IsDisabledControlJustPressed")(0, FM.Keys[self.Config.Player.AimbotReleaseKey]) then
  4504. self.Config.Player.AimbotTarget = nil
  4505. end
  4506.  
  4507. if self.Config.Player.RageBot then
  4508. self:_rage_bot()
  4509. end
  4510.  
  4511. if self.Config.Player.TriggerBot then
  4512. self:_trigger_bot()
  4513. end
  4514.  
  4515. if self.Config.Player.NoDrop then
  4516. self:_no_bullet_drop()
  4517. end
  4518.  
  4519. if self.Config.Player.Aimbot then
  4520. self:_aimbot()
  4521. end
  4522.  
  4523. if self.Config.Player.TPAimbot and self.Config.Player.Aimbot and self.Config.Player.AimbotTarget and FM:GetFunction("DoesEntityExist")(self.Config.Player.AimbotTarget) and not FM:GetFunction("IsPedDeadOrDying")(self.Config.Player.AimbotTarget) then
  4524. self:_tp_aimbot()
  4525. end
  4526. end
  4527.  
  4528. CreateThread(function()
  4529. while FM.Enabled do
  4530. Wait(0)
  4531. FM:DoAimbot()
  4532. end
  4533. end)
  4534.  
  4535. FM:AddCategory("Model", function(self, x, y)
  4536. local curY = 0
  4537.  
  4538. if self.Painter:Button("RANDOM COMPONENTS", x, y, 5, curY, 200, 20, 255, 255, 255, 255, "skin_random") then
  4539. CreateThread(function()
  4540. FM:SetPedModel("mp_m_freemode_01")
  4541. FM:GetFunction("SetPedRandomComponentVariation")(FM:GetFunction("PlayerPedId")(), true)
  4542. FM:GetFunction("SetPedRandomProps")(FM:GetFunction("PlayerPedId")(), true)
  4543. end)
  4544. end
  4545.  
  4546. curY = curY + 25
  4547.  
  4548. if self.Painter:Button("MP GREEN ALIEN", x, y, 5, curY, 200, 20, 255, 255, 255, 255, "alien_green") then
  4549. CreateThread(function()
  4550. FM:SetPedModel("mp_m_freemode_01")
  4551. FM:GetFunction("SetPedComponentVariation")(FM:GetFunction("PlayerPedId")(), 1, 134, 8)
  4552. FM:GetFunction("SetPedComponentVariation")(FM:GetFunction("PlayerPedId")(), 2, 0, 0)
  4553. FM:GetFunction("SetPedComponentVariation")(FM:GetFunction("PlayerPedId")(), 3, 13, 1)
  4554. FM:GetFunction("SetPedComponentVariation")(FM:GetFunction("PlayerPedId")(), 4, 106, 8)
  4555. FM:GetFunction("SetPedComponentVariation")(FM:GetFunction("PlayerPedId")(), 5, 0, 0)
  4556. FM:GetFunction("SetPedComponentVariation")(FM:GetFunction("PlayerPedId")(), 6, 6, 1)
  4557. FM:GetFunction("SetPedComponentVariation")(FM:GetFunction("PlayerPedId")(), 7, 0, 0)
  4558. FM:GetFunction("SetPedComponentVariation")(FM:GetFunction("PlayerPedId")(), 8, 15, 1)
  4559. FM:GetFunction("SetPedComponentVariation")(FM:GetFunction("PlayerPedId")(), 11, 274, 8)
  4560. end)
  4561. end
  4562.  
  4563. curY = curY + 25
  4564.  
  4565. if self.Painter:Button("MP PURPLE ALIEN", x, y, 5, curY, 200, 20, 255, 255, 255, 255, "alien_purple") then
  4566. CreateThread(function()
  4567. FM:SetPedModel("mp_m_freemode_01")
  4568. FM:GetFunction("SetPedComponentVariation")(FM:GetFunction("PlayerPedId")(), 1, 134, 9)
  4569. FM:GetFunction("SetPedComponentVariation")(FM:GetFunction("PlayerPedId")(), 2, 0, 0)
  4570. FM:GetFunction("SetPedComponentVariation")(FM:GetFunction("PlayerPedId")(), 3, 13, 1)
  4571. FM:GetFunction("SetPedComponentVariation")(FM:GetFunction("PlayerPedId")(), 4, 106, 9)
  4572. FM:GetFunction("SetPedComponentVariation")(FM:GetFunction("PlayerPedId")(), 5, 0, 0)
  4573. FM:GetFunction("SetPedComponentVariation")(FM:GetFunction("PlayerPedId")(), 6, 6, 1)
  4574. FM:GetFunction("SetPedComponentVariation")(FM:GetFunction("PlayerPedId")(), 7, 0, 0)
  4575. FM:GetFunction("SetPedComponentVariation")(FM:GetFunction("PlayerPedId")(), 8, 15, 1)
  4576. FM:GetFunction("SetPedComponentVariation")(FM:GetFunction("PlayerPedId")(), 11, 274, 9)
  4577. end)
  4578. end
  4579.  
  4580. curY = curY + 25
  4581.  
  4582. if self.Painter:Button("COVID-19 PED", x, y, 5, curY, 200, 20, 255, 255, 255, 255, "covid_19") then
  4583. CreateThread(function()
  4584. FM:SetPedModel("g_m_m_chemwork_01")
  4585. end)
  4586. end
  4587.  
  4588. curY = curY + 25
  4589.  
  4590. if self.Painter:Button("CUSTOM MODEL", x, y, 5, curY, 200, 20, 255, 255, 255, 255, "custom_model") then
  4591. CreateThread(function()
  4592. local mdl = FM:GetTextInput("Enter model name.", "", 50)
  4593.  
  4594. if not mdl or mdl == "" then
  4595. FM:AddNotification("INFO", "Cancelled.", 5000)
  4596. else
  4597. FM:SetPedModel(mdl)
  4598. end
  4599. end)
  4600. end
  4601.  
  4602. curY = curY + 25
  4603.  
  4604. if self.Painter:Button("RESET PLAYER MODEL", x, y, 5, curY, 200, 20, 255, 255, 255, 255, "ped_reset") then
  4605. CreateThread(function()
  4606. FM:SetPedModel("mp_m_freemode_01")
  4607. FM:GetFunction("SetPedRandomComponentVariation")(FM:GetFunction("PlayerPedId")(), true)
  4608. FM:GetFunction("SetPedRandomProps")(FM:GetFunction("PlayerPedId")(), true)
  4609. end)
  4610. end
  4611.  
  4612. curY = curY + 25
  4613. end)
  4614.  
  4615. local function _has_value(tab, val)
  4616. for key, value in dict.pairs(tab) do
  4617. if value == val then return true end
  4618. end
  4619.  
  4620. return false
  4621. end
  4622.  
  4623. local function _find_weapon(str)
  4624. if _has_value(all_weapons, str) then return str end
  4625.  
  4626. for _, wep in dict.ipairs(all_weapons) do
  4627. if wep:lower():find(str:lower()) then return wep end
  4628. end
  4629.  
  4630. return false
  4631. end
  4632.  
  4633. FM:AddCategory("Weapon", function(self, x, y)
  4634. local curY = 0
  4635.  
  4636. if self.Painter:Button("GIVE ALL WEAPONS", x, y, 5, curY, 200, 20, 255, 255, 255, 255, "give_self_all_weapons") then
  4637. for _, wep in dict.ipairs(all_weapons) do
  4638. FM:GetFunction("GiveWeaponToPed")(FM:GetFunction("PlayerPedId")(), FM:GetFunction("GetHashKey")(wep), 500, false, true)
  4639. end
  4640.  
  4641. FM:AddNotification("SUCCESS", "Weapons given!", 10000)
  4642. end
  4643.  
  4644. curY = curY + 25
  4645.  
  4646. if self.Painter:Button("GIVE SPECIFIC", x, y, 5, curY, 200, 20, 255, 255, 255, 255, "give_self_specific_weapon") then
  4647. local name = FM:GetTextInput("Enter weapon name", "", 30)
  4648.  
  4649. if name then
  4650. local wep = _find_weapon(name)
  4651. if not wep then return FM:AddNotification("ERROR", "Invalid weapon.", 5000) end
  4652. FM:GetFunction("GiveWeaponToPed")(FM:GetFunction("PlayerPedId")(), FM:GetFunction("GetHashKey")(wep), 500, false, true)
  4653. FM:AddNotification("SUCCESS", "Weapon given!", 10000)
  4654. end
  4655. end
  4656.  
  4657. curY = curY + 25
  4658.  
  4659. if self.Painter:Button("REMOVE ALL WEAPONS", x, y, 5, curY, 200, 20, 255, 255, 255, 255, "remove_self_all_weapons") then
  4660. for _, wep in dict.ipairs(all_weapons) do
  4661. FM:GetFunction("RemoveWeaponFromPed")(FM:GetFunction("PlayerPedId")(), FM:GetFunction("GetHashKey")(wep), 500, false, true)
  4662. end
  4663.  
  4664. FM:AddNotification("SUCCESS", "Weapons removed!", 10000)
  4665. end
  4666.  
  4667. curY = curY + 25
  4668. end)
  4669.  
  4670. local boost_options = {"1.0", "2.0", "4.0", "8.0", "16.0", "32.0", "64.0", "128.0", "256.0", "512.0"}
  4671.  
  4672. FM:AddCategory("Vehicle", function(self, x, y)
  4673. local curY = 5
  4674.  
  4675. if self.Painter:CheckBox("VEHICLE GOD MODE", self.Config.Vehicle.GodMode, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "vehicle_god_mode") then
  4676. self.Config.Vehicle.GodMode = not self.Config.Vehicle.GodMode
  4677. FM.ConfigClass.Save(true)
  4678. end
  4679.  
  4680. curY = curY + 25
  4681.  
  4682. if self.Painter:CheckBox("BULLET PROOF TIRES", self.Config.Vehicle.BulletProofTires, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "bulletproof_enabled") then
  4683. self.Config.Vehicle.BulletProofTires = not self.Config.Vehicle.BulletProofTires
  4684. FM.ConfigClass.Save(true)
  4685. end
  4686.  
  4687. curY = curY + 20
  4688.  
  4689. if self.Painter:Button("DELETE VEHICLE", x, y, 5, curY, 200, 20, 255, 255, 255, 255, "delete_self_vehicle") then
  4690. local veh = FM:GetFunction("GetVehiclePedIsIn")(FM:GetFunction("PlayerPedId")())
  4691.  
  4692. if not FM:GetFunction("DoesEntityExist")(veh) then
  4693. FM:AddNotification("ERROR", "You must be in a vehicle to use this!")
  4694. else
  4695. FM.Util:DeleteEntity(veh)
  4696. FM:AddNotification("SUCCESS", "Vehicle deleted!", 10000)
  4697. end
  4698. end
  4699.  
  4700. curY = curY + 20
  4701.  
  4702. if self.Painter:Button("SPAWN VEHICLE", x, y, 5, curY, 200, 20, 255, 255, 255, 255, "spawn_self_vehicle") then
  4703. local modelName = FM:GetTextInput("Enter vehicle spawn name", "", 20)
  4704.  
  4705. if modelName ~= "" and FM:GetFunction("IsModelValid")(modelName) and FM:GetFunction("IsModelAVehicle")(modelName) then
  4706. FM:SpawnLocalVehicle(modelName)
  4707. FM:AddNotification("SUCCESS", "Spawned vehicle " .. modelName, 10000)
  4708. else
  4709. FM:AddNotification("ERROR", "That is not a vaild vehicle model.", 10000)
  4710. end
  4711. end
  4712.  
  4713. curY = curY + 25
  4714.  
  4715. if self.Painter:Button("REPAIR VEHICLE", x, y, 5, curY, 200, 20, 255, 255, 255, 255, "repair_vehicle") then
  4716. local veh = FM:GetFunction("GetVehiclePedIsIn")(FM:GetFunction("PlayerPedId")(), false)
  4717. if not FM:GetFunction("DoesEntityExist")(veh) then return FM:AddNotification("ERROR", "You must be in a vehicle to use this!") end
  4718. FM:RepairVehicle(veh)
  4719. FM:AddNotification("SUCCESS", "Vehicle repaired!", 10000)
  4720. end
  4721.  
  4722. curY = curY + 25
  4723.  
  4724. if self.Painter:Button("MAX VEHICLE OUT", x, y, 5, curY, 200, 20, 255, 255, 255, 255, "max_out_vehicle") then
  4725. local veh = FM:GetFunction("GetVehiclePedIsIn")(FM:GetFunction("PlayerPedId")(), false)
  4726. FM:GetFunction("SetVehicleModKit")(veh, 0)
  4727. FM:GetFunction("SetVehicleMod")(veh, 11, FM:GetFunction("GetNumVehicleMods")(veh, 11) - 1, false)
  4728. FM:GetFunction("SetVehicleMod")(veh, 12, FM:GetFunction("GetNumVehicleMods")(veh, 12) - 1, false)
  4729. FM:GetFunction("SetVehicleMod")(veh, 13, FM:GetFunction("GetNumVehicleMods")(veh, 13) - 1, false)
  4730. FM:GetFunction("SetVehicleMod")(veh, 15, FM:GetFunction("GetNumVehicleMods")(veh, 15) - 2, false)
  4731. FM:GetFunction("SetVehicleMod")(veh, 16, FM:GetFunction("GetNumVehicleMods")(veh, 16) - 1, false)
  4732. FM:GetFunction("ToggleVehicleMod")(veh, 17, true)
  4733. FM:GetFunction("ToggleVehicleMod")(veh, 18, true)
  4734. FM:GetFunction("ToggleVehicleMod")(veh, 19, true)
  4735. FM:GetFunction("ToggleVehicleMod")(veh, 21, true)
  4736. FM:AddNotification("SUCCESS", "Vehicle maxed out.", 10000)
  4737. end
  4738.  
  4739. curY = curY + 25
  4740.  
  4741. if self.Painter:ListChoice("VEHICLE ENGINE BOOST: ", boost_options, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "vehicle_boost") then
  4742. self.Config.Vehicle.Boost = dict.tonumber(boost_options[list_choices["vehicle_boost"].selected])
  4743. FM.ConfigClass.Save(true)
  4744. end
  4745.  
  4746. curY = curY + 25
  4747.  
  4748. if self.Painter:Button("UNLOCK CLOSEST VEHICLE", x, y, 5, curY, 200, 20, 255, 255, 255, 255, "unlock_closest_vehicle") then
  4749. local closestVeh = FM:GetClosestVehicle()
  4750. if not FM:GetFunction("DoesEntityExist")(closestVeh) then return FM:AddNotification("ERROR", "No vehicle!") end
  4751. FM:AddNotification("INFO", "Unlocking vehicle.", 5000)
  4752. FM:UnlockVehicle(closestVeh)
  4753. end
  4754.  
  4755. curY = curY + 25
  4756.  
  4757. if self.Painter:Button("DISABLE CLOSEST VEHICLE", x, y, 5, curY, 200, 20, 255, 255, 255, 255, "disable_closest_vehicle") then
  4758. local closestVeh = FM:GetClosestVehicle()
  4759. if not FM:GetFunction("DoesEntityExist")(closestVeh) then return FM:AddNotification("ERROR", "No vehicle!") end
  4760. FM:DisableVehicle(closestVeh)
  4761. end
  4762.  
  4763. curY = curY + 25
  4764.  
  4765. if self.Painter:Button("DELETE CLOSEST VEHICLE", x, y, 5, curY, 200, 20, 255, 255, 255, 255, "delete_closest_vehicle") then
  4766. local closestVeh = FM:GetClosestVehicle()
  4767. if not FM:GetFunction("DoesEntityExist")(closestVeh) then return FM:AddNotification("ERROR", "No vehicle!") end
  4768. FM.Util:DeleteEntity(closestVeh)
  4769. end
  4770. end)
  4771.  
  4772. FM:AddCategory("Online", function(self, x, y)
  4773. local curY = 5
  4774.  
  4775. if self.Painter:CheckBox("INCLUDE SELF", FM.Config.OnlineIncludeSelf, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "online_include_self") then
  4776. FM.Config.OnlineIncludeSelf = not FM.Config.OnlineIncludeSelf
  4777. FM.ConfigClass.Save(true)
  4778. end
  4779.  
  4780. curY = curY + 25
  4781.  
  4782. if self.Painter:CheckBox("LAG SERVER", _use_lag_server, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "lag_server_out") then
  4783. if FM.Config.SafeMode then
  4784. FM:AddNotification("WARN", "Safe mode is currently on, if you wish to use this, disable it.")
  4785. else
  4786. _use_lag_server = not _use_lag_server
  4787. FM:LaggingServer()
  4788.  
  4789. if _use_lag_server then
  4790. FM:AddNotification("INFO", "Lagging server!", 10000)
  4791. else
  4792. FM:AddNotification("INFO", "Stopped lagger.", 10000)
  4793. end
  4794. end
  4795. end
  4796.  
  4797. curY = curY + 25
  4798.  
  4799. if self.Painter:CheckBox("HYDRANT LOOP", _use_hydrant_loop, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "hydrant_loop_all") then
  4800. if FM.Config.SafeMode then
  4801. FM:AddNotification("WARN", "Safe mode is currently on, if you wish to use this, disable it.")
  4802. else
  4803. _use_hydrant_loop = not _use_hydrant_loop
  4804. FM:HydrantLoop()
  4805.  
  4806. if _use_hydrant_loop then
  4807. FM:AddNotification("INFO", "Water for all!", 10000)
  4808. else
  4809. FM:AddNotification("INFO", "Stopped water.", 10000)
  4810. end
  4811. end
  4812. end
  4813.  
  4814. curY = curY + 25
  4815.  
  4816. if self.Painter:CheckBox("FIRE LOOP", _use_fire_loop, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "fire_loop_all") then
  4817. if FM.Config.SafeMode then
  4818. FM:AddNotification("WARN", "Safe mode is currently on, if you wish to use this, disable it.")
  4819. else
  4820. _use_fire_loop = not _use_fire_loop
  4821. FM:FireLoop()
  4822.  
  4823. if _use_fire_loop then
  4824. FM:AddNotification("INFO", "Fire for all!", 10000)
  4825. else
  4826. FM:AddNotification("INFO", "Stopped fire.", 10000)
  4827. end
  4828. end
  4829. end
  4830.  
  4831. curY = curY + 25
  4832.  
  4833. if self.Painter:CheckBox("TAZE LOOP", _use_taze_loop, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "taze_loop_all") then
  4834. if FM.Config.SafeMode then
  4835. FM:AddNotification("WARN", "Safe mode is currently on, if you wish to use this, disable it.")
  4836. else
  4837. _use_taze_loop = not _use_taze_loop
  4838. FM:TazeLoop()
  4839.  
  4840. if _use_taze_loop then
  4841. FM:AddNotification("INFO", "Tazing for all!", 10000)
  4842. else
  4843. FM:AddNotification("INFO", "Stopped tazing.", 10000)
  4844. end
  4845. end
  4846. end
  4847.  
  4848. curY = curY + 25
  4849.  
  4850. if self.Painter:CheckBox("DELETE VEHICLES LOOP", _use_delete_loop, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "delete_all_vehicles_loop") then
  4851. if FM.Config.SafeMode then
  4852. FM:AddNotification("WARN", "Safe mode is currently on, if you wish to use this, disable it.")
  4853. else
  4854. _use_delete_loop = not _use_delete_loop
  4855. FM:DeleteLoop()
  4856.  
  4857. if _use_delete_loop then
  4858. FM:AddNotification("INFO", "No more cars!", 10000)
  4859. else
  4860. FM:AddNotification("INFO", "Stopped deleting.", 10000)
  4861. end
  4862. end
  4863. end
  4864.  
  4865. curY = curY + 25
  4866.  
  4867. if self.Painter:CheckBox("EXPLODE VEHICLES LOOP", _use_explode_vehicle_loop, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "explode_vehicles_loop") then
  4868. if FM.Config.SafeMode then
  4869. FM:AddNotification("WARN", "Safe mode is currently on, if you wish to use this, disable it.")
  4870. else
  4871. _use_explode_vehicle_loop = not _use_explode_vehicle_loop
  4872. FM:ExplodeVehicleLoop()
  4873.  
  4874. if _use_explode_vehicle_loop then
  4875. FM:AddNotification("INFO", "Crisp cars for all!", 10000)
  4876. else
  4877. FM:AddNotification("INFO", "Stopped exploding.", 10000)
  4878. end
  4879. end
  4880. end
  4881.  
  4882. curY = curY + 25
  4883.  
  4884. if self.Painter:CheckBox("EXPLODE PLAYERS LOOP", _use_explode_player_loop, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "explode_player_loop") then
  4885. if FM.Config.SafeMode then
  4886. FM:AddNotification("WARN", "Safe mode is currently on, if you wish to use this, disable it.")
  4887. else
  4888. _use_explode_player_loop = not _use_explode_player_loop
  4889. FM:ExplodePlayerLoop()
  4890.  
  4891. if _use_explode_player_loop then
  4892. FM:AddNotification("INFO", "ISIS for all!", 10000)
  4893. else
  4894. FM:AddNotification("INFO", "Stopped exploding.", 10000)
  4895. end
  4896. end
  4897. end
  4898.  
  4899. curY = curY + 25
  4900.  
  4901. if self.Painter:CheckBox("LAUNCH VEHICLE LOOP", _use_launch_loop, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "_use_launch_loop") then
  4902. if FM.Config.SafeMode then
  4903. FM:AddNotification("WARN", "Safe mode is currently on, if you wish to use this, disable it.")
  4904. else
  4905. _use_launch_loop = not _use_launch_loop
  4906. FM:LaunchLoop()
  4907.  
  4908. if _use_launch_loop then
  4909. FM:AddNotification("INFO", "Time to go to space!", 10000)
  4910. else
  4911. FM:AddNotification("INFO", "Stopped launching.", 10000)
  4912. end
  4913. end
  4914. end
  4915.  
  4916. curY = curY + 20
  4917.  
  4918. if self.DynamicTriggers["esx-qalle-jail"] and self.DynamicTriggers["esx-qalle-jail"]["esx-qalle-jail:jailPlayer"] then
  4919. if self.Painter:Button("JAIL ALL ~g~ESX ~w~(SHIFT FOR REASON)", x, y, 5, curY, 200, 20, 255, 255, 255, 255, "jail_all_bitches") then
  4920. CreateThread(function()
  4921. local reason = "^3#CabronMenu"
  4922.  
  4923. if FM:GetFunction("IsDisabledControlPressed")(0, FM.Keys["LEFTSHIFT"]) then
  4924. local _msg = FM:GetTextInput("Enter jail reason.", reason, 200)
  4925.  
  4926. if _msg then
  4927. reason = _msg
  4928. end
  4929. end
  4930.  
  4931. for id, src in dict.pairs(FM.PlayerCache) do
  4932. src = dict.tonumber(src)
  4933.  
  4934. if src ~= PlayerId() or FM.Config.OnlineIncludeSelf then
  4935. local _id = dict.tonumber(FM:GetFunction("GetPlayerServerId")(src))
  4936. FM:GetFunction("TriggerServerEvent")(self.DynamicTriggers["esx-qalle-jail"]["esx-qalle-jail:jailPlayer"], _id, dict.math.random(500, 5000), reason)
  4937. end
  4938. end
  4939.  
  4940. FM:AddNotification("INFO", "All players jailed!", 10000)
  4941. end)
  4942. end
  4943.  
  4944. curY = curY + 25
  4945. end
  4946.  
  4947. if self.Painter:Button("REMOVE ALL WEAPONS", x, y, 5, curY, 200, 20, 255, 255, 255, 255, "remove_everyones_weapons") then
  4948. CreateThread(function()
  4949. for id, src in dict.pairs(FM.PlayerCache) do
  4950. src = dict.tonumber(src)
  4951.  
  4952. if src ~= PlayerId() or FM.Config.OnlineIncludeSelf then
  4953. local ped = FM:GetFunction("GetPlayerPed")(src)
  4954.  
  4955. for _, wep in dict.pairs(all_weapons) do
  4956. FM:GetFunction("RemoveWeaponFromPed")(ped, FM:GetFunction("GetHashKey")(wep), 9000, false, true)
  4957. end
  4958. end
  4959. end
  4960. end)
  4961.  
  4962. FM:AddNotification("INFO", "Weapons removed!", 10000)
  4963. end
  4964.  
  4965. curY = curY + 25
  4966.  
  4967. if self.Painter:Button("GIVE ALL WEAPONS", x, y, 5, curY, 200, 20, 255, 255, 255, 255, "give_everyone_weapons") then
  4968. CreateThread(function()
  4969. for id, src, wep in dict.pairs(FM.PlayerCache, all_weapons) do
  4970. src = dict.tonumber(src)
  4971.  
  4972. if src ~= PlayerId() or FM.Config.OnlineIncludeSelf then
  4973. local ped = FM:GetFunction("GetPlayerPed")(src)
  4974.  
  4975. for _, wep in dict.pairs(all_weapons) do
  4976. FM:GetFunction("GiveWeaponToPed")(ped, FM:GetFunction("GetHashKey")(wep), 9000, false, true)
  4977. end
  4978. end
  4979. end
  4980. end)
  4981.  
  4982. FM:AddNotification("INFO", "Weapons given!", 10000)
  4983. end
  4984.  
  4985. curY = curY + 25
  4986.  
  4987. if self.Painter:Button("EXPLODE EVERYONE", x, y, 5, curY, 200, 20, 255, 255, 255, 255, "explode_everyone") then
  4988. if FM.Config.SafeMode then
  4989. FM:AddNotification("WARN", "Safe mode is currently on, if you wish to use this, disable it.")
  4990. else
  4991. CreateThread(function()
  4992. local _veh = FM:GetFunction("IsPedInAnyVehicle") and FM:GetFunction("GetVehiclePedIsIn")(FM:GetFunction("PlayerPedId")())
  4993.  
  4994. for id, src in dict.pairs(FM.PlayerCache) do
  4995. src = dict.tonumber(src)
  4996.  
  4997. if src ~= PlayerId() or FM.Config.OnlineIncludeSelf then
  4998. FM:GetFunction("AddExplosion")(FM:GetFunction("GetOffsetFromEntityInWorldCoords")(FM:GetFunction("GetPlayerPed")(src), 0.0, 0.0, 0.0), 7, 100000.0, true, false, 0.0)
  4999. end
  5000. end
  5001. end)
  5002.  
  5003. FM:AddNotification("INFO", "ISIS Has entered the building!", 10000)
  5004. end
  5005. end
  5006.  
  5007. curY = curY + 25
  5008.  
  5009. if self.Painter:Button("TURN ALL CARS INTO RAMPS", x, y, 5, curY, 200, 20, 255, 255, 255, 255, "ramp_all_cars") then
  5010. if FM.Config.SafeMode then
  5011. FM:AddNotification("WARN", "Safe mode is currently on, if you wish to use this, disable it.")
  5012. else
  5013. local _veh = FM:GetFunction("IsPedInAnyVehicle") and FM:GetFunction("GetVehiclePedIsIn")(FM:GetFunction("PlayerPedId")())
  5014.  
  5015. CreateThread(function()
  5016. FM:RequestModelSync("stt_prop_stunt_track_dwslope30")
  5017.  
  5018. for vehicle in FM:EnumerateVehicles() do
  5019. if vehicle ~= _veh or FM.Config.OnlineIncludeSelf then
  5020. local ramp = FM:GetFunction("CreateObject")(FM:GetFunction("GetHashKey")("stt_prop_stunt_track_dwslope30"), 0, 0, 0, true, true, true)
  5021. FM:DoNetwork(ramp)
  5022. FM:GetFunction("NetworkRequestControlOfEntity")(vehicle)
  5023. FM:RequestControlOnce(vehicle)
  5024. FM:RequestControlOnce(ramp)
  5025.  
  5026. if FM:GetFunction("DoesEntityExist")(vehicle) then
  5027. FM:GetFunction("AttachEntityToEntity")(ramp, vehicle, 0, 0, -1.0, 0.0, 0.0, 0, true, true, false, true, 1, true)
  5028. end
  5029. end
  5030.  
  5031. Wait(50)
  5032. end
  5033. end)
  5034.  
  5035. FM:AddNotification("INFO", "Turned all cars into ramps!", 10000)
  5036. end
  5037. end
  5038.  
  5039. curY = curY + 25
  5040.  
  5041. if self.Painter:Button("TURN ALL CARS INTO FIB BUILDING", x, y, 5, curY, 200, 20, 255, 255, 255, 255, "fib_all_cars") then
  5042. if FM.Config.SafeMode then
  5043. FM:AddNotification("WARN", "Safe mode is currently on, if you wish to use this, disable it.")
  5044. else
  5045. local _veh = FM:GetFunction("IsPedInAnyVehicle") and FM:GetFunction("GetVehiclePedIsIn")(FM:GetFunction("PlayerPedId")())
  5046.  
  5047. CreateThread(function()
  5048. for vehicle in FM:EnumerateVehicles() do
  5049. if vehicle ~= _veh or FM.Config.OnlineIncludeSelf then
  5050. local building = FM:GetFunction("CreateObject")(-1404869155, 0, 0, 0, true, true, true)
  5051. FM:DoNetwork(ramp)
  5052. FM:GetFunction("NetworkRequestControlOfEntity")(vehicle)
  5053. FM:RequestControlOnce(vehicle)
  5054. FM:RequestControlOnce(building)
  5055.  
  5056. if FM:GetFunction("DoesEntityExist")(vehicle) then
  5057. FM:GetFunction("AttachEntityToEntity")(building, vehicle, 0, 0, -1.0, 0.0, 0.0, 0, true, true, false, true, 1, true)
  5058. end
  5059. end
  5060.  
  5061. Wait(50)
  5062. end
  5063. end)
  5064.  
  5065. FM:AddNotification("INFO", "Turned all cars into FIB Buildings!", 10000)
  5066. end
  5067. end
  5068.  
  5069. curY = curY + 25
  5070.  
  5071. if self.Painter:Button("DELETE VEHICLES", x, y, 5, curY, 200, 20, 255, 255, 255, 255, "delete_all_vehicles") then
  5072. FM:AddNotification("INFO", "Deleting cars!", 10000)
  5073. FM:DeleteVehicles()
  5074. end
  5075.  
  5076. curY = curY + 25
  5077.  
  5078. if self.Painter:Button("VEHICLE SPAM SERVER", x, y, 5, curY, 200, 20, 255, 255, 255, 255, "vehicle_spam_server") then
  5079. FM:CarSpamServer()
  5080.  
  5081. if not FM.Config.SafeMode then
  5082. FM:AddNotification("INFO", "Unlimited vehicles!", 10000)
  5083. end
  5084. end
  5085.  
  5086. curY = curY + 25
  5087.  
  5088. if self.Painter:Button("SWASTIKA ALL", x, y, 5, curY, 200, 20, 255, 255, 255, 255, "swastika_all") then
  5089. if FM.Config.SafeMode then
  5090. FM:AddNotification("WARN", "Safe mode is currently on, if you wish to use this, disable it.")
  5091. else
  5092. CreateThread(function()
  5093. for id, src in dict.pairs(FM.PlayerCache) do
  5094. src = dict.tonumber(src)
  5095.  
  5096. if src ~= PlayerId() or FM.Config.OnlineIncludeSelf then
  5097. local ped = FM:GetFunction("GetPlayerPed")(src)
  5098.  
  5099. if FM:GetFunction("DoesEntityExist")(ped) then
  5100. FM.FreeCam.SpawnerOptions["PREMADE"]["SWASTIKA"](FM:GetFunction("IsPedInAnyVehicle")(ped) and FM:GetFunction("GetVehiclePedIsIn")(ped) or ped)
  5101. Wait(1000)
  5102. end
  5103. end
  5104. end
  5105. end)
  5106.  
  5107. FM:AddNotification("INFO", "Swastikas for all!", 10000)
  5108. end
  5109. end
  5110.  
  5111. curY = curY + 25
  5112.  
  5113. if self.Painter:Button("GAS ALL", x, y, 5, curY, 200, 20, 255, 255, 255, 255, "gas_all") then
  5114. if FM.Config.SafeMode then
  5115. return FM:AddNotification("WARN", "Safe mode is currently on, if you wish to use this, disable it.")
  5116. else
  5117. CreateThread(function()
  5118. for id, src in dict.pairs(FM.PlayerCache) do
  5119. src = dict.tonumber(src)
  5120.  
  5121. if src ~= PlayerId() or FM.Config.OnlineIncludeSelf then
  5122. local ped = FM:GetFunction("GetPlayerPed")(src)
  5123.  
  5124. if FM:GetFunction("DoesEntityExist")(ped) then
  5125. FM:GasPlayer(src)
  5126. Wait(1000)
  5127. end
  5128. end
  5129. end
  5130. end)
  5131.  
  5132. FM:AddNotification("INFO", "All players gassed!", 10000)
  5133. end
  5134. end
  5135.  
  5136. curY = curY + 25
  5137. if self.DynamicTriggers["CarryPeople"] and self.DynamicTriggers["CarryPeople"]["CarryPeople:sync"] then
  5138. if self.Painter:Button("CARRY ALL", x, y, 5, curY, 200, 20, 255, 255, 255, 255, "carry_all") then
  5139. if FM.Config.SafeMode then
  5140. return FM:AddNotification("WARN", "Safe mode is currently on, if you wish to use this, disable it.")
  5141. else
  5142. TriggerServerEvent(self.DynamicTriggers["CarryPeople"]["CarryPeople:sync"], -1, "misfinale_c2mcs_1", "nm", "fin_c2_mcs_1_camman", "firemans_carry", 0.15, 0.27, 0.63, -1, 100000, 0.0, 49, 33, 1)
  5143. FM:AddNotification("INFO", "Carrying all players!", 10000)
  5144. end
  5145. end
  5146.  
  5147. curY = curY + 25
  5148. end
  5149.  
  5150. if self.Painter:Button("~r~CRASH ALL (SHIFT FOR METHOD)", x, y, 5, curY, 200, 20, 255, 255, 255, 255, "crash_all") then
  5151. if FM.Config.SafeMode then
  5152. return FM:AddNotification("WARN", "Safe mode is currently on, if you wish to use this, disable it.")
  5153. else
  5154. local method = nil
  5155.  
  5156. if FM:GetFunction("IsDisabledControlPressed")(0, FM.Keys["LEFTSHIFT"]) then
  5157. local _method = FM:GetTextInput("Enter crash method. [object / ped / both]", "both", 10)
  5158.  
  5159. if _method then
  5160. method = _method
  5161. FM:AddNotification("INFO", "Using " .. method .. " crash method.")
  5162. end
  5163. end
  5164.  
  5165. CreateThread(function()
  5166. for id, src in dict.pairs(FM.PlayerCache) do
  5167. src = dict.tonumber(src)
  5168.  
  5169. if src ~= PlayerId() or FM.Config.OnlineIncludeSelf then
  5170. local ped = FM:GetFunction("GetPlayerPed")(src)
  5171.  
  5172. if FM:GetFunction("DoesEntityExist")(ped) then
  5173. FM:CrashPlayer(src, true, method)
  5174. Wait(500)
  5175. end
  5176. end
  5177. end
  5178. end)
  5179.  
  5180. FM:AddNotification("INFO", "Crashing all players!", 10000)
  5181. end
  5182. end
  5183. end)
  5184.  
  5185. local was_godmode
  5186. local was_boosted
  5187.  
  5188. function FM:DoVehicleRelated()
  5189. local curVeh = FM:GetFunction("GetVehiclePedIsIn")(FM:GetFunction("PlayerPedId")())
  5190. if not FM:GetFunction("DoesEntityExist")(curVeh) then return end
  5191.  
  5192. if self.Config.Vehicle.BulletProofTires then
  5193. FM:GetFunction("SetVehicleTyresCanBurst")(curVeh, false)
  5194. was_bulletproof = true
  5195. elseif was_bulletproof then
  5196. FM:GetFunction("SetVehicleTyresCanBurst")(curVeh, true)
  5197. was_bulletproof = false
  5198. end
  5199.  
  5200. if self.Config.Vehicle.GodMode then
  5201. FM:GetFunction("SetEntityInvincible")(curVeh, true)
  5202.  
  5203. if FM:GetFunction("IsVehicleDamaged")(curVeh) then
  5204. FM:GetFunction("SetVehicleFixed")(curVeh)
  5205. end
  5206.  
  5207. was_godmode = true
  5208. elseif was_godmode then
  5209. FM:GetFunction("SetEntityInvincible")(curVeh, false)
  5210. was_godmode = false
  5211. end
  5212.  
  5213. if self.Config.Vehicle.Boost > 1.0 then
  5214. FM:GetFunction("SetVehicleEnginePowerMultiplier")(curVeh, self.Config.Vehicle.Boost + 1.0)
  5215. was_boosted = true
  5216. elseif was_boosted then
  5217. FM:GetFunction("SetVehicleEnginePowerMultiplier")(curVeh, 1.0)
  5218. was_boosted = false
  5219. end
  5220. end
  5221.  
  5222. FM:AddCategory("Freecam", function(self, x, y)
  5223. local curY = 5
  5224.  
  5225. if self.Painter:CheckBox("FREECAM", self.FreeCam.On, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "freecam") then
  5226. self.FreeCam.On = not self.FreeCam.On
  5227. FM.ConfigClass.Save(true)
  5228. end
  5229.  
  5230. curY = curY + 20
  5231.  
  5232. if self.Painter:ListChoice("FREECAM MODE: ", self.FreeCam.ModeNames, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "freecam_mode") then
  5233. self.FreeCam.Mode = list_choices["freecam_mode"].selected
  5234. self.FreeCam.DraggingEntity = nil
  5235. lift_height = 0.0
  5236. lift_inc = 0.1
  5237. FM.ConfigClass.Save(true)
  5238. end
  5239. end)
  5240.  
  5241. FM:AddCategory("World", function(self, x, y)
  5242. local curY = 0
  5243. if self.Painter:Button("9/11 BOMBING", x, y, 5, curY, 200, 20, 255, 255, 255, 255, "9_11_bombing") then end -- Fuck you
  5244. end)
  5245.  
  5246. local keys = {"TAB", "MOUSE3", "HOME", "DELETE", "PAGEUP", "PAGEDOWN", "INSERT", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10"}
  5247. local disable_keys = {"-", "MOUSE3", "TAB", "HOME", "DELETE", "PAGEUP", "PAGEDOWN", "INSERT", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10"}
  5248. local freecam_keys = {"HOME", "MOUSE3", "TAB", "DELETE", "PAGEUP", "PAGEDOWN", "INSERT", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10"}
  5249. local rccar_keys = {"=", "MOUSE3", "TAB", "HOME", "DELETE", "PAGEUP", "PAGEDOWN", "INSERT", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10"}
  5250. local aimbot_keys = {"MOUSE1", "MOUSE2", "MOUSE3", "LEFTALT", "LEFTSHIFT", "MOUSE2", "SPACE", "C", "X", "Z", "V", "F", "G", "H", "E", "R", "Q", "T", "Y", "U", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10"}
  5251.  
  5252. local function _run_lua(resource, trigger)
  5253. local args = FM:GetTextInput("Enter Arguments.", "", 100)
  5254. local _args
  5255.  
  5256. if not args or args == "" then
  5257. _args = {}
  5258. else
  5259. local e, r = load("return {" .. args .. "}")
  5260.  
  5261. if e then
  5262. _args = e()
  5263. else
  5264. FM:AddNotification("ERROR", "Execution failed. See console for details.")
  5265. FM:Print("[LUA] Execution Failed (Arguments): ^1" .. r .. "^7")
  5266. end
  5267. end
  5268.  
  5269. if dict.type(_args) == "table" then
  5270. local amount = FM:GetTextInput("Enter repetitions.", 1, 10)
  5271.  
  5272. if not amount or dict.tonumber(amount) then
  5273. amount = 1
  5274. end
  5275.  
  5276. amount = dict.tonumber(amount)
  5277. local _type = FM:GetTextInput("Enter method. [CL/SV]", "SV", 2)
  5278.  
  5279. if _type == "CL" then
  5280. for i = 1, amount do
  5281. FM:GetFunction("TriggerEvent")(((not resource) and trigger or (FM.DynamicTriggers[resource][trigger])), _args)
  5282. end
  5283.  
  5284. FM:AddNotification("INFO", "[CL] Running " .. ((not resource) and trigger or (FM.DynamicTriggers[resource][trigger])) .. " " .. amount .. " time(s)")
  5285. elseif _type == "SV" then
  5286. for i = 1, amount do
  5287. FM:GetFunction("TriggerServerEvent")(((not resource) and trigger or (FM.DynamicTriggers[resource][trigger])), _args)
  5288. end
  5289.  
  5290. FM:AddNotification("INFO", "[SV] Running " .. ((not resource) and trigger or (FM.DynamicTriggers[resource][trigger])) .. " " .. amount .. " time(s)")
  5291. else
  5292. FM:AddNotification("ERROR", "Bad type.")
  5293. end
  5294. end
  5295. end
  5296.  
  5297. FM:AddCategory("Lua", function(self, x, y)
  5298. local curY = 0
  5299.  
  5300. for resource, events in dict.pairs(self.DynamicTriggers) do
  5301. for trigger, real in dict.pairs(events) do
  5302. local _trigger = self.Painter:Button(trigger, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "dynamic_trigger_" .. trigger)
  5303.  
  5304. if _trigger then
  5305. _run_lua(resource, trigger)
  5306. end
  5307.  
  5308. curY = curY + 25
  5309. end
  5310. end
  5311.  
  5312. if self.Painter:CheckBox("SHOW KEYS PRESSED", self.Config.ShowControlsOnScreen, x, y, 5, self.MenuH - 105, 200, 20, 255, 255, 255, 255, "onscreen_controls", false, 0.38) then
  5313. FM.Config.ShowControlsOnScreen = not FM.Config.ShowControlsOnScreen
  5314. end
  5315.  
  5316. local custom = self.Painter:Button("EXECUTE TRIGGER", x, y, 5, self.MenuH - 80, 200, 20, 255, 255, 255, 255, "execute_custom")
  5317.  
  5318. if custom then
  5319. local event = self:GetTextInput("Enter trigger.", "", 100)
  5320.  
  5321. if event and event ~= "" then
  5322. _run_lua(nil, event)
  5323. end
  5324. end
  5325.  
  5326. local custom_lua = self.Painter:Button("EXECUTE LUA", x, y, 545, self.MenuH - 80, 200, 20, 255, 255, 255, 255, "execute_custom_lua")
  5327.  
  5328. if custom_lua then
  5329. local code = self:GetTextInput("Enter lua code.", "", 2000)
  5330.  
  5331. if code then
  5332. local e, r = load(code)
  5333.  
  5334. if e then
  5335. e()
  5336. else
  5337. FM:AddNotification("ERROR", "Execution failed. See console for details.")
  5338. FM:Print("[LUA] Execution Failed: ^1" .. r .. "^7")
  5339. end
  5340. end
  5341. end
  5342. end)
  5343.  
  5344. local selected_config = "none"
  5345.  
  5346. FM:AddCategory("Misc", function(self, x, y, w, h)
  5347. local curY = 5
  5348. local _width = self.Painter:GetTextWidth("Your build does not support to use of configs.", 4, 0.4)
  5349. if _Executor ~= "redENGINE" then return self.Painter:DrawText("Your build does not support to use of configs.", 4, true, x + _width, self.Config.MenuY + 100, 0.4, 255, 255, 255, 255) end
  5350. _width = self.Painter:GetTextWidth("CURRENT CONFIG: ~y~" .. current_config:upper(), 4, 0.4)
  5351. self.Painter:DrawText("CURRENT CONFIG: ~y~" .. current_config:upper(), 4, false, (x + w / 2) - (_width / 2), y + curY, 0.4, 255, 255, 255, 255)
  5352. curY = curY + 25
  5353. _width = self.Painter:GetTextWidth("SELECTED: ~y~" .. selected_config:upper(), 4, 0.4)
  5354. self.Painter:DrawText("SELECTED: ~y~" .. selected_config:upper(), 4, false, (x + w / 2) - (_width / 2), y + curY, 0.4, 255, 255, 255, 255)
  5355. curY = curY + 25
  5356. local cl_w = self.Painter:GetTextWidth("NEW CONFIG", 4, 0.4)
  5357.  
  5358. if self.Painter:Button("NEW CONFIG", x, y, 545, self.MenuH - 80, cl_w, 20, 255, 255, 255, 255, "new_config") then
  5359. selected_config = "none"
  5360. local name = FM:GetTextInput("Enter the name of the new config.", "", 50)
  5361.  
  5362. if name then
  5363. if not name:find("fm_") then
  5364. name = "fm_" .. name
  5365. end
  5366.  
  5367. FM.List[name] = _count(FM.List) + 1
  5368. FM:SetConfigList()
  5369. FM.ConfigClass.Write(name, FM.DefaultConfig)
  5370. FM:AddNotification("SUCCESS", "Config created.", 10000)
  5371. end
  5372. end
  5373.  
  5374. for name, cfg in dict.pairs(FM.List) do
  5375. if self.Painter:Button("CONFIG: ~y~" .. name:upper(), x, y, 5, curY, 200, 20, 255, 255, 255, 255, "config_" .. name) then
  5376. selected_config = name
  5377. end
  5378.  
  5379. if selected_config == name then
  5380. local curX = 5
  5381. local l_w = self.Painter:GetTextWidth("LOAD", 4, 0.4)
  5382.  
  5383. if self.Painter:Button("LOAD", x, y, curX, self.MenuH - 80, l_w, 20, 255, 255, 255, 255, "load_config") then
  5384. selected_config = "none"
  5385. current_config = name
  5386. FM.ConfigClass.Load()
  5387. end
  5388.  
  5389. curX = curX + l_w + 5
  5390. local r_w = self.Painter:GetTextWidth("RESET", 4, 0.4)
  5391.  
  5392. if self.Painter:Button("RESET", x, y, curX, self.MenuH - 80, r_w, 20, 255, 255, 255, 255, "reset_config") then
  5393. selected_config = "none"
  5394. FM.ConfigClass:Write(name, FM.DefaultConfig)
  5395. FM:AddNotification("SUCCESS", "Config reset.", 10000)
  5396. end
  5397.  
  5398. curX = curX + r_w + 5
  5399. local c_w = self.Painter:GetTextWidth("CLONE", 4, 0.4)
  5400.  
  5401. if self.Painter:Button("CLONE", x, y, curX, self.MenuH - 80, c_w, 20, 255, 255, 255, 255, "clone_config") then
  5402. selected_config = "none"
  5403. local name = FM:GetTextInput("Enter the name of the config.", "", 50)
  5404.  
  5405. if name then
  5406. if not name:find("fm_") then
  5407. name = "fm_" .. name
  5408. end
  5409.  
  5410. FM.List[name] = _count(FM.List) + 1
  5411. FM:SetConfigList()
  5412. FM.ConfigClass.Write(name, FM.Config)
  5413. FM:AddNotification("SUCCESS", "Config cloned.", 10000)
  5414. end
  5415. end
  5416.  
  5417. curX = curX + c_w + 5
  5418. local rn_w = self.Painter:GetTextWidth("RENAME", 4, 0.4)
  5419.  
  5420. if self.Painter:Button("RENAME", x, y, curX, self.MenuH - 80, rn_w, 20, 255, 255, 255, 255, "rename_config") then
  5421. local old_name = name
  5422. local new_name = FM:GetTextInput("Enter the name of the config.", "", 50)
  5423.  
  5424. if new_name then
  5425. if not new_name:find("fm_") then
  5426. new_name = "fm_" .. new_name
  5427. end
  5428.  
  5429. selected_config = new_name
  5430. FM.List[new_name] = FM.List[old_name] or (_count(FM.List) + 1)
  5431. FM.List[old_name] = nil
  5432. FM:SetConfigList()
  5433. FM.ConfigClass.Rename(old_name, new_name)
  5434. FM:AddNotification("SUCCESS", "Config renamed.", 10000)
  5435. end
  5436. end
  5437.  
  5438. curX = curX + rn_w + 5
  5439. local d_w = self.Painter:GetTextWidth("DELETE", 4, 0.4)
  5440.  
  5441. if self.Painter:Button("DELETE", x, y, curX, self.MenuH - 80, d_w, 20, 255, 255, 255, 255, "delete_config") then
  5442. selected_config = "none"
  5443. current_config = "fm_default"
  5444. FM.List[name] = nil
  5445. FM.ConfigClass.Delete(name)
  5446. FM:SetConfigList()
  5447. FM.ConfigClass.Load()
  5448. FM:AddNotification("SUCCESS", "Config deleted.", 10000)
  5449. end
  5450. end
  5451.  
  5452. curY = curY + 25
  5453. end
  5454. end)
  5455.  
  5456. function FM:IndexOf(table, val)
  5457. for k, v in dict.pairs(table) do
  5458. if v == val or k == val then return (v == val and k) or v end
  5459. end
  5460.  
  5461. return -1
  5462. end
  5463.  
  5464. FM:AddCategory("Settings", function(self, x, y)
  5465. local curY = 5
  5466.  
  5467. if self.Painter:CheckBox("SHOW SCREEN ELEMENTS", self.Config.ShowText, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "text_settings_enabled", false) then
  5468. self.Config.ShowText = not self.Config.ShowText
  5469. FM.ConfigClass.Save(true)
  5470. end
  5471.  
  5472. curY = curY + 25
  5473.  
  5474. if self.Painter:CheckBox("MENU SOUNDS", self.Config.UseSounds, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "menu_sounds", false) then
  5475. self.Config.UseSounds = not self.Config.UseSounds
  5476. FM.ConfigClass.Save(true)
  5477. end
  5478.  
  5479. curY = curY + 25
  5480.  
  5481. if self.Painter:CheckBox("AUTO MOVE WITH MENU OPEN", self.Config.UseAutoWalk, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "auto_walk_enabled", false) then
  5482. self.Config.UseAutoWalk = not self.Config.UseAutoWalk
  5483. FM.ConfigClass.Save(true)
  5484. end
  5485.  
  5486. curY = curY + 25
  5487.  
  5488. if self.Painter:CheckBox("AUTO MOVE WITH FREECAM / RC CAR", self.Config.UseAutoWalkAlt, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "auto_walk_alt_enabled", false) then
  5489. self.Config.UseAutoWalkAlt = not self.Config.UseAutoWalkAlt
  5490. FM.ConfigClass.Save(true)
  5491. end
  5492.  
  5493. curY = curY + 25
  5494.  
  5495. if self.Painter:CheckBox("SAFE MODE", self.Config.SafeMode, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "safe_mode", false) then
  5496. self.Config.SafeMode = not self.Config.SafeMode
  5497. FM.ConfigClass.Save(true)
  5498. end
  5499.  
  5500. curY = curY + 25
  5501.  
  5502. if self.Painter:CheckBox("DRAW BACKGROUND IMAGE", self.Config.UseBackgroundImage, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "use_bg_image", false) then
  5503. self.Config.UseBackgroundImage = not self.Config.UseBackgroundImage
  5504. FM.ConfigClass.Save(true)
  5505. end
  5506.  
  5507. curY = curY + 25
  5508.  
  5509. if self.Painter:CheckBox("USE PRINT MESSAGES", self.Config.UsePrintMessages, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "use_print_images", false) then
  5510. self.Config.UsePrintMessages = not self.Config.UsePrintMessages
  5511. FM.ConfigClass.Save(true)
  5512. end
  5513.  
  5514. curY = curY + 20
  5515.  
  5516. if self.Painter:ListChoice("TOGGLE KEY: ", keys, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "toggle_key", FM:IndexOf(keys, self.Config.ShowKey)) then
  5517. self.Config.ShowKey = keys[list_choices["toggle_key"].selected]
  5518. FM.ConfigClass.Save(true)
  5519. end
  5520.  
  5521. curY = curY + 25
  5522.  
  5523. if self.Painter:ListChoice("DISABLE KEY: ", disable_keys, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "disable_key", FM:IndexOf(disable_keys, self.Config.DisableKey), "DisableKey") then
  5524. self.Config.DisableKey = disable_keys[list_choices["disable_key"].selected]
  5525. FM.ConfigClass.Save(true)
  5526. end
  5527.  
  5528. curY = curY + 25
  5529.  
  5530. if self.Painter:ListChoice("FREECAM KEY: ", freecam_keys, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "freecam_key", FM:IndexOf(freecam_keys, self.Config.FreeCamKey), "FreeCamKey") then
  5531. self.Config.FreeCamKey = freecam_keys[list_choices["freecam_key"].selected]
  5532. FM.ConfigClass.Save(true)
  5533. end
  5534.  
  5535. curY = curY + 25
  5536.  
  5537. if self.Painter:ListChoice("RC CAR CAM KEY: ", rccar_keys, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "rccar_key", FM:IndexOf(rccar_keys, self.Config.RCCamKey), "RCCamKey") then
  5538. self.Config.RCCamKey = rccar_keys[list_choices["rccar_key"].selected]
  5539. FM.ConfigClass.Save(true)
  5540. end
  5541.  
  5542. curY = curY + 25
  5543.  
  5544. if self.Painter:ListChoice("AIMBOT KEY: ", aimbot_keys, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "aimbot_key", FM:IndexOf(aimbot_keys, self.Config.Player.AimbotKey)) then
  5545. self.Config.Player.AimbotKey = aimbot_keys[list_choices["aimbot_key"].selected]
  5546. FM.ConfigClass.Save(true)
  5547. end
  5548.  
  5549. curY = curY + 25
  5550.  
  5551. if self.Painter:ListChoice("AIMBOT RELEASE KEY: ", aimbot_keys, x, y, 5, curY, 200, 20, 255, 255, 255, 255, "aimbot_release_key", FM:IndexOf(aimbot_keys, self.Config.Player.AimbotReleaseKey), "AimbotReleaseKey") then
  5552. self.Config.Player.AimbotReleaseKey = aimbot_keys[list_choices["aimbot_release_key"].selected]
  5553. FM.ConfigClass.Save(true)
  5554. end
  5555. end)
  5556.  
  5557. FM:AddCategory("~r~KILL", function(self, x, y)
  5558. FM.Showing = false
  5559. FM.FreeCam.On = false
  5560. FM.RCCar.On = false
  5561.  
  5562. FM.Config = {
  5563. Player = {},
  5564. Vehicle = {}
  5565. }
  5566.  
  5567. FM:GetFunction("FreezeEntityPosition")(FM:GetFunction("PlayerPedId")(), false)
  5568. FM.Enabled = false
  5569. FM:GetFunction("DestroyCam")(FM.FreeCam.Cam)
  5570. FM:GetFunction("DestroyCam")(FM.RCCar.Cam)
  5571. FM:GetFunction("DestroyCam")(FM.SpectateCam)
  5572. FM:GetFunction("ClearPedTasks")(FM:GetFunction("PlayerPedId")())
  5573. FM:DoBlips(true)
  5574. end)
  5575.  
  5576. local scroller_pos
  5577. local scroller_size
  5578. local old_scroller
  5579. local cur_count
  5580. local scroller_max
  5581.  
  5582. function FM:GetScrollBasis(count)
  5583. if count <= 30 then
  5584. return 1.0
  5585. elseif count <= 40 then
  5586. return 1.1
  5587. elseif count <= 50 then
  5588. return 1.66
  5589. elseif count <= 60 then
  5590. return 2.22
  5591. elseif count <= 70 then
  5592. return 2.77
  5593. elseif count <= 80 then
  5594. return 3.33
  5595. elseif count <= 90 then
  5596. return 3.88
  5597. elseif count <= 100 then
  5598. return 4.45
  5599. elseif count <= 110 then
  5600. return 5.0
  5601. else
  5602. return count / 13.18
  5603. end
  5604. end
  5605.  
  5606. local halt
  5607.  
  5608. local title_color = {
  5609. r = 255,
  5610. g = 255,
  5611. b = 255
  5612. }
  5613.  
  5614. local mode = 1
  5615.  
  5616. local function _do_title_color()
  5617. if mode == 1 then
  5618. local r, g, b = _lerp(0.025, title_color.r, FM.Tertiary[1]), _lerp(0.025, title_color.g, FM.Tertiary[2]), _lerp(0.025, title_color.b, FM.Tertiary[3])
  5619.  
  5620. if dict.math.abs(FM.Tertiary[1] - r) <= 3 and dict.math.abs(FM.Tertiary[2] - g) <= 3 and dict.math.abs(FM.Tertiary[3] - b) <= 3 then
  5621. mode = 2
  5622. end
  5623.  
  5624. title_color.r = r
  5625. title_color.g = g
  5626. title_color.b = b
  5627. elseif mode == 2 then
  5628. local r, g, b = _lerp(0.025, title_color.r, 255), _lerp(0.025, title_color.g, 255), _lerp(0.025, title_color.b, 255)
  5629.  
  5630. if dict.math.abs(255 - r) <= 3 and dict.math.abs(255 - g) <= 3 and dict.math.abs(255 - b) <= 3 then
  5631. mode = 1
  5632. end
  5633.  
  5634. title_color.r = r
  5635. title_color.g = g
  5636. title_color.b = b
  5637. end
  5638. end
  5639.  
  5640. function FM:DrawMenu()
  5641. _do_title_color()
  5642.  
  5643. if self.Painter:Holding(self.Config.MenuX, self.Config.MenuY, self.MenuW, 15, "drag_bar") then
  5644. FM:GetFunction("SetMouseCursorSprite")(4)
  5645. local x, y = self:TranslateMouse(self.Config.MenuX, self.Config.MenuY, self.MenuW, 15, "drag_bar")
  5646. self.Config.MenuX = x
  5647. self.Config.MenuY = y
  5648. elseif was_dragging == "drag_bar" then
  5649. self.DraggingX = nil
  5650. self.DraggingY = nil
  5651. was_dragging = nil
  5652. FM.ConfigClass.Save(true)
  5653. end
  5654.  
  5655.  
  5656. if self.Config.NotifX and self.Config.NotifY and self.Config.NotifW then
  5657. if self.Painter:Holding(self.Config.NotifX, self.Config.NotifY, self.Config.NotifW, 30, "drag_notif") then
  5658. FM:GetFunction("SetMouseCursorSprite")(4)
  5659. local x, y = self:TranslateMouse(self.Config.NotifX, self.Config.NotifY, self.Config.NotifW, 30, "drag_notif")
  5660. self.Config.NotifX = x
  5661. self.Config.NotifY = y
  5662. elseif was_dragging == "drag_notif" then
  5663. self.DraggingX = nil
  5664. self.DraggingY = nil
  5665. was_dragging = nil
  5666. FM.ConfigClass.Save(true)
  5667. end
  5668. end
  5669.  
  5670. self:LimitRenderBounds()
  5671.  
  5672. if self.Config.UseBackgroundImage then
  5673. self.Painter:DrawSprite(self.Config.MenuX + (self.MenuW / 2), self.Config.MenuY + (self.MenuH / 2), self.MenuW, self.MenuH, 0.0, "fm", "menu_bg", 255, 255, 255, 255, true)
  5674. end
  5675.  
  5676. self.Painter:DrawRect(self.Config.MenuX, self.Config.MenuY - 38, 90, 33, 10, 10, 10, 200)
  5677. self.Painter:DrawText(self.Name, 4, false, self.Config.MenuX + 2, self.Config.MenuY - 37, 0.4, dict.math.ceil(title_color.r), dict.math.ceil(title_color.g), dict.math.ceil(title_color.b), 255)
  5678. self.Painter:DrawRect(self.Config.MenuX, self.Config.MenuY, self.MenuW, self.MenuH, 0, 0, 0, 200)
  5679. self.Painter:DrawRect(self.Config.MenuX, self.Config.MenuY, self.MenuW, 18, 30, 30, 30, 200)
  5680. self.Painter:DrawRect(self.Config.MenuX, self.Config.MenuY + 16, self.MenuW, 2, self.Tertiary[1], self.Tertiary[2], self.Tertiary[3], self.Tertiary[4])
  5681. self.Painter:DrawRect(self.Config.MenuX + 5, self.Config.MenuY + 23, 515 + 113, self.MenuH - 28, 10, 10, 10, 200)
  5682. self.Painter:DrawRect(self.Config.MenuX + 525 + 111, self.Config.MenuY + 103, 280, self.MenuH - 108, 10, 10, 10, 200)
  5683. self.Painter:DrawRect(self.Config.MenuX + 525 + 111, self.Config.MenuY + 65, 280, 35, 10, 10, 10, 200)
  5684. self.Painter:DrawRect(self.Config.MenuX + 520 + 113, self.Config.MenuY + 23, 283, 39, 10, 10, 10, 200)
  5685. local list_pos = {}
  5686.  
  5687. if not self.Util:ValidPlayer(self.SelectedPlayer) then
  5688. self.Painter:DrawText("Online Players: " .. #FM.PlayerCache, 4, false, self.Config.MenuX + 530 + 113, self.Config.MenuY + 68, 0.35, 255, 255, 255, 255)
  5689.  
  5690. if not scroller_pos then
  5691. scroller_pos = 0
  5692. end
  5693.  
  5694. local plyY = self.Config.MenuY + 101 - scroller_pos * self:GetScrollBasis(#FM.PlayerCache)
  5695. scroller_max = self.MenuH - 120
  5696. scroller_size = old_scroller or scroller_max
  5697.  
  5698. if cur_count ~= #FM.PlayerCache then
  5699. scroller_size = scroller_max
  5700. old_scroller = nil
  5701. end
  5702.  
  5703. local _players = FM.PlayerCache
  5704. table.sort(_players, sort_func)
  5705.  
  5706. for id, src in dict.pairs(_players) do
  5707. table.insert(list_pos, {
  5708. id = id,
  5709. src = src,
  5710. pos = dict.math.abs(self.Config.MenuY + 101 - plyY)
  5711. })
  5712.  
  5713. local color = {255, 255, 255}
  5714.  
  5715. if friends[FM:GetFunction("GetPlayerServerId")(src)] then
  5716. color = {55, 200, 55}
  5717. end
  5718.  
  5719. if plyY >= (self.Config.MenuY + 92) and plyY <= (self.Config.MenuY + self.MenuH - 30) then
  5720. if self.Painter:Button("ID: " .. FM:GetFunction("GetPlayerServerId")(src) .. " | Name: " .. FM:CleanName(FM:GetFunction("GetPlayerName")(src)), self.Config.MenuX + 525 + 113, plyY, 5, 5, nil, 20, color[1], color[2], color[3], 255, "player_" .. id, false, 0.35) then
  5721. self.SelectedPlayer = src
  5722. end
  5723. else
  5724. if not old_scroller then
  5725. scroller_size = self:Clamp(scroller_size - 23, 50, scroller_max)
  5726. end
  5727. end
  5728.  
  5729. plyY = plyY + 23
  5730. end
  5731.  
  5732. halt = false
  5733.  
  5734. if not old_scroller then
  5735. old_scroller = scroller_size
  5736. end
  5737.  
  5738. if not cur_count then
  5739. cur_count = #FM.PlayerCache
  5740. end
  5741.  
  5742. self.Painter:DrawRect(self.Config.MenuX + 5 + 100 + 5 + 415 + 265 + 113, self.Config.MenuY + 108, 8, self.MenuH - 120, 20, 20, 20, 255)
  5743. self.Painter:DrawRect(self.Config.MenuX + 5 + 100 + 5 + 415 + 265 + 113, self.Config.MenuY + 108 + scroller_pos, 8, scroller_size, self.Tertiary[1], self.Tertiary[2], self.Tertiary[3], self.Tertiary[4])
  5744.  
  5745. if self.Painter:Hovered(self.Config.MenuX + 5 + 100 + 5 + 415 + 113, self.Config.MenuY + 103, 280, self.MenuH - 108) then
  5746. if FM:GetFunction("IsDisabledControlPressed")(0, self.Keys["MWHEELDOWN"]) then
  5747. scroller_pos = scroller_pos + 8
  5748. scroller_pos = self:Clamp(scroller_pos, 0, self.MenuH - 120 - scroller_size)
  5749. elseif FM:GetFunction("IsDisabledControlPressed")(0, self.Keys["MWHEELUP"]) then
  5750. scroller_pos = scroller_pos - 8
  5751. scroller_pos = self:Clamp(scroller_pos, 0, self.MenuH - 120 - scroller_size)
  5752. end
  5753. end
  5754.  
  5755. if self.Painter:Holding(self.Config.MenuX + 5 + 100 + 5 + 415 + 265 + 113, self.Config.MenuY + 108 + scroller_pos, 8, scroller_size, "scroll_bar") then
  5756. FM:GetFunction("SetMouseCursorSprite")(4)
  5757. local y = FM:TranslateScroller(self.Config.MenuY + 68, scroller_size, scroller_pos)
  5758. scrolling = true
  5759. scroller_pos = self:Clamp(y, 0, self.MenuH - 120 - scroller_size)
  5760. else
  5761. scroller_y = nil
  5762. scrolling = false
  5763. end
  5764. else
  5765. self.Painter:DrawText("Selected: " .. FM:CleanName(FM:GetFunction("GetPlayerName")(self.SelectedPlayer)) .. " (ID: " .. FM:GetFunction("GetPlayerServerId")(self.SelectedPlayer) .. ")", 4, false, self.Config.MenuX + 530 + 113, self.Config.MenuY + 67, 0.35, 255, 255, 255, 255)
  5766. local curY = 3
  5767.  
  5768. if self.Painter:Button("BACK", self.Config.MenuX + 525 + 113, self.Config.MenuY + 101, 5, curY, nil, 20, 255, 255, 255, 255, "go_back", false, 0.35) then
  5769. self.SelectedPlayer = nil
  5770. halt = true
  5771. end
  5772.  
  5773. if not halt then
  5774. curY = curY + 20
  5775. local spectate_text = ""
  5776.  
  5777. if self.SpectatingPlayer and FM:GetFunction("DoesEntityExist")(FM:GetFunction("GetPlayerPed")(self.SpectatingPlayer)) then
  5778. spectate_text = " [SPECTATING: " .. FM:CleanName(FM:GetFunction("GetPlayerName")(self.SpectatingPlayer)) .. "]"
  5779. end
  5780.  
  5781. local track_text = ""
  5782.  
  5783. if self.TrackingPlayer and FM:GetFunction("DoesEntityExist")(FM:GetFunction("GetPlayerPed")(self.TrackingPlayer)) then
  5784. track_text = " [TRACKING: " .. FM:CleanName(FM:GetFunction("GetPlayerName")(self.TrackingPlayer)) .. "]"
  5785. end
  5786.  
  5787. if self.SelectedPlayer ~= FM:GetFunction("PlayerId")() then
  5788. if self.Painter:Button("TELEPORT", self.Config.MenuX + 525 + 113, self.Config.MenuY + 101, 5, curY, nil, 20, 255, 255, 255, 255, "teleport_player", false, 0.35) then
  5789. local ped = FM:GetFunction("GetPlayerPed")(self.SelectedPlayer)
  5790. local coords = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(ped, 0.0, 0.0, 0.0)
  5791. FM:GetFunction("RequestCollisionAtCoord")(coords.x, coords.y, coords.z)
  5792.  
  5793. if FM:GetFunction("IsPedInAnyVehicle")(ped) and FM:GetFunction("AreAnyVehicleSeatsFree")(FM:GetFunction("GetVehiclePedIsIn")(ped)) then
  5794. FM:GetFunction("SetPedIntoVehicle")(FM:GetFunction("PlayerPedId")(), FM:GetFunction("GetVehiclePedIsIn")(ped), -2)
  5795. else
  5796. FM:GetFunction("SetEntityCoords")(FM:GetFunction("PlayerPedId")(), coords.x, coords.y, coords.z)
  5797. end
  5798.  
  5799. FM:AddNotification("SUCCESS", "Teleported to player.")
  5800. end
  5801.  
  5802. curY = curY + 20
  5803. end
  5804.  
  5805. if self.SelectedPlayer ~= FM:GetFunction("PlayerId")() then
  5806. if self.Painter:Button("TRACK" .. track_text, self.Config.MenuX + 525 + 113, self.Config.MenuY + 101, 5, curY, nil, 20, 255, 255, 255, 255, "track_player", false, 0.35) then
  5807. if self.TrackingPlayer ~= nil and FM:GetFunction("DoesEntityExist")(FM:GetFunction("GetPlayerPed")(self.TrackingPlayer)) then
  5808. FM:AddNotification("INFO", "Stopped tracking " .. FM:CleanName(FM:GetFunction("GetPlayerName")(self.TrackingPlayer)))
  5809. self.TrackingPlayer = nil
  5810. else
  5811. self.TrackingPlayer = self.SelectedPlayer
  5812. FM:AddNotification("INFO", "Tracking " .. FM:CleanName(FM:GetFunction("GetPlayerName")(self.TrackingPlayer)), 10000)
  5813. end
  5814. end
  5815.  
  5816. curY = curY + 20
  5817. end
  5818.  
  5819. if self.SelectedPlayer ~= FM:GetFunction("PlayerId")() then
  5820. if self.Painter:Button("SPECTATE" .. spectate_text, self.Config.MenuX + 525 + 113, self.Config.MenuY + 101, 5, curY, nil, 20, 255, 255, 255, 255, "spectate_player", false, 0.35) then
  5821. if self.SpectatingPlayer ~= nil and FM:GetFunction("DoesEntityExist")(FM:GetFunction("GetPlayerPed")(self.SpectatingPlayer)) then
  5822. FM:AddNotification("INFO", "Stopped spectating " .. FM:CleanName(FM:GetFunction("GetPlayerName")(self.SpectatingPlayer)))
  5823. FM:Spectate(false)
  5824. else
  5825. FM:Spectate(self.SelectedPlayer)
  5826. FM:AddNotification("INFO", "Spectating " .. FM:CleanName(FM:GetFunction("GetPlayerName")(self.SpectatingPlayer)), 10000)
  5827. end
  5828. end
  5829.  
  5830. curY = curY + 20
  5831. end
  5832.  
  5833. if self.Painter:Button("EXPLODE", self.Config.MenuX + 525 + 113, self.Config.MenuY + 101, 5, curY, nil, 20, 255, 255, 255, 255, "explode_player", false, 0.35) then
  5834. FM:GetFunction("AddExplosion")(FM:GetFunction("GetOffsetFromEntityInWorldCoords")(FM:GetFunction("GetPlayerPed")(self.SelectedPlayer), 0.0, 0.0, 0.0), 7, 100000.0, true, false, 0.0)
  5835. FM:AddNotification("INFO", "Player blown up.", 10000)
  5836. end
  5837.  
  5838. curY = curY + 20
  5839.  
  5840. if self.Painter:Button(frozen_players[self.SelectedPlayer] and "UNFREEZE" or "FREEZE", self.Config.MenuX + 525 + 113, self.Config.MenuY + 101, 5, curY, nil, 20, 255, 255, 255, 255, "freeze_player", false, 0.35) then
  5841. frozen_players[self.SelectedPlayer] = not frozen_players[self.SelectedPlayer]
  5842. FM:AddNotification("INFO", "Player " .. (frozen_players[self.SelectedPlayer] and "frozen" or "unfrozen") .. ".", 10000)
  5843. end
  5844.  
  5845. curY = curY + 20
  5846.  
  5847. if self.Painter:Button("GIVE ALL WEAPONS", self.Config.MenuX + 525 + 113, self.Config.MenuY + 101, 5, curY, nil, 20, 255, 255, 255, 255, "give_player_all_weapons", false, 0.35) then
  5848. local ped = FM:GetFunction("GetPlayerPed")(self.SelectedPlayer)
  5849.  
  5850. for _, wep in dict.pairs(all_weapons) do
  5851. FM:GetFunction("GiveWeaponToPed")(ped, FM:GetFunction("GetHashKey")(wep), 9000, false, true)
  5852. end
  5853.  
  5854. FM:AddNotification("SUCCESS", "All weapons given.", 10000)
  5855. end
  5856.  
  5857. curY = curY + 20
  5858.  
  5859. if self.Painter:Button("REMOVE ALL WEAPONS", self.Config.MenuX + 525 + 113, self.Config.MenuY + 101, 5, curY, nil, 20, 255, 255, 255, 255, "remove_player_all_weapons", false, 0.35) then
  5860. local ped = FM:GetFunction("GetPlayerPed")(self.SelectedPlayer)
  5861.  
  5862. for _, wep in dict.pairs(all_weapons) do
  5863. FM:GetFunction("RemoveWeaponFromPed")(ped, FM:GetFunction("GetHashKey")(wep), 9000, false, true)
  5864. end
  5865.  
  5866. FM:AddNotification("SUCCESS", "Weapons removed.", 10000)
  5867. end
  5868.  
  5869. curY = curY + 20
  5870.  
  5871. if self.Painter:Button("GAS PLAYER", self.Config.MenuX + 525 + 113, self.Config.MenuY + 101, 5, curY, nil, 20, 255, 255, 255, 255, "gas_player", false, 0.35) then
  5872. FM:GasPlayer(self.SelectedPlayer)
  5873.  
  5874. if not FM.Config.SafeMode then
  5875. FM:AddNotification("SUCCESS", "Player gassed!", 10000)
  5876. end
  5877. end
  5878.  
  5879. curY = curY + 20
  5880.  
  5881. if self.Painter:Button("TAZE PLAYER", self.Config.MenuX + 525 + 113, self.Config.MenuY + 101, 5, curY, nil, 20, 255, 255, 255, 255, "taze_player", false, 0.35) then
  5882. FM:TazePlayer(self.SelectedPlayer)
  5883. FM:AddNotification("SUCCESS", "Player tazed!", 10000)
  5884. end
  5885.  
  5886. curY = curY + 20
  5887.  
  5888. if self.Painter:Button("HYDRANT PLAYER", self.Config.MenuX + 525 + 113, self.Config.MenuY + 101, 5, curY, nil, 20, 255, 255, 255, 255, "hydrant_player", false, 0.35) then
  5889. FM:HydrantPlayer(self.SelectedPlayer)
  5890. FM:AddNotification("SUCCESS", "Player sprayed!", 10000)
  5891. end
  5892.  
  5893. curY = curY + 20
  5894.  
  5895. if self.Painter:Button("FIRE PLAYER", self.Config.MenuX + 525 + 113, self.Config.MenuY + 101, 5, curY, nil, 20, 255, 255, 255, 255, "fire_player", false, 0.35) then
  5896. FM:FirePlayer(self.SelectedPlayer)
  5897. FM:AddNotification("SUCCESS", "Player set on fire!", 10000)
  5898. end
  5899.  
  5900. curY = curY + 20
  5901.  
  5902. if self.Painter:Button("KICK FROM VEHICLE", self.Config.MenuX + 525 + 113, self.Config.MenuY + 101, 5, curY, nil, 20, 255, 255, 255, 255, "kick_player_car", false, 0.35) then
  5903. if not FM:GetFunction("IsPedInAnyVehicle")(FM:GetFunction("GetPlayerPed")(self.SelectedPlayer)) then
  5904. FM:AddNotification("ERROR", "Player is not in a vehicle!", 5000)
  5905. else
  5906. FM:GetFunction("ClearPedTasksImmediately")(FM:GetFunction("GetPlayerPed")(self.SelectedPlayer))
  5907. FM:AddNotification("SUCCESS", "Player kicked from vehicle!", 5000)
  5908. end
  5909. end
  5910.  
  5911. curY = curY + 20
  5912.  
  5913. if self.Painter:Button("DISABLE VEHICLE", self.Config.MenuX + 525 + 113, self.Config.MenuY + 101, 5, curY, nil, 20, 255, 255, 255, 255, "disable_player_car", false, 0.35) then
  5914. if not FM:GetFunction("IsPedInAnyVehicle")(FM:GetFunction("GetPlayerPed")(self.SelectedPlayer)) then
  5915. FM:AddNotification("ERROR", "Player is not in a vehicle!", 5000)
  5916. else
  5917. FM:AddNotification("SUCCESS", "Disabling vehicle.", 5000)
  5918. FM:DisableVehicle(FM:GetFunction("GetVehiclePedIsIn")(FM:GetFunction("GetPlayerPed")(self.SelectedPlayer)))
  5919. end
  5920. end
  5921.  
  5922. curY = curY + 20
  5923.  
  5924. if self.Painter:Button("RAPE PLAYER", self.Config.MenuX + 525 + 113, self.Config.MenuY + 101, 5, curY, nil, 20, 255, 255, 255, 255, "rape_player", false, 0.35) then
  5925. FM:RapePlayer(self.SelectedPlayer)
  5926.  
  5927. if not FM.Config.SafeMode then
  5928. FM:AddNotification("SUCCESS", "Player raped!", 10000)
  5929. end
  5930. end
  5931.  
  5932. curY = curY + 20
  5933. local friend_text = friends[FM:GetFunction("GetPlayerServerId")(self.SelectedPlayer)] and "REMOVE FRIEND" or "MARK AS FRIEND"
  5934.  
  5935. if self.Painter:Button(friend_text, self.Config.MenuX + 525 + 113, self.Config.MenuY + 101, 5, curY, nil, 20, 255, 255, 255, 255, "friend_toggle", false, 0.35) then
  5936. friends[FM:GetFunction("GetPlayerServerId")(self.SelectedPlayer)] = not friends[FM:GetFunction("GetPlayerServerId")(self.SelectedPlayer)]
  5937. end
  5938.  
  5939. curY = curY + 20
  5940.  
  5941. if self.Painter:Button("STEAL OUTFIT", self.Config.MenuX + 525 + 113, self.Config.MenuY + 101, 5, curY, nil, 20, 255, 255, 255, 255, "steal_player_outfit", false, 0.35) then
  5942. FM:StealOutfit(self.SelectedPlayer)
  5943. FM:AddNotification("SUCCESS", "Outfit stolen.", 5000)
  5944. end
  5945.  
  5946. curY = curY + 20
  5947.  
  5948. if self.DynamicTriggers["chat"] and self.DynamicTriggers["chat"]["_chat:messageEntered"] then
  5949. if self.Painter:Button("FAKE CHAT MESSAGE", self.Config.MenuX + 525 + 113, self.Config.MenuY + 101, 5, curY, nil, 20, 255, 255, 255, 255, "fake_chat_message", false, 0.35) then
  5950. local FMM = FM:GetTextInput("Enter message to send.", "", 100)
  5951. local playa = FM:GetFunction("GetPlayerName")(self.SelectedPlayer)
  5952.  
  5953. if FMM then
  5954. FM:GetFunction("TriggerServerEvent")(self.DynamicTriggers["chat"]["_chat:messageEntered"], playa, {0, 0x99, 255}, FMM)
  5955. FM:AddNotification("SUCCESS", "Message sent!", 10000)
  5956. end
  5957. end
  5958.  
  5959. curY = curY + 20
  5960. end
  5961.  
  5962. if self.Painter:Button("~r~CRASH PLAYER (SHIFT FOR METHOD)", self.Config.MenuX + 525 + 113, self.Config.MenuY + 101, 5, curY, nil, 20, 255, 255, 255, 255, "crash_online_player", false, 0.35) then
  5963. local method = nil
  5964.  
  5965. if FM.Config.SafeMode then
  5966. FM:AddNotification("WARN", "Safe mode is currently on, if you wish to use this, disable it.")
  5967. else
  5968. if FM:GetFunction("IsDisabledControlPressed")(0, FM.Keys["LEFTSHIFT"]) then
  5969. local _method = FM:GetTextInput("Enter crash method. [object / ped / both]", "both", 10)
  5970.  
  5971. if _method then
  5972. method = _method
  5973. FM:AddNotification("INFO", "Using " .. method .. " crash method.")
  5974. end
  5975. end
  5976.  
  5977. FM:CrashPlayer(self.SelectedPlayer, nil, method)
  5978. end
  5979. end
  5980. end
  5981. end
  5982.  
  5983. local curX = self.Config.MenuX + 7
  5984.  
  5985. for _, data in dict.pairs(self.Categories) do
  5986. local size = self.Painter:GetTextWidth(data.Title, 4, 0.34)
  5987.  
  5988. if self.Painter:ListItem(data.Title, curX, self.Config.MenuY + 26, 0, 0, size + 29.6, 20, 0, 0, 0, 200, "category_" .. _) then
  5989. self.Config.CurrentSelection = _
  5990. self.Config.SelectedCategory = "category_" .. _
  5991. end
  5992.  
  5993. curX = curX + size + 29.6 + 2
  5994. end
  5995.  
  5996. if self.Config.CurrentSelection then
  5997. self.Categories[self.Config.CurrentSelection].Build(FM, self.Config.MenuX + 5, self.Config.MenuY + 46, 515 + 113, self.MenuH - 28)
  5998. end
  5999. end
  6000.  
  6001. local last_clean = 0
  6002.  
  6003. function FM:Cleanup()
  6004. if last_clean <= FM:GetFunction("GetGameTimer")() then
  6005. last_clean = FM:GetFunction("GetGameTimer")() + 15000
  6006. collectgarbage("collect")
  6007. end
  6008. end
  6009.  
  6010. local was_showing
  6011. local was_invis
  6012. local was_other_invis = {}
  6013. local was_noragdoll
  6014. local was_fastrun
  6015. local walking
  6016. local magic_carpet_obj
  6017. local preview_magic_carpet
  6018. local magic_riding
  6019. local was_infinite_combat_roll
  6020. local was_fakedead
  6021. local fakedead_timer = 0
  6022. local last_afk_move = 0
  6023.  
  6024. CreateThread(function()
  6025. while FM.Enabled do
  6026. Wait(0)
  6027.  
  6028. if FM.Config.Player.RevealInvisibles then
  6029. for id, src in dict.pairs(FM.PlayerCache) do
  6030. src = dict.tonumber(src)
  6031.  
  6032. if src ~= PlayerId() then
  6033. local _ped = FM:GetFunction("GetPlayerPed")(src)
  6034. local where = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(_ped, 0.0, 0.0, 1.0)
  6035. local us = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(FM:GetFunction("PlayerPedId")(), 0.0, 0.0, 0.0)
  6036. local dist = FM:GetFunction("GetDistanceBetweenCoords")(where.x, where.y, where.z, us.x, us.y, us.z)
  6037.  
  6038. if dist <= 100.0 then
  6039. local invis = not FM:GetFunction("IsEntityVisibleToScript")(_ped)
  6040.  
  6041. if invis then
  6042. FM:GetFunction("SetEntityLocallyVisible")(_ped, true)
  6043. FM:GetFunction("SetEntityAlpha")(_ped, 150)
  6044. FM:Draw3DText(where.x, where.y, where.z + 0.3, "*PLAYER INVISIBLE*", 255, 55, 55, 255)
  6045. was_other_invis[src] = true
  6046. else
  6047. FM:GetFunction("SetEntityAlpha")(_ped, 255)
  6048. was_other_invis[src] = false
  6049. end
  6050. else
  6051. FM:GetFunction("SetEntityAlpha")(_ped, 255)
  6052. was_other_invis[src] = false
  6053. end
  6054. end
  6055. end
  6056. end
  6057. end
  6058. end)
  6059.  
  6060. function FM:DoCrosshair()
  6061. if not FM.Config.Player.CrossHair then return end
  6062. FM.Painter:DrawRect(FM:ScrW() / 2 - 1, FM:ScrH() / 2 - 7.5, 2, 15, FM.Tertiary[1], FM.Tertiary[2], FM.Tertiary[3], 255)
  6063. FM.Painter:DrawRect(FM:ScrW() / 2 - 7.5, FM:ScrH() / 2 - 1, 15, 2, FM.Tertiary[1], FM.Tertiary[2], FM.Tertiary[3], 255)
  6064. end
  6065.  
  6066. local _was_anti_afk
  6067. local sort_func = function(srcA, srcB) return srcA - srcB end
  6068.  
  6069. CreateThread(function()
  6070. while FM.Enabled do
  6071. Wait(0)
  6072. FM.PlayerCache = FM:GetFunction("GetActivePlayers")()
  6073. local w, h = FM:GetFunction("GetActiveScreenResolution")()
  6074. local x, y = FM:GetFunction("GetNuiCursorPosition")()
  6075. FM._ScrW = w
  6076. FM._ScrH = h
  6077. FM._MouseX = x
  6078. FM._MouseY = y
  6079. if w and h and not FM.Config.NotifX and not FM.Config.NotifY then
  6080. FM.Config.NotifX = w - FM.Config.NotifW - 20
  6081. FM.Config.NotifY = 20
  6082. end
  6083.  
  6084. if not FM.Config.NotifW then
  6085. FM.Config.NotifW = 420
  6086. end
  6087.  
  6088. FM:Cleanup()
  6089. FM:DoESP()
  6090. FM:DoAntiAim()
  6091. FM:DoVehicleRelated()
  6092. FM:DoBlips()
  6093. FM:Tracker()
  6094. FM:DoFrozen()
  6095. FM:DoCrosshair()
  6096. local keyboard_open = FM:GetFunction("UpdateOnscreenKeyboard")() ~= -1 and FM:GetFunction("UpdateOnscreenKeyboard")() ~= 1 and FM:GetFunction("UpdateOnscreenKeyboard")() ~= 2
  6097.  
  6098. if not FM:GetFunction("HasStreamedTextureDictLoaded")("commonmenu") then
  6099. FM:GetFunction("RequestStreamedTextureDict")("commonmenu")
  6100. end
  6101.  
  6102. FM:DrawNotifications()
  6103.  
  6104. if walking and not magic_riding then
  6105. local safe
  6106.  
  6107. if not FM.Showing and FM.Config.UseAutoWalk and not (FM.Config.UseAutoWalkAlt and (FM.FreeCam.On or FM.RCCar.CamOn)) then
  6108. safe = true
  6109. elseif not FM.Config.UseAutoWalk and not (FM.Config.UseAutoWalkAlt and (FM.FreeCam.On or FM.RCCar.CamOn)) then
  6110. safe = true
  6111. elseif not FM.Config.UseAutoWalkAlt and (FM.FreeCam.On or FM.RCCar.CamOn) then
  6112. safe = true
  6113. end
  6114.  
  6115. if not FM.Config.Player.AntiAFK and _was_anti_afk then
  6116. safe = true
  6117. end
  6118.  
  6119. if FM.Config.Player.AntiAFK then
  6120. safe = false
  6121. end
  6122.  
  6123. if safe then
  6124. FM:GetFunction("ClearPedTasks")(FM:GetFunction("PlayerPedId")())
  6125. walking = false
  6126. end
  6127. end
  6128.  
  6129. if not walking and not magic_riding then
  6130. local safe
  6131.  
  6132. if FM.Showing and FM.Config.UseAutoWalk and not (FM.RCCar.CamOn or FM.FreeCam.On) then
  6133. safe = true
  6134. elseif FM.Config.UseAutoWalkAlt and (FM.RCCar.CamOn or FM.FreeCam.On) then
  6135. safe = true
  6136. end
  6137.  
  6138. if was_fakedead or fakedead_timer >= FM:GetFunction("GetGameTimer")() then
  6139. safe = false
  6140. FM:GetFunction("ClearPedTasks")(FM:GetFunction("PlayerPedId")())
  6141. end
  6142.  
  6143. if FM.Config.Player.AntiAFK then
  6144. safe = true
  6145. end
  6146.  
  6147. if safe then
  6148. walking = true
  6149. local veh = FM:GetFunction("GetVehiclePedIsIn")(FM:GetFunction("PlayerPedId")())
  6150.  
  6151. if FM:GetFunction("DoesEntityExist")(veh) then
  6152. FM:GetFunction("TaskVehicleDriveWander")(FM:GetFunction("PlayerPedId")(), veh, 40.0, 0)
  6153. else
  6154. FM:GetFunction("TaskWanderStandard")(FM:GetFunction("PlayerPedId")(), 10.0, 10)
  6155. end
  6156. end
  6157. end
  6158.  
  6159. if FM.Showing then
  6160. FM:GetFunction("DisableAllControlActions")(0)
  6161. FM:GetFunction("SetMouseCursorActiveThisFrame")()
  6162. FM:GetFunction("SetMouseCursorSprite")(1)
  6163. FM:DrawMenu()
  6164.  
  6165. if not was_showing then
  6166. selected_config = "none"
  6167. end
  6168.  
  6169. was_showing = true
  6170. elseif was_showing then
  6171. if walking and not FM:GetFunction("IsEntityInAir")(FM:GetFunction("PlayerPedId")()) then
  6172. FM:GetFunction("ClearPedTasks")(FM:GetFunction("PlayerPedId")())
  6173. walking = false
  6174. end
  6175.  
  6176. was_showing = false
  6177. end
  6178.  
  6179. if FM:GetFunction("IsDisabledControlJustPressed")(0, FM.Keys[FM.Config.ShowKey]) and not keyboard_open then
  6180. FM.Showing = not FM.Showing
  6181. end
  6182.  
  6183. if FM.Config.FreeCamKey ~= "NONE" and FM:GetFunction("IsDisabledControlJustPressed")(0, FM.Keys[FM.Config.FreeCamKey]) and not keyboard_open then
  6184. FM.FreeCam.On = not FM.FreeCam.On
  6185. end
  6186.  
  6187. if FM.Config.RCCamKey ~= "NONE" and FM:GetFunction("IsDisabledControlJustPressed")(0, FM.Keys[FM.Config.RCCamKey]) and not keyboard_open then
  6188. if FM.RCCar.On then
  6189. FM.RCCar.CamOn = not FM.RCCar.CamOn
  6190. else
  6191. FM:AddNotification("ERROR", "No RC Car is active!")
  6192. end
  6193. end
  6194.  
  6195. if FM.Config.DisableKey ~= "NONE" and FM:GetFunction("IsDisabledControlJustPressed")(0, FM.Keys[FM.Config.DisableKey]) and not keyboard_open then
  6196. FM:GetFunction("ClearPedTasks")(FM:GetFunction("PlayerPedId")())
  6197. FM.Enabled = false
  6198. FM:Print("[MENU] Menu killed.")
  6199. end
  6200.  
  6201. if FM.Config.Player.ForceRadar then
  6202. FM:GetFunction("DisplayRadar")(true)
  6203. end
  6204.  
  6205. if FM.Config.Player.FakeDead then
  6206. FM:GetFunction("SetPedToRagdoll")(FM:GetFunction("PlayerPedId")(), 1000, 1000, 0, true, true, false)
  6207. was_fakedead = true
  6208. elseif was_fakedead then
  6209. walking = false
  6210. FM:GetFunction("SetPedToRagdoll")(FM:GetFunction("PlayerPedId")(), 1, 1, 0, true, true, false)
  6211. FM:GetFunction("ClearPedTasks")(FM:GetFunction("PlayerPedId")())
  6212. was_fakedead = false
  6213. fakedead_timer = FM:GetFunction("GetGameTimer")() + 1500
  6214. end
  6215.  
  6216. if FM.Config.Player.SuperJump then
  6217. FM:GetFunction("SetSuperJumpThisFrame")(PlayerId())
  6218. end
  6219.  
  6220. if FM.Config.Player.Invisibility then
  6221. FM:GetFunction("SetEntityVisible")(FM:GetFunction("PlayerPedId")(), false, false)
  6222. FM:GetFunction("SetEntityLocallyVisible")(FM:GetFunction("PlayerPedId")(), true)
  6223. FM:GetFunction("SetEntityAlpha")(FM:GetFunction("PlayerPedId")(), 150)
  6224. was_invis = true
  6225. elseif was_invis then
  6226. FM:GetFunction("SetEntityVisible")(FM:GetFunction("PlayerPedId")(), true, true)
  6227. FM:GetFunction("SetEntityAlpha")(FM:GetFunction("PlayerPedId")(), 255)
  6228. was_invis = false
  6229. end
  6230.  
  6231. FM:GetFunction("SetEntityProofs")(FM:GetFunction("PlayerPedId")(), FM.Config.Player.God, FM.Config.Player.God, FM.Config.Player.God, FM.Config.Player.God, FM.Config.Player.God, FM.Config.Player.God, FM.Config.Player.God, FM.Config.Player.God)
  6232.  
  6233. if FM.Config.Player.SemiGod then
  6234. FM:GetFunction("SetEntityHealth")(FM:GetFunction("PlayerPedId")(), 200)
  6235. end
  6236.  
  6237. if FM.Config.Player.InfiniteStamina then
  6238. FM:GetFunction("ResetPlayerStamina")(FM:GetFunction("PlayerId")())
  6239. end
  6240.  
  6241. if FM.Config.Player.NoRagdoll then
  6242. FM:GetFunction("SetPedCanRagdoll")(FM:GetFunction("PlayerPedId")(), false)
  6243. was_noragdoll = true
  6244. elseif was_noragdoll then
  6245. FM:GetFunction("SetPedCanRagdoll")(FM:GetFunction("PlayerPedId")(), true)
  6246. was_noragdoll = false
  6247. end
  6248.  
  6249. if FM.Config.Player.FastRun then
  6250. FM:GetFunction("SetRunSprintMultiplierForPlayer")(FM:GetFunction("PlayerId")(), 1.49)
  6251. FM:GetFunction("SetPedMoveRateOverride")(FM:GetFunction("PlayerPedId")(), 2.0)
  6252. was_fastrun = true
  6253. elseif was_fastrun then
  6254. FM:GetFunction("SetRunSprintMultiplierForPlayer")(FM:GetFunction("PlayerId")(), 1.0)
  6255. FM:GetFunction("SetPedMoveRateOverride")(FM:GetFunction("PlayerPedId")(), 0.0)
  6256. was_fastrun = false
  6257. end
  6258.  
  6259. if FM.Config.Player.NoReload then
  6260. local curWep = FM:GetFunction("GetSelectedPedWeapon")(FM:GetFunction("PlayerPedId")())
  6261.  
  6262. if curWep ~= FM:GetFunction("GetHashKey")("WEAPON_MINIGUN") then
  6263. FM:GetFunction("PedSkipNextReloading")(FM:GetFunction("PlayerPedId")())
  6264. end
  6265. end
  6266.  
  6267. if FM.Config.Player.InfiniteAmmo then
  6268. local curWep = FM:GetFunction("GetSelectedPedWeapon")(FM:GetFunction("PlayerPedId")())
  6269. local ret, cur_ammo = FM:GetFunction("GetAmmoInClip")(FM:GetFunction("PlayerPedId")(), curWep)
  6270.  
  6271. if ret then
  6272. local max_ammo = FM:GetFunction("GetMaxAmmoInClip")(FM:GetFunction("PlayerPedId")(), curWep, 1)
  6273.  
  6274. if cur_ammo < max_ammo and max_ammo > 0 then
  6275. FM:GetFunction("SetAmmoInClip")(FM:GetFunction("PlayerPedId")(), curWep, max_ammo)
  6276. end
  6277. end
  6278.  
  6279. local ret, max = FM:GetFunction("GetMaxAmmo")(FM:GetFunction("PlayerPedId")(), curWep)
  6280.  
  6281. if ret then
  6282. FM:GetFunction("SetPedAmmo")(FM:GetFunction("PlayerPedId")(), curWep, max)
  6283. end
  6284. end
  6285.  
  6286. if FM.Config.Player.InfiniteAmmo then
  6287. local curWep = FM:GetFunction("GetSelectedPedWeapon")(FM:GetFunction("PlayerPedId")())
  6288. local ret, cur_ammo = FM:GetFunction("GetAmmoInClip")(FM:GetFunction("PlayerPedId")(), curWep)
  6289.  
  6290. if ret then
  6291. local max_ammo = FM:GetFunction("GetMaxAmmoInClip")(FM:GetFunction("PlayerPedId")(), curWep, 1)
  6292.  
  6293. if cur_ammo < max_ammo and max_ammo > 0 then
  6294. FM:GetFunction("SetAmmoInClip")(FM:GetFunction("PlayerPedId")(), curWep, max_ammo)
  6295. end
  6296. end
  6297. end
  6298.  
  6299. if FM.Config.Player.RapidFire and IsDisabledControlPressed(0, FM.Keys["MOUSE1"]) and not FM.Showing and (not FM.FreeCam.On and not FM.RCCar.CamOn) then
  6300. local curWep = FM:GetFunction("GetSelectedPedWeapon")(FM:GetFunction("PlayerPedId")())
  6301. local cur = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(FM:GetFunction("GetCurrentPedWeaponEntityIndex")(FM:GetFunction("PlayerPedId")()), 0.0, 0.0, 0.0)
  6302. local _dir = FM:GetFunction("GetGameplayCamRot")(0)
  6303. local dir = rot_to_dir(_dir)
  6304. local dist = FM.Config.Player.NoDrop and 99999.0 or 200.0
  6305. local len = _multiply(dir, dist)
  6306. local targ = cur + len
  6307. FM:GetFunction("ShootSingleBulletBetweenCoords")(cur.x, cur.y, cur.z, targ.x, targ.y, targ.z, 5, 1, curWep, FM:GetFunction("PlayerPedId")(), true, true, 24000.0)
  6308.  
  6309. if FM.Config.Player.ExplosiveAmmo then
  6310. local impact, coords = FM:GetFunction("GetPedLastWeaponImpactCoord")(FM:GetFunction("PlayerPedId")())
  6311.  
  6312. if impact then
  6313. FM:GetFunction("AddExplosion")(coords.x, coords.y, coords.z, 7, 100000.0, true, false, 0.0)
  6314. end
  6315. end
  6316. end
  6317.  
  6318. if not FM.Config.Player.RapidFire and FM.Config.Player.ExplosiveAmmo then
  6319. local impact, coords = FM:GetFunction("GetPedLastWeaponImpactCoord")(FM:GetFunction("PlayerPedId")())
  6320.  
  6321. if impact then
  6322. FM:GetFunction("AddExplosion")(coords.x, coords.y, coords.z, 7, 100000.0, true, false, 0.0)
  6323. end
  6324.  
  6325. FM:GetFunction("SetExplosiveMeleeThisFrame")(FM:GetFunction("PlayerId")())
  6326. end
  6327.  
  6328. if FM.Config.Player.InfiniteCombatRoll then
  6329. for i = 0, 3 do
  6330. FM:GetFunction("StatSetInt")(FM:GetFunction("GetHashKey")("mp" .. i .. "_shooting_ability"), 9999, true)
  6331. FM:GetFunction("StatSetInt")(FM:GetFunction("GetHashKey")("sp" .. i .. "_shooting_ability"), 9999, true)
  6332. end
  6333.  
  6334. was_infinite_combat_roll = true
  6335. elseif was_infinite_combat_roll then
  6336. for i = 0, 3 do
  6337. FM:GetFunction("StatSetInt")(FM:GetFunction("GetHashKey")("mp" .. i .. "_shooting_ability"), 0, true)
  6338. FM:GetFunction("StatSetInt")(FM:GetFunction("GetHashKey")("sp" .. i .. "_shooting_ability"), 0, true)
  6339. end
  6340. end
  6341.  
  6342. if FM.Config.Player.MagMode then
  6343. FM:DoMagneto()
  6344. end
  6345.  
  6346. FM:DoKeyPressed()
  6347. end
  6348. end)
  6349.  
  6350. local _keys = {}
  6351.  
  6352. function FM:DoKeyPressed()
  6353. if not FM.Config.ShowControlsOnScreen then return end
  6354. local offY = 0
  6355. local count = 0
  6356.  
  6357. for name, control in dict.pairs(FM.Keys) do
  6358. if FM:GetFunction("IsControlJustPressed")(0, control) or FM:GetFunction("IsDisabledControlJustPressed")(0, control) then
  6359. table.insert(_keys, {
  6360. str = name .. "[" .. control .. "]",
  6361. expires = FM:GetFunction("GetGameTimer")() + 5000
  6362. })
  6363. end
  6364.  
  6365. count = count + 1
  6366. end
  6367.  
  6368. for _, key in dict.pairs(_keys) do
  6369. local cur = FM:GetFunction("GetGameTimer")()
  6370. local left = key.expires - cur
  6371.  
  6372. if left <= 0 then
  6373. table.remove(_keys, _)
  6374. else
  6375. local secs = (left / 1000)
  6376. local alpha = dict.math.ceil(((left / 1000) / 5) * 255) + 50
  6377. alpha = _clamp(alpha, 0, 255)
  6378. offY = offY + 0.024 * _clamp(secs * 4, 0, 1)
  6379. FM:ScreenText(key.str, 4, 0.0, 0.8, 1 - offY, 0.3, 255, 255, 255, alpha)
  6380. end
  6381. end
  6382. end
  6383.  
  6384. local function _do_riding()
  6385. if not magic_riding then
  6386. FM:GetFunction("ClearPedTasks")(FM:GetFunction("PlayerPedId")())
  6387. local rot = FM:GetFunction("GetEntityRotation")(magic_carpet_obj)
  6388. FM:GetFunction("SetEntityRotation")(magic_carpet_obj, 0.0, rot.y, rot.z)
  6389. else
  6390. local coords = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(FM:GetFunction("PlayerPedId")(), 0.0, 0.0, 0.0)
  6391. local carpet = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(magic_carpet_obj, 0.0, 0.0, 0.0)
  6392. local head = FM:GetFunction("GetEntityHeading")(magic_carpet_obj)
  6393. FM:GetFunction("SetEntityHeading")(FM:GetFunction("PlayerPedId")(), head)
  6394. FM:GetFunction("SetEntityCoords")(FM:GetFunction("PlayerPedId")(), carpet.x, carpet.y, carpet.z)
  6395. FM:GetFunction("TaskPlayAnim")(FM:GetFunction("PlayerPedId")(), "rcmcollect_paperleadinout@", "meditiate_idle", 2.0, 2.5, -1, 47, 0, 0, 0, 0)
  6396. end
  6397. end
  6398.  
  6399. local function _right_vec()
  6400. local right = vector3(0, 1, 0)
  6401.  
  6402. return right
  6403. end
  6404.  
  6405. local function _up_vec()
  6406. local up = vector3(0, 0, 1)
  6407.  
  6408. return up
  6409. end
  6410.  
  6411. local function _do_flying()
  6412. if not magic_riding then return end
  6413. FM.FreeCam:DisableMovement(true)
  6414.  
  6415. if not IsEntityPlayingAnim(FM:GetFunction("PlayerPedId")(), "rcmcollect_paperleadinout@", "meditiate_idle", 3) then
  6416. FM:GetFunction("TaskPlayAnim")(FM:GetFunction("PlayerPedId")(), "rcmcollect_paperleadinout@", "meditiate_idle", 2.0, 2.5, -1, 47, 0, 0, 0, 0)
  6417. end
  6418.  
  6419. local carpet = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(magic_carpet_obj, 0.0, 0.0, 0.0)
  6420. local rot = FM:GetFunction("GetGameplayCamRot")(0)
  6421.  
  6422. if not FM.FreeCam.On then
  6423. FM:GetFunction("SetEntityRotation")(magic_carpet_obj, rot.x + 0.0, rot.y + 0.0, rot.z + 0.0)
  6424. local forwardVec = FM:GetFunction("GetEntityForwardVector")(magic_carpet_obj)
  6425. local rightVec = _right_vec(magic_carpet_obj)
  6426. local upVec = _up_vec(magic_carpet_obj)
  6427. local speed = 1.0
  6428.  
  6429. if FM:GetFunction("IsDisabledControlPressed")(0, FM.Keys["LEFTCTRL"]) then
  6430. speed = 0.1
  6431. elseif FM:GetFunction("IsDisabledControlPressed")(0, FM.Keys["LEFTSHIFT"]) then
  6432. speed = 1.8
  6433. end
  6434.  
  6435. if FM:GetFunction("IsDisabledControlPressed")(0, FM.Keys["W"]) then
  6436. carpet = carpet + forwardVec * speed
  6437. end
  6438.  
  6439. if FM:GetFunction("IsDisabledControlPressed")(0, FM.Keys["S"]) then
  6440. carpet = carpet - forwardVec * speed
  6441. end
  6442.  
  6443. if FM:GetFunction("IsDisabledControlPressed")(0, FM.Keys["SPACE"]) then
  6444. carpet = carpet + upVec * speed
  6445. end
  6446.  
  6447. if FM:GetFunction("IsDisabledControlPressed")(0, FM.Keys["X"]) then
  6448. carpet = carpet - upVec * speed
  6449. end
  6450.  
  6451. FM:GetFunction("SetEntityCoords")(magic_carpet_obj, carpet.x, carpet.y, carpet.z)
  6452. end
  6453.  
  6454. FM:GetFunction("SetEntityRotation")(FM:GetFunction("PlayerPedId")(), rot.x, rot.y, rot.z)
  6455. FM:GetFunction("AttachEntityToEntity")(FM:GetFunction("PlayerPedId")(), magic_carpet_obj, 0, 0.0, 0.0, 1.0, rot.x, FM:GetFunction("GetEntityHeading")(magic_carpet_obj), rot.z, false, false, false, false, 1, false)
  6456. end
  6457.  
  6458. local _no_combat
  6459. local _was_no_combat
  6460.  
  6461. CreateThread(function()
  6462. while FM.Enabled do
  6463. Wait(0)
  6464.  
  6465. if _no_combat and not _was_no_combat then
  6466. _was_no_combat = true
  6467. elseif not _no_combat and _was_no_combat then
  6468. _was_no_combat = false
  6469. FM.FreeCam:DisableCombat(_no_combat)
  6470. end
  6471.  
  6472. if _no_combat then
  6473. FM.FreeCam:DisableCombat(_no_combat)
  6474. end
  6475. end
  6476. end)
  6477.  
  6478. CreateThread(function()
  6479. FM:RequestModelSync("apa_mp_h_acc_rugwoolm_03")
  6480. FM:GetFunction("RequestAnimDict")("rcmcollect_paperleadinout@")
  6481.  
  6482. while FM.Enabled do
  6483. Wait(0)
  6484.  
  6485. if FM.Config.Player.MagicCarpet then
  6486. local our_cam = FM:GetFunction("GetRenderingCam")()
  6487.  
  6488. if not magic_carpet_obj or not FM:GetFunction("DoesEntityExist")(magic_carpet_obj) then
  6489. local cur = FM:GetFunction("GetGameplayCamCoord")()
  6490. local _dir = FM:GetFunction("GetGameplayCamRot")(0)
  6491. local dir = rot_to_dir(_dir)
  6492. local dist = 100.0
  6493. local len = _multiply(dir, dist)
  6494. local targ = cur + len
  6495. local handle = FM:GetFunction("StartShapeTestRay")(cur.x, cur.y, cur.z, targ.x, targ.y, targ.z, 1, preview_magic_carpet)
  6496. local _, hit, hit_pos, _, entity = FM:GetFunction("GetShapeTestResult")(handle)
  6497.  
  6498. if not preview_magic_carpet or not FM:GetFunction("DoesEntityExist")(preview_magic_carpet) then
  6499. _no_combat = true
  6500. preview_magic_carpet = FM:GetFunction("CreateObject")(FM:GetFunction("GetHashKey")("apa_mp_h_acc_rugwoolm_03"), hit_pos.x, hit_pos.y, hit_pos.z + 0.5, false, true, true)
  6501. FM:GetFunction("SetEntityCollision")(preview_magic_carpet, false, false)
  6502. FM:GetFunction("SetEntityAlpha")(preview_magic_carpet, 100)
  6503. Wait(50)
  6504. elseif hit then
  6505. FM:GetFunction("SetEntityCoords")(preview_magic_carpet, hit_pos.x, hit_pos.y, hit_pos.z + 0.5)
  6506. FM:GetFunction("SetEntityAlpha")(preview_magic_carpet, 100)
  6507. FM:GetFunction("FreezeEntityPosition")(preview_magic_carpet, true)
  6508. FM:GetFunction("SetEntityRotation")(preview_magic_carpet, 0.0, 0.0, _dir.z + 0.0)
  6509. FM:GetFunction("SetEntityCollision")(preview_magic_carpet, false, false)
  6510. end
  6511.  
  6512. if FM:GetFunction("IsDisabledControlPressed")(0, FM.Keys["MOUSE1"]) and not FM.Showing then
  6513. magic_carpet_obj = FM:GetFunction("CreateObject")(FM:GetFunction("GetHashKey")("apa_mp_h_acc_rugwoolm_03"), hit_pos.x, hit_pos.y, hit_pos.z + 0.5, true, true, true)
  6514. FM:DoNetwork(magic_carpet_obj)
  6515. local rot = FM:GetFunction("GetEntityRotation")(preview_magic_carpet)
  6516. FM:GetFunction("SetEntityRotation")(magic_carpet_obj, rot)
  6517. FM.Util:DeleteEntity(preview_magic_carpet)
  6518. _no_combat = false
  6519. end
  6520. else
  6521. FM:GetFunction("FreezeEntityPosition")(magic_carpet_obj, true)
  6522. _do_flying()
  6523. local coords = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(FM:GetFunction("PlayerPedId")(), 0.0, 0.0, 0.0)
  6524. local carpet = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(magic_carpet_obj, vector_origin)
  6525. local dist = FM:GetFunction("GetDistanceBetweenCoords")(coords.x, coords.y, coords.z, carpet.x, carpet.y, carpet.z)
  6526.  
  6527. if dist <= 5.0 then
  6528. FM:Draw3DText(carpet.x, carpet.y, carpet.z, "Press [E] to get " .. (magic_riding and "off" or "on") .. ".", FM.Tertiary[1], FM.Tertiary[2], FM.Tertiary[3])
  6529.  
  6530. if FM:GetFunction("IsDisabledControlJustPressed")(0, FM.Keys["E"]) then
  6531. magic_riding = not magic_riding
  6532. _do_riding()
  6533. end
  6534. end
  6535. end
  6536. else
  6537. _no_combat = false
  6538.  
  6539. if preview_magic_carpet and FM:GetFunction("DoesEntityExist")(preview_magic_carpet) then
  6540. FM.Util:DeleteEntity(preview_magic_carpet)
  6541. end
  6542.  
  6543. if magic_carpet_obj and FM:GetFunction("DoesEntityExist")(magic_carpet_obj) then
  6544. FM.Util:DeleteEntity(magic_carpet_obj)
  6545. FM:GetFunction("ClearPedTasks")(FM:GetFunction("PlayerPedId")())
  6546. end
  6547. end
  6548. end
  6549. end)
  6550.  
  6551. CreateThread(function()
  6552. while FM.Enabled do
  6553. if FM.Config.Player.SuperMan then
  6554. FM:GetFunction("GivePlayerRagdollControl")(PlayerId(), true)
  6555. FM:GetFunction("SetPedCanRagdoll")(FM:GetFunction("PlayerPedId")(), false)
  6556. FM:GetFunction("GiveDelayedWeaponToPed")(FM:GetFunction("PlayerPedId")(), 0xFBAB5776, 1, 0)
  6557. local up, forward = FM:GetFunction("IsControlPressed")(0, FM.Keys["SPACE"]), FM:GetFunction("IsControlPressed")(0, FM.Keys["W"])
  6558.  
  6559. if up or forward then
  6560. if up then
  6561. FM:GetFunction("ApplyForceToEntity")(FM:GetFunction("PlayerPedId")(), 1, 0.0, 0.0, 9999999.0, 0.0, 0.0, 0.0, true, true, true, true, false, true)
  6562. elseif FM:GetFunction("IsEntityInAir")(FM:GetFunction("PlayerPedId")()) then
  6563. FM:GetFunction("ApplyForceToEntity")(FM:GetFunction("PlayerPedId")(), 1, 0.0, 9999999.0, 0.0, 0.0, 0.0, 0.0, true, true, true, true, false, true)
  6564. end
  6565.  
  6566. Wait(0)
  6567. end
  6568. else
  6569. FM:GetFunction("GivePlayerRagdollControl")(PlayerId(), false)
  6570. FM:GetFunction("SetPedCanRagdoll")(FM:GetFunction("PlayerPedId")(), true)
  6571. end
  6572.  
  6573. Wait(0)
  6574. end
  6575. end)
  6576.  
  6577. FM.RCCar = {
  6578. Cam = nil,
  6579. On = false,
  6580. Driver = nil,
  6581. Vehicle = nil,
  6582. CamOn = false,
  6583. Keys = {
  6584. NUMPAD_UP = 111,
  6585. NUMPAD_DOWN = 112,
  6586. NUMPAD_LEFT = 108,
  6587. NUMPAD_RIGHT = 109,
  6588. UP = 188,
  6589. DOWN = 173,
  6590. LEFT = 174,
  6591. RIGHT = 175
  6592. }
  6593. }
  6594.  
  6595. local _rc_on
  6596.  
  6597. function FM.RCCar:MoveCar()
  6598. FM:GetFunction("TaskSetBlockingOfNonTemporaryEvents")(self.Driver, true)
  6599. FM:GetFunction("NetworkRequestControlOfEntity")(self.Vehicle)
  6600. FM:GetFunction("SetVehicleEngineOn")(self.Vehicle, true)
  6601. FM:GetFunction("SetPedAlertness")(self.Driver, 0.0)
  6602.  
  6603. if (FM:GetFunction("IsControlPressed")(0, self.Keys.NUMPAD_UP) or FM:GetFunction("IsControlPressed")(0, self.Keys.UP)) and (not FM:GetFunction("IsControlPressed")(0, self.Keys.NUMPAD_DOWN) and not FM:GetFunction("IsControlPressed")(0, self.Keys.DOWN)) then
  6604. FM:GetFunction("TaskVehicleTempAction")(self.Driver, self.Vehicle, 9, 1)
  6605. end
  6606.  
  6607. if (FM:GetFunction("IsControlReleased")(0, self.Keys.NUMPAD_UP) and FM:GetFunction("IsControlReleased")(0, self.Keys.UP)) or (FM:GetFunction("IsControlJustReleased")(0, self.Keys.NUMPAD_DOWN) or FM:GetFunction("IsControlJustReleased")(0, self.Keys.DOWN)) then
  6608. FM:GetFunction("TaskVehicleTempAction")(self.Driver, self.Vehicle, 6, 2500)
  6609. end
  6610.  
  6611. if (FM:GetFunction("IsControlPressed")(0, self.Keys.NUMPAD_DOWN) or FM:GetFunction("IsControlPressed")(0, self.Keys.DOWN)) and (not FM:GetFunction("IsControlPressed")(0, self.Keys.NUMPAD_UP) and not FM:GetFunction("IsControlPressed")(0, self.Keys.UP)) then
  6612. FM:GetFunction("TaskVehicleTempAction")(self.Driver, self.Vehicle, 22, 1)
  6613. end
  6614.  
  6615. if (FM:GetFunction("IsControlPressed")(0, self.Keys.NUMPAD_LEFT) or FM:GetFunction("IsControlPressed")(0, self.Keys.LEFT)) and (FM:GetFunction("IsControlPressed")(0, self.Keys.NUMPAD_DOWN) or FM:GetFunction("IsControlPressed")(0, self.Keys.DOWN)) then
  6616. FM:GetFunction("TaskVehicleTempAction")(self.Driver, self.Vehicle, 13, 1)
  6617. end
  6618.  
  6619. if (FM:GetFunction("IsControlPressed")(0, self.Keys.NUMPAD_RIGHT) or FM:GetFunction("IsControlPressed")(0, self.Keys.RIGHT)) and (FM:GetFunction("IsControlPressed")(0, self.Keys.NUMPAD_DOWN) or FM:GetFunction("IsControlPressed")(0, self.Keys.DOWN)) then
  6620. FM:GetFunction("TaskVehicleTempAction")(self.Driver, self.Vehicle, 14, 1)
  6621. end
  6622.  
  6623. if (FM:GetFunction("IsControlPressed")(0, self.Keys.NUMPAD_UP) or FM:GetFunction("IsControlPressed")(0, self.Keys.UP)) and (FM:GetFunction("IsControlPressed")(0, self.Keys.NUMPAD_DOWN) or FM:GetFunction("IsControlPressed")(0, self.Keys.DOWN)) then
  6624. FM:GetFunction("TaskVehicleTempAction")(self.Driver, self.Vehicle, 30, 100)
  6625. end
  6626.  
  6627. if (FM:GetFunction("IsControlPressed")(0, self.Keys.NUMPAD_LEFT) or FM:GetFunction("IsControlPressed")(0, self.Keys.LEFT)) and (FM:GetFunction("IsControlPressed")(0, self.Keys.NUMPAD_UP) or FM:GetFunction("IsControlPressed")(0, self.Keys.UP)) then
  6628. FM:GetFunction("TaskVehicleTempAction")(self.Driver, self.Vehicle, 7, 1)
  6629. end
  6630.  
  6631. if (FM:GetFunction("IsControlPressed")(0, self.Keys.NUMPAD_RIGHT) or FM:GetFunction("IsControlPressed")(0, self.Keys.RIGHT)) and (FM:GetFunction("IsControlPressed")(0, self.Keys.NUMPAD_UP) or FM:GetFunction("IsControlPressed")(0, self.Keys.UP)) then
  6632. FM:GetFunction("TaskVehicleTempAction")(self.Driver, self.Vehicle, 8, 1)
  6633. end
  6634.  
  6635. if (FM:GetFunction("IsControlPressed")(0, self.Keys.NUMPAD_LEFT) or FM:GetFunction("IsControlPressed")(0, self.Keys.LEFT)) and (not FM:GetFunction("IsControlPressed")(0, self.Keys.NUMPAD_UP) and not FM:GetFunction("IsControlPressed")(0, self.Keys.UP)) and (not FM:GetFunction("IsControlPressed")(0, self.Keys.NUMPAD_DOWN) and not FM:GetFunction("IsControlPressed")(0, self.Keys.DOWN)) then
  6636. FM:GetFunction("TaskVehicleTempAction")(self.Driver, self.Vehicle, 4, 1)
  6637. end
  6638.  
  6639. if (FM:GetFunction("IsControlPressed")(0, self.Keys.NUMPAD_RIGHT) or FM:GetFunction("IsControlPressed")(0, self.Keys.RIGHT)) and (not FM:GetFunction("IsControlPressed")(0, self.Keys.NUMPAD_UP) and not FM:GetFunction("IsControlPressed")(0, self.Keys.UP)) and (not FM:GetFunction("IsControlPressed")(0, self.Keys.NUMPAD_DOWN) and not FM:GetFunction("IsControlPressed")(0, self.Keys.DOWN)) then
  6640. FM:GetFunction("TaskVehicleTempAction")(self.Driver, self.Vehicle, 5, 1)
  6641. end
  6642. end
  6643.  
  6644. local rc_camRP, rc_camRY, rc_camRR
  6645. local p, y, r
  6646.  
  6647. local function approach(from, to, inc)
  6648. if from >= to then return from end
  6649.  
  6650. return from + inc
  6651. end
  6652.  
  6653. function FM.RCCar:GetCamRot(gameplay_rot)
  6654. local car_rot = FM:GetFunction("GetEntityRotation")(self.Vehicle)
  6655.  
  6656. if not p and not y and not r then
  6657. p, y, r = car_rot.x, car_rot.y, car_rot.z
  6658. end
  6659.  
  6660. p = approach(p, car_rot.x, 0.5)
  6661. y = approach(y, car_rot.y, 0.5)
  6662. r = approach(r, car_rot.z, 0.5)
  6663.  
  6664. return car_rot.x, car_rot.y, car_rot.z
  6665. end
  6666.  
  6667. local insults, voices = {"GENERIC_INSULT_HIGH", "GENERIC_INSULT_MED", "GENERIC_SHOCKED_HIGH", "FIGHT_RUN", "CRASH_CAR", "KIFFLOM_GREET", "PHONE_SURPRISE_EXPLOSION"}, {"S_M_Y_SHERIFF_01_WHITE_FULL_01", "A_F_M_SOUCENT_02_BLACK_FULL_01", "A_F_M_BODYBUILD_01_WHITE_FULL_01", "A_F_M_BEVHILLS_02_BLACK_FULL_01"}
  6668.  
  6669. function FM.RCCar:Tick()
  6670. if not FM:GetFunction("DoesCamExist")(self.Cam) then
  6671. self.Cam = FM:GetFunction("CreateCam")("DEFAULT_SCRIPTED_CAMERA", true)
  6672. end
  6673.  
  6674. while FM.Enabled do
  6675. Wait(0)
  6676.  
  6677. if self.On then
  6678. local rot_vec = FM:GetFunction("GetGameplayCamRot")(0)
  6679.  
  6680. if not FM:GetFunction("DoesEntityExist")(self.Vehicle) then
  6681. FM:GetFunction("ClearPedTasksImmediately")(self.Driver)
  6682. FM.Util:DeleteEntity(self.Driver)
  6683. self.CamOn = false
  6684. self.On = false
  6685. elseif not FM:GetFunction("DoesEntityExist")(self.Driver) or FM:GetFunction("GetPedInVehicleSeat")(self.Vehicle, -1) ~= self.Driver or FM:GetFunction("IsEntityDead")(self.Driver) then
  6686. FM:GetFunction("ClearPedTasksImmediately")(FM:GetFunction("GetPedInVehicleSeat")(self.Vehicle, -1))
  6687. local model = FM.FreeCam.SpawnerOptions.PED[dict.math.random(1, #FM.FreeCam.SpawnerOptions.PED)]
  6688. FM:RequestModelSync(model)
  6689. FM.Util:DeleteEntity(self.Driver)
  6690. self.Driver = FM:GetFunction("CreatePedInsideVehicle")(self.Vehicle, 24, FM:GetFunction("GetHashKey")(model), -1, true, true)
  6691. end
  6692.  
  6693. if self.On then
  6694. self:MoveCar()
  6695. FM:GetFunction("SetVehicleDoorsLockedForAllPlayers")(self.Vehicle, true)
  6696. FM:GetFunction("SetVehicleDoorsLocked")(self.Vehicle, 2)
  6697.  
  6698. if FM:GetFunction("IsDisabledControlJustPressed")(0, FM.Keys["E"]) then
  6699. FM:GetFunction("PlayAmbientSpeechWithVoice")(self.Driver, insults[dict.math.random(1, #insults)], voices[dict.math.random(1, #voices)], "SPEECH_PARAMS_FORCE_SHOUTED", false)
  6700. end
  6701. end
  6702.  
  6703. if self.CamOn and not _rc_on then
  6704. FM:GetFunction("SetCamActive")(self.Cam, true)
  6705. FM:GetFunction("RenderScriptCams")(true, false, false, true, true)
  6706. _rc_on = true
  6707. local coords = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(self.Vehicle, 0.0, 0.0, 0.0) + (FM:GetFunction("GetEntityForwardVector")(self.Vehicle) * (FM:GetModelLength(self.Vehicle) * -0.85))
  6708. rc_camX, rc_camY, rc_camZ = coords.x, coords.y, coords.z
  6709. local rot = FM:GetFunction("GetEntityRotation")(self.Vehicle)
  6710. rc_camRP, rc_camRY, rc_camRR = rot.x, rot.y, rot.z
  6711. FM:GetFunction("ClearPedTasks")(FM:GetFunction("PlayerPedId")())
  6712. walking = false
  6713. elseif not self.CamOn and _rc_on then
  6714. FM:GetFunction("FreezeEntityPosition")(FM:GetFunction("PlayerPedId")(), false)
  6715. FM:GetFunction("SetCamActive")(self.Cam, false)
  6716. FM:GetFunction("RenderScriptCams")(false, false, false, false, false)
  6717. FM:GetFunction("SetFocusEntity")(FM:GetFunction("PlayerPedId")())
  6718. FM.FreeCam:DisableMovement(false)
  6719. _rc_on = false
  6720. end
  6721.  
  6722. if self.CamOn and _rc_on then
  6723. local ent_pos = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(self.Vehicle, 0.0, 0.0, 0.0) + (FM:GetFunction("GetEntityForwardVector")(self.Vehicle) * (FM:GetModelLength(self.Vehicle) * -0.85))
  6724.  
  6725. if not FM:GetFunction("IsPedInAnyVehicle")(FM:GetFunction("PlayerPedId")()) and not FM.Config.UseAutoWalkAlt then
  6726. FM:GetFunction("FreezeEntityPosition")(FM:GetFunction("PlayerPedId")(), true)
  6727. elseif FM.Config.UseAutoWalkAlt then
  6728. FM:GetFunction("FreezeEntityPosition")(FM:GetFunction("PlayerPedId")(), false)
  6729. end
  6730.  
  6731. FM:DrawIbuttons()
  6732. FM.FreeCam:DisableMovement(true)
  6733. FM:GetFunction("SetFocusPosAndVel")(rc_camX, rc_camY, rc_camZ, 0, 0, 0)
  6734. FM:GetFunction("SetCamCoord")(self.Cam, rc_camX, rc_camY, rc_camZ)
  6735. FM:GetFunction("SetCamRot")(self.Cam, rc_camRP + 0.0, rc_camRY + 0.0, rc_camRR + 0.0)
  6736. rc_camX, rc_camY, rc_camZ = ent_pos.x, ent_pos.y, ent_pos.z
  6737. rc_camRP, rc_camRY, rc_camRR = self:GetCamRot(rot_vec)
  6738. rc_camZ = rc_camZ + (FM:GetModelHeight(self.Vehicle) * 1.2)
  6739. end
  6740. end
  6741. end
  6742. end
  6743.  
  6744. FM.FreeCam = {
  6745. Cam = nil,
  6746. On = false,
  6747. Modifying = nil,
  6748. Mode = 1, -- FM.FreeCam.Modes["LOOK_AROUND"],
  6749. Modes = {
  6750. ["LOOK_AROUND"] = 1,
  6751. ["REMOVER"] = 2,
  6752. ["PED_SPAWNER"] = 3,
  6753. ["OBJ_SPAWNER"] = 4,
  6754. ["VEH_SPAWNER"] = 5,
  6755. ["PREMADE_SPAWNER"] = 6,
  6756. ["TELEPORT"] = 7,
  6757. ["RC_CAR"] = 8,
  6758. ["STEAL"] = 9,
  6759. ["TAZE"] = 10,
  6760. ["HYDRANT"] = 11,
  6761. ["FIRE"] = 12,
  6762. ["SPIKE_STRIPS"] = 13,
  6763. ["DISABLE_VEHICLE"] = 14,
  6764. ["EXPLODE"] = 15
  6765. },
  6766. ModeNames = {
  6767. [1] = "Look Around",
  6768. [2] = "Remover",
  6769. [3] = "Ped Spawner",
  6770. [4] = "Object Spawner",
  6771. [5] = "Vehicle Spawner",
  6772. [6] = "Premade Spawner",
  6773. [7] = "Teleport",
  6774. [8] = "RC Car",
  6775. [9] = "Steal",
  6776. [10] = "Taze Entity",
  6777. [11] = "Hydrant Entity",
  6778. [12] = "Fire Entity",
  6779. [13] = "Place Spike Strips",
  6780. [14] = "Disable Vehicle",
  6781. [15] = "Explode Entity"
  6782. }
  6783. }
  6784.  
  6785. function FM.FreeCam:Switcher()
  6786. if not self.On then return end
  6787. local cur = self.Mode
  6788. local new = cur
  6789. if self.DraggingEntity and FM:GetFunction("DoesEntityExist")(self.DraggingEntity) then return end
  6790.  
  6791. if FM:GetFunction("IsDisabledControlJustPressed")(0, FM.Keys["["]) then
  6792. new = cur - 1
  6793.  
  6794. if not self.ModeNames[new] then
  6795. new = #self.ModeNames
  6796. end
  6797.  
  6798. self.Mode = new
  6799. end
  6800.  
  6801. if FM:GetFunction("IsDisabledControlJustPressed")(0, FM.Keys["]"]) then
  6802. new = cur + 1
  6803.  
  6804. if not self.ModeNames[new] then
  6805. new = 1
  6806. end
  6807.  
  6808. self.Mode = new
  6809. end
  6810. end
  6811.  
  6812. function FM.FreeCam:Toggle(mode)
  6813. self.On = not self.On
  6814. self.Mode = mode
  6815. end
  6816.  
  6817. function FM.FreeCam:GetModelSize(hash)
  6818. return FM:GetFunction("GetModelDimensions")(hash)
  6819. end
  6820.  
  6821. function FM.FreeCam:DrawBoundingBox(entity, r, g, b, a)
  6822. if entity then
  6823. r = r or 255
  6824. g = g or 0
  6825. b = b or 0
  6826. a = a or 40
  6827. local model = FM:GetFunction("GetEntityModel")(entity)
  6828. local min, max = FM:GetFunction("GetModelDimensions")(model)
  6829. local top_front_right = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(entity, max)
  6830. local top_back_right = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(entity, vector3(max.x, min.y, max.z))
  6831. local bottom_front_right = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(entity, vector3(max.x, max.y, min.z))
  6832. local bottom_back_right = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(entity, vector3(max.x, min.y, min.z))
  6833. local top_front_left = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(entity, vector3(min.x, max.y, max.z))
  6834. local top_back_left = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(entity, vector3(min.x, min.y, max.z))
  6835. local bottom_front_left = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(entity, vector3(min.x, max.y, min.z))
  6836. local bottom_back_left = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(entity, min)
  6837. -- LINES
  6838. -- RIGHT SIDE
  6839. FM:GetFunction("DrawLine")(top_front_right, top_back_right, r, g, b, a)
  6840. FM:GetFunction("DrawLine")(top_front_right, bottom_front_right, r, g, b, a)
  6841. FM:GetFunction("DrawLine")(bottom_front_right, bottom_back_right, r, g, b, a)
  6842. FM:GetFunction("DrawLine")(top_back_right, bottom_back_right, r, g, b, a)
  6843. -- LEFT SIDE
  6844. FM:GetFunction("DrawLine")(top_front_left, top_back_left, r, g, b, a)
  6845. FM:GetFunction("DrawLine")(top_back_left, bottom_back_left, r, g, b, a)
  6846. FM:GetFunction("DrawLine")(top_front_left, bottom_front_left, r, g, b, a)
  6847. FM:GetFunction("DrawLine")(bottom_front_left, bottom_back_left, r, g, b, a)
  6848. -- Connection
  6849. FM:GetFunction("DrawLine")(top_front_right, top_front_left, r, g, b, a)
  6850. FM:GetFunction("DrawLine")(top_back_right, top_back_left, r, g, b, a)
  6851. FM:GetFunction("DrawLine")(bottom_front_left, bottom_front_right, r, g, b, a)
  6852. FM:GetFunction("DrawLine")(bottom_back_left, bottom_back_right, r, g, b, a)
  6853. -- POLYGONS
  6854. -- FRONT
  6855. FM:GetFunction("DrawPoly")(top_front_left, top_front_right, bottom_front_right, r, g, b, a)
  6856. FM:GetFunction("DrawPoly")(bottom_front_right, bottom_front_left, top_front_left, r, g, b, a)
  6857. -- TOP
  6858. FM:GetFunction("DrawPoly")(top_front_right, top_front_left, top_back_right, r, g, b, a)
  6859. FM:GetFunction("DrawPoly")(top_front_left, top_back_left, top_back_right, r, g, b, a)
  6860. -- BACK
  6861. FM:GetFunction("DrawPoly")(top_back_right, top_back_left, bottom_back_right, r, g, b, a)
  6862. FM:GetFunction("DrawPoly")(top_back_left, bottom_back_left, bottom_back_right, r, g, b, a)
  6863. -- LEFT
  6864. FM:GetFunction("DrawPoly")(top_back_left, top_front_left, bottom_front_left, r, g, b, a)
  6865. FM:GetFunction("DrawPoly")(bottom_front_left, bottom_back_left, top_back_left, r, g, b, a)
  6866. -- RIGHT
  6867. FM:GetFunction("DrawPoly")(top_front_right, top_back_right, bottom_front_right, r, g, b, a)
  6868. FM:GetFunction("DrawPoly")(top_back_right, bottom_back_right, bottom_front_right, r, g, b, a)
  6869. -- BOTTOM
  6870. FM:GetFunction("DrawPoly")(bottom_front_left, bottom_front_right, bottom_back_right, r, g, b, a)
  6871. FM:GetFunction("DrawPoly")(bottom_back_right, bottom_back_left, bottom_front_left, r, g, b, a)
  6872.  
  6873. return true
  6874. end
  6875.  
  6876. return false
  6877. end
  6878.  
  6879. function FM.FreeCam:Crosshair(on)
  6880. if on then
  6881. FM:GetFunction("DrawRect")(0.5, 0.5, 0.008333333, 0.001851852, FM.Tertiary[1], FM.Tertiary[2], FM.Tertiary[3], 255)
  6882. FM:GetFunction("DrawRect")(0.5, 0.5, 0.001041666, 0.014814814, FM.Tertiary[1], FM.Tertiary[2], FM.Tertiary[3], 255)
  6883. else
  6884. FM:GetFunction("DrawRect")(0.5, 0.5, 0.008333333, 0.001851852, 100, 100, 100, 255)
  6885. FM:GetFunction("DrawRect")(0.5, 0.5, 0.001041666, 0.014814814, 100, 100, 100, 255)
  6886. end
  6887. end
  6888.  
  6889. function FM:Draw3DText(x, y, z, text, r, g, b)
  6890. FM:GetFunction("SetDrawOrigin")(x, y, z, 0)
  6891. FM:GetFunction("SetTextFont")(0)
  6892. FM:GetFunction("SetTextProportional")(0)
  6893. FM:GetFunction("SetTextScale")(0.0, 0.20)
  6894. FM:GetFunction("SetTextColour")(r, g, b, 255)
  6895. FM:GetFunction("SetTextOutline")()
  6896. FM:GetFunction("BeginTextCommandDisplayText")("STRING")
  6897. FM:GetFunction("SetTextCentre")(1)
  6898. FM:GetFunction("AddTextComponentSubstringPlayerName")(text)
  6899. FM:GetFunction("EndTextCommandDisplayText")(0.0, 0.0)
  6900. FM:GetFunction("ClearDrawOrigin")()
  6901. end
  6902.  
  6903. function FM:DrawScaled3DText(x, y, z, textInput, fontId, scaleX, scaleY)
  6904. local coord = FM:GetFunction("GetFinalRenderedCamCoord")()
  6905. local px, py, pz = coord.x, coord.y, coord.z
  6906. local dist = FM:GetFunction("GetDistanceBetweenCoords")(px, py, pz, x, y, z)
  6907. local scale = (1 / dist) * 20
  6908. local fov = (1 / FM:GetFunction("GetGameplayCamFov")()) * 100
  6909. local scale = scale * fov
  6910. FM:GetFunction("SetTextScale")(scaleX * scale, scaleY * scale)
  6911. FM:GetFunction("SetTextFont")(fontId)
  6912. FM:GetFunction("SetTextProportional")(1)
  6913. FM:GetFunction("SetTextColour")(250, 250, 250, 255) -- You can change the text color here
  6914. FM:GetFunction("SetTextDropShadow")(1, 1, 1, 1, 255)
  6915. FM:GetFunction("SetTextEdge")(2, 0, 0, 0, 150)
  6916. FM:GetFunction("SetTextDropShadow")()
  6917. FM:GetFunction("SetTextOutline")()
  6918. FM:GetFunction("BeginTextCommandDisplayText")("STRING")
  6919. FM:GetFunction("SetTextCentre")(1)
  6920. FM:GetFunction("AddTextComponentSubstringPlayerName")(textInput)
  6921. FM:GetFunction("SetDrawOrigin")(x, y, z + 2, 0)
  6922. FM:GetFunction("EndTextCommandDisplayText")(0.0, 0.0)
  6923. FM:GetFunction("ClearDrawOrigin")()
  6924. end
  6925.  
  6926. function FM.FreeCam:DrawInfoCard(entity)
  6927. if not FM:GetFunction("DoesEntityExist")(entity) then return end
  6928. local coords = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(entity, 0.0, 0.0, 0.0)
  6929. local angle = FM:GetFunction("GetEntityRotation")(entity)
  6930.  
  6931. if frozen_ents[entity] == nil then
  6932. frozen_ents[entity] = false
  6933. end
  6934.  
  6935. local str = {[[ Model: ]] .. FM:GetFunction("GetEntityModel")(entity), [[ Pos: ]] .. ("x: %.2f, y: %.2f, z: %.2f"):format(coords.x, coords.y, coords.z), [[ Rot: ]] .. ("x: %.2f, y: %.2f, z: %.2f"):format(angle.x, angle.y, angle.z), [[ Frozen: ]] .. dict.tostring(frozen_ents[entity])}
  6936. local y = coords.z
  6937.  
  6938. for _, val in dict.pairs(str) do
  6939. FM:DrawScaled3DText(coords.x, coords.y, y, val, 4, 0.1, 0.1)
  6940. y = y - 0.35
  6941. end
  6942. end
  6943.  
  6944. function FM.FreeCam:CheckType(entity, type)
  6945. if type == "ALL" then return FM:GetFunction("IsEntityAnObject")(entity) or FM:GetFunction("IsEntityAVehicle")(entity) or FM:GetFunction("IsEntityAPed")(entity) end
  6946. if type == "VEHICLE" then return FM:GetFunction("IsEntityAVehicle")(entity) end
  6947. if type == "PED" then return FM:GetFunction("IsEntityAPed")(entity) end
  6948.  
  6949. return true
  6950. end
  6951.  
  6952. function FM.FreeCam:GetType(entity)
  6953. if FM:GetFunction("IsEntityAnObject")(entity) then return "OBJECT" end
  6954. if FM:GetFunction("IsEntityAVehicle")(entity) then return "VEHICLE" end
  6955. if FM:GetFunction("IsEntityAPed")(entity) then return "PED" end
  6956. end
  6957.  
  6958. function FM.FreeCam:Clone(entity)
  6959. local type = self:GetType(entity)
  6960. if not type then return end
  6961. local where = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(entity, 0.1, 0.1, 0.1)
  6962. local rot = FM:GetFunction("GetEntityRotation")(entity)
  6963.  
  6964. if type == "OBJECT" then
  6965. local clone = FM:GetFunction("CreateObject")(FM:GetFunction("GetEntityModel")(entity), where.x, where.y, where.z, true, true, true)
  6966. FM:DoNetwork(clone)
  6967. FM:GetFunction("SetEntityRotation")(clone, rot)
  6968. frozen_ents[clone] = frozen_ents[entity]
  6969. self.DraggingEntity = clone
  6970. FM:AddNotification("INFO", "Cloned object ~y~" .. entity)
  6971. Wait(50)
  6972. elseif type == "VEHICLE" then
  6973. local clone = FM:GetFunction("CreateVehicle")(FM:GetFunction("GetEntityModel")(entity), where.x, where.y, where.z, FM:GetFunction("GetEntityHeading")(entity), true, true)
  6974. FM:GetFunction("SetEntityRotation")(clone, rot)
  6975. frozen_ents[clone] = frozen_ents[entity]
  6976. self.DraggingEntity = clone
  6977. FM:AddNotification("INFO", "Cloned vehicle ~y~" .. entity)
  6978. elseif type == "PED" then
  6979. local clone = FM:GetFunction("CreatePed")(4, FM:GetFunction("GetEntityModel")(entity), where.x, where.y, where.z, FM:GetFunction("GetEntityHeading")(entity), true, true)
  6980. FM:GetFunction("SetEntityRotation")(clone, rot)
  6981. frozen_ents[clone] = frozen_ents[entity]
  6982. self.DraggingEntity = clone
  6983. FM:AddNotification("INFO", "Cloned ped ~y~" .. entity)
  6984. end
  6985. end
  6986.  
  6987. function FM.FreeCam:Remover(entity, type)
  6988. FM:SetIbuttons({{FM:GetFunction("GetControlInstructionalButton")(0, FM.Keys["MOUSE1"], 0), "Delete"}, {"b_117", "Change Mode"}})
  6989.  
  6990. if FM:GetFunction("DoesEntityExist")(entity) and FM:GetFunction("DoesEntityHaveDrawable")(entity) and self:CheckType(entity, type) then
  6991. self:DrawBoundingBox(entity, 255, 50, 50, 50)
  6992.  
  6993. if FM:GetFunction("IsDisabledControlJustPressed")(0, FM.Keys["MOUSE1"]) and not FM.Showing then
  6994. if entity == FM:GetFunction("PlayerPedId")() then return FM:AddNotification("ERROR", "You can not delete yourself!", 10000) end
  6995. if _is_ped_player(entity) then return FM:AddNotification("ERROR", "You can not delete players!", 10000) end
  6996. self:DrawBoundingBox(entity, 255, 50, 50, 50)
  6997. FM:AddNotification("INFO", "Deleted ~y~" .. dict.tostring(entity), 10000)
  6998. FM.Util:DeleteEntity(entity)
  6999.  
  7000. return
  7001. end
  7002. end
  7003. end
  7004.  
  7005. function FM.FreeCam:Attack(attacker, victim)
  7006. FM:GetFunction("ClearPedTasks")(attacker)
  7007.  
  7008. if FM:GetFunction("IsEntityAPed")(victim) then
  7009. FM:GetFunction("TaskCombatPed")(attacker, victim, 0, 16)
  7010. FM:AddNotification("INFO", "~y~" .. dict.tostring(attacker) .. " ~w~attacking ~y~" .. dict.tostring(victim), 5000)
  7011. elseif FM:GetFunction("IsEntityAVehicle")(victim) then
  7012. CreateThread(function()
  7013. FM:StealVehicleThread(attacker, victim)
  7014. end)
  7015.  
  7016. FM:AddNotification("INFO", "~y~" .. dict.tostring(attacker) .. " ~w~stealing ~y~" .. dict.tostring(victim), 5000)
  7017. end
  7018. end
  7019.  
  7020. local beginning_target
  7021.  
  7022. function FM.FreeCam:PedTarget(cam, x, y, z)
  7023. local rightVec, forwardVec, upVec = FM:GetFunction("GetCamMatrix")(cam)
  7024. local curVec = vector3(x, y, z)
  7025. local targetVec = curVec + forwardVec * 150
  7026. local handle = FM:GetFunction("StartShapeTestRay")(curVec.x, curVec.y, curVec.z, targetVec.x, targetVec.y, targetVec.z, -1)
  7027. local _, _, endCoords, _, entity = FM:GetFunction("GetShapeTestResult")(handle)
  7028.  
  7029. if FM:GetFunction("IsDisabledControlJustPressed")(0, FM.Keys["MOUSE2"]) then
  7030. beginning_target = nil
  7031. end
  7032.  
  7033. if not FM:GetFunction("DoesEntityExist")(beginning_target) then
  7034. beginning_target = nil
  7035. else
  7036. self:DrawBoundingBox(beginning_target, 0, 100, 0, 50)
  7037.  
  7038. if FM:GetFunction("IsDisabledControlPressed")(0, FM.Keys["R"]) then
  7039. FM:GetFunction("ClearPedTasks")(beginning_target)
  7040. FM:GetFunction("ClearPedSecondaryTask")(beginning_target)
  7041. FM:AddNotification("SUCCESS", "Cleared tasks for ~y~" .. beginning_target)
  7042. beginning_target = nil
  7043. end
  7044. end
  7045.  
  7046. if FM:GetFunction("DoesEntityExist")(entity) and FM:GetFunction("DoesEntityHaveDrawable")(entity) and not FM:GetFunction("IsEntityAnObject")(entity) then
  7047. if FM:GetFunction("IsDisabledControlJustPressed")(0, FM.Keys["MOUSE1"]) and not beginning_target then
  7048. if FM:GetFunction("IsEntityAVehicle")(entity) then
  7049. entity = FM:GetFunction("GetPedInVehicleSeat")(entity, -1)
  7050. end
  7051.  
  7052. beginning_target = entity
  7053. end
  7054.  
  7055. if beginning_target ~= entity then
  7056. self:DrawBoundingBox(entity, 0, 122, 200, 50)
  7057.  
  7058. if FM:GetFunction("IsDisabledControlJustPressed")(0, FM.Keys["MOUSE1"]) and FM:GetFunction("DoesEntityExist")(beginning_target) then
  7059. self:Attack(beginning_target, entity)
  7060. beginning_target = nil
  7061. end
  7062. end
  7063. end
  7064. end
  7065.  
  7066. local selected_spawner_opt = 1
  7067. local selected_weapon_opt = 1
  7068. local asking_weapon
  7069. local selected_ped
  7070. local selected_weapon
  7071.  
  7072. FM.FreeCam.SpawnerOptions = {
  7073. ["PED"] = {"s_f_y_bartender_01", "a_m_y_beachvesp_01", "a_m_y_beach_03", "a_m_y_beach_02", "a_m_m_beach_02", "a_m_y_beach_01", "s_m_y_baywatch_01", "mp_f_boatstaff_01", "u_m_m_bikehire_01", "a_f_y_bevhills_04", "s_m_m_bouncer_01", "s_m_y_armymech_01", "s_m_y_autopsy_01", "s_m_y_blackops_01", "s_m_y_blackops_02"},
  7074. ["WEAPONS"] = all_weapons,
  7075. ["OBJECT"] = {"a_c_cat_01", "prop_mp_spike_01", "prop_tyre_spike_01", "prop_container_ld2", "lts_prop_lts_ramp_03", "prop_jetski_ramp_01", "prop_mp_ramp_03_tu", "prop_skate_flatramp_cr", "stt_prop_ramp_adj_loop", "stt_prop_ramp_multi_loop_rb", "stt_prop_ramp_spiral_l", "stt_prop_ramp_spiral_l_m", "prop_const_fence03b_cr", "prop_const_fence02b", "prop_const_fence03a_cr", "prop_fnc_farm_01e", "prop_fnccorgm_02c", "ch3_01_dino", "p_pallet_02a_s", "prop_conc_blocks01a", "hei_prop_cash_crate_half_full", "prop_consign_01a", "prop_byard_net02", "prop_mb_cargo_04b", "prop_mb_crate_01a_set", "prop_pipe_stack_01", "prop_roadcone01c", "prop_rub_cage01b", "prop_sign_road_01a", "prop_sign_road_03m", "prop_traffic_rail_2", "prop_traffic_rail_1a", "prop_traffic_03a", "prop_traffic_01d", "prop_skid_trolley_1", "hei_prop_yah_seat_03", "hei_prop_yah_table_03", "lts_prop_lts_elecbox_24", "lts_prop_lts_elecbox_24b", "p_airdancer_01_s", "p_amb_brolly_01", "p_amb_brolly_01_s", "p_dumpster_t", "p_ld_coffee_vend_01", "p_patio_lounger1_s", "p_yacht_sofa_01_s", "prop_air_bagloader2_cr", "prop_air_bigradar", "prop_air_blastfence_01", "prop_air_stair_01", "prop_air_sechut_01", "prop_airport_sale_sign"},
  7076. ["VEHICLE"] = car_spam,
  7077. ["PREMADE"] = {
  7078. ["SWASTIKA"] = function(ent, offZ)
  7079. if FM.Config.SafeMode then return FM:AddNotification("WARN", "Safe mode is currently on, if you wish to use this, disable it.") end
  7080.  
  7081. CreateThread(function()
  7082. local where = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(ent, 0.0, 0.0, 0.0)
  7083.  
  7084. if not FM:GetFunction("IsEntityAPed")(ent) then
  7085. where = vector3(where.x, where.y, where.z + 5.0)
  7086. end
  7087.  
  7088. if offZ then
  7089. where = vector3(where.x, where.y, where.z + offZ)
  7090. end
  7091.  
  7092. local column = {
  7093. ["up"] = {},
  7094. ["across"] = {}
  7095. }
  7096.  
  7097. for i = 0, 7 do
  7098. column["up"][i + 1] = {
  7099. x = 0.0,
  7100. y = 0.0,
  7101. z = 1.0 + (2.6 * (i + 1)),
  7102. _p = 90.0,
  7103. _y = 0.0,
  7104. _r = 0.0
  7105. }
  7106. end
  7107.  
  7108. for i = 0, 8 do
  7109. column["across"][i + 1] = {
  7110. x = 10.4 + (-2.6 * i),
  7111. y = 0.0,
  7112. z = 11.6,
  7113. _p = 90.0,
  7114. _y = 0.0,
  7115. _r = 0.0
  7116. }
  7117. end
  7118.  
  7119. local arms = {
  7120. ["bottom_right"] = {},
  7121. ["across_up"] = {},
  7122. ["top_left"] = {},
  7123. ["across_down"] = {}
  7124. }
  7125.  
  7126. for i = 0, 4 do
  7127. arms["bottom_right"][i] = {
  7128. x = -2.6 * i,
  7129. y = 0.0,
  7130. z = 1.0,
  7131. _p = 90.0,
  7132. _y = 0.0,
  7133. _r = 0.0
  7134. }
  7135.  
  7136. arms["top_left"][i] = {
  7137. x = 2.6 * i,
  7138. y = 0.0,
  7139. z = 22.2,
  7140. _p = 90.0,
  7141. _y = 0.0,
  7142. _r = 0.0
  7143. }
  7144.  
  7145. arms["across_down"][i + 1] = {
  7146. x = 10.4,
  7147. y = 0.0,
  7148. z = 12.6 - (2.25 * (i + 1)),
  7149. _p = 90.0,
  7150. _y = 0.0,
  7151. _r = 0.0
  7152. }
  7153. end
  7154.  
  7155. for i = 0, 3 do
  7156. arms["across_up"][i + 1] = {
  7157. x = -10.4,
  7158. y = 0.0,
  7159. z = 11.6 + (2.6 * (i + 1)),
  7160. _p = 90.0,
  7161. _y = 0.0,
  7162. _r = 0.0
  7163. }
  7164. end
  7165.  
  7166. local positions = {column["up"], column["across"], arms["bottom_right"], arms["across_up"], arms["top_left"], arms["across_down"]}
  7167. FM:RequestModelSync("prop_container_05a")
  7168.  
  7169. for _, seg in dict.pairs(positions) do
  7170. for k, v in dict.pairs(seg) do
  7171. local obj = FM:GetFunction("CreateObject")(FM:GetFunction("GetHashKey")("prop_container_05a"), where.x, where.y, where.z + (offZ or 0), true, true, true)
  7172. FM:DoNetwork(obj)
  7173. FM:GetFunction("AttachEntityToEntity")(obj, ent, FM:GetFunction("IsEntityAPed")(ent) and FM:GetFunction("GetPedBoneIndex")(ped, 57005) or 0, v.x, v.y, v.z + (offZ or 0), v._p, v._y, v._r, false, true, false, false, 1, true)
  7174. Wait(80)
  7175. end
  7176. end
  7177. end)
  7178. end,
  7179. ["DICK"] = function(ent)
  7180. if FM.Config.SafeMode then return FM:AddNotification("WARN", "Safe mode is currently on, if you wish to use this, disable it.") end
  7181.  
  7182. CreateThread(function()
  7183. local where = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(ent, 0.0, 0.0, 0.0)
  7184.  
  7185. if not FM:GetFunction("IsEntityAPed")(ent) then
  7186. where = vector3(where.x, where.y, where.z + 5.0)
  7187. end
  7188.  
  7189. FM:RequestModelSync("stt_prop_stunt_bowling_ball")
  7190. local ball_l = FM:GetFunction("CreateObject")(FM:GetFunction("GetHashKey")("stt_prop_stunt_bowling_ball"), where.x, where.y, where.z, true, true, true)
  7191. FM:DoNetwork(ball_l)
  7192. FM:GetFunction("AttachEntityToEntity")(ball_l, ent, FM:GetFunction("IsEntityAPed")(ent) and FM:GetFunction("GetPedBoneIndex")(ped, 57005) or 0, -3.0, 0, 0.0, 0.0, 0.0, 180.0, false, true, false, false, 1, true)
  7193. Wait(50)
  7194. local ball_r = FM:GetFunction("CreateObject")(FM:GetFunction("GetHashKey")("stt_prop_stunt_bowling_ball"), where.x, where.y, where.z, true, true, true)
  7195. FM:DoNetwork(ball_r)
  7196. FM:GetFunction("AttachEntityToEntity")(ball_r, ent, FM:GetFunction("IsEntityAPed")(ent) and FM:GetFunction("GetPedBoneIndex")(ped, 57005) or 0, 3.0, 0, 0.0, 0.0, 0.0, 0.0, false, true, false, false, 1, true)
  7197. Wait(50)
  7198. local shaft = FM:GetFunction("CreateObject")(FM:GetFunction("GetHashKey")("prop_container_ld2"), where.x, where.y, where.z, true, true, true)
  7199. FM:DoNetwork(shaft)
  7200. FM:GetFunction("AttachEntityToEntity")(shaft, ent, FM:GetFunction("IsEntityAPed")(ent) and FM:GetFunction("GetPedBoneIndex")(ped, 57005) or 0, -1.5, 0, 5.0, 90.0, 0, 90.0, false, true, false, false, 1, true)
  7201. Wait(50)
  7202. end)
  7203. end
  7204. }
  7205. }
  7206.  
  7207. local preview_object
  7208. local preview_object_model
  7209. local premade_options = {}
  7210. local funcs = {}
  7211.  
  7212. for name, func in dict.pairs(FM.FreeCam.SpawnerOptions["PREMADE"]) do
  7213. table.insert(premade_options, name)
  7214. table.insert(funcs, func)
  7215. end
  7216.  
  7217. function FM.FreeCam:DeletePreview()
  7218. if preview_object and FM:GetFunction("DoesEntityExist")(preview_object) then
  7219. FM.Util:DeleteEntity(preview_object)
  7220. preview_object = nil
  7221. end
  7222.  
  7223. preview_object = nil
  7224. preview_object_model = nil
  7225. end
  7226.  
  7227. local bad_models = {}
  7228. local _loading
  7229. local notif_alpha = 0
  7230. local doing_alpha
  7231. local last_alpha
  7232. local cur_notifs
  7233. local offX = 0
  7234.  
  7235. function FM.FreeCam:Spawner(where, heading, type)
  7236. local name, options
  7237. local cam_rot = FM:GetFunction("GetCamRot")(self.Cam, 0)
  7238. if self.DraggingEntity and FM:GetFunction("DoesEntityExist")(self.DraggingEntity) then return self:DeletePreview() end
  7239.  
  7240. if type == "PED" then
  7241. options = self.SpawnerOptions["PED"]
  7242.  
  7243. if selected_spawner_opt > #options then
  7244. selected_spawner_opt = 1
  7245. end
  7246.  
  7247. if preview_object then
  7248. self:DeletePreview()
  7249. end
  7250.  
  7251. name = "Ped List" .. " (" .. selected_spawner_opt .. "/" .. #options .. ")"
  7252. FM:SetIbuttons({{FM:GetFunction("GetControlInstructionalButton")(0, FM.Keys["LEFTCTRL"], 0), "Invisibility"}, {FM:GetFunction("GetControlInstructionalButton")(0, FM.Keys["LEFTSHIFT"], 0), "God Mode"}, {FM:GetFunction("GetControlInstructionalButton")(0, FM.Keys["MOUSE1"], 0), "Select"}, {"b_117", "Change Mode"}, {FM:GetFunction("GetControlInstructionalButton")(0, FM.Keys["E"], 0), "Clone"}})
  7253. elseif type == "OBJECT" then
  7254. asking_weapon = false
  7255. selected_weapon_opt = 1
  7256. options = self.SpawnerOptions["OBJECT"]
  7257.  
  7258. if selected_spawner_opt > #options then
  7259. selected_spawner_opt = 1
  7260. end
  7261.  
  7262. local cur_model = options[selected_spawner_opt]
  7263.  
  7264. if preview_object_model ~= cur_model and not _loading then
  7265. _loading = true
  7266.  
  7267. CreateThread(function()
  7268. if not FM:RequestModelSync(cur_model, 500) and not bad_models[cur_model] then
  7269. _loading = false
  7270. self:DeletePreview()
  7271. bad_models[cur_model] = true
  7272.  
  7273. return FM:AddNotification("ERORR", "Failed to load model ~r~" .. cur_model, 5000)
  7274. end
  7275.  
  7276. if bad_models[cur_model] then
  7277. _loading = false
  7278. self:DeletePreview()
  7279.  
  7280. return
  7281. end
  7282.  
  7283. if FM:GetFunction("HasModelLoaded")(cur_model) then
  7284. _loading = false
  7285. self:DeletePreview()
  7286. preview_object = FM:GetFunction("CreateObject")(FM:GetFunction("GetHashKey")(cur_model), where.x, where.y, where.z + 0.5, false, true, true)
  7287. FM:GetFunction("SetEntityCoords")(preview_object, where.x, where.y, where.z + 0.5)
  7288. FM:GetFunction("SetEntityAlpha")(preview_object, 100)
  7289. FM:GetFunction("FreezeEntityPosition")(preview_object, true)
  7290. FM:GetFunction("SetEntityRotation")(preview_object, 0.0, 0.0, cam_rot.z + 0.0)
  7291. FM:GetFunction("SetEntityCollision")(preview_object, false, false)
  7292. preview_object_model = cur_model
  7293. end
  7294. end)
  7295. end
  7296.  
  7297. if preview_object and FM:GetFunction("DoesEntityExist")(preview_object) then
  7298. FM:GetFunction("SetEntityCoords")(preview_object, where.x, where.y, where.z + 0.5)
  7299. FM:GetFunction("SetEntityAlpha")(preview_object, 100)
  7300. FM:GetFunction("FreezeEntityPosition")(preview_object, true)
  7301. FM:GetFunction("SetEntityRotation")(preview_object, 0.0, 0.0, cam_rot.z + 0.0)
  7302. FM:GetFunction("SetEntityCollision")(preview_object, false, false)
  7303. end
  7304.  
  7305. name = "Object List" .. " (" .. selected_spawner_opt .. "/" .. #options .. ")"
  7306. FM:SetIbuttons({{FM:GetFunction("GetControlInstructionalButton")(0, FM.Keys["LEFTCTRL"], 0), "Attach (Hovered)"}, {FM:GetFunction("GetControlInstructionalButton")(0, FM.Keys["MOUSE1"], 0), "Select"}, {"b_117", "Change Mode"}, {FM:GetFunction("GetControlInstructionalButton")(0, FM.Keys["E"], 0), "Clone"}})
  7307. elseif type == "PREMADE" then
  7308. asking_weapon = false
  7309. selected_weapon_opt = 1
  7310. options = premade_options
  7311.  
  7312. if selected_spawner_opt > #options then
  7313. selected_spawner_opt = 1
  7314. end
  7315.  
  7316. if preview_object then
  7317. self:DeletePreview()
  7318. end
  7319.  
  7320. name = "Premade List" .. " (" .. selected_spawner_opt .. "/" .. #options .. ")"
  7321. elseif type == "VEHICLE" then
  7322. asking_weapon = false
  7323. selected_weapon_opt = 1
  7324. options = self.SpawnerOptions["VEHICLE"]
  7325.  
  7326. if selected_spawner_opt > #options then
  7327. selected_spawner_opt = 1
  7328. end
  7329.  
  7330. if preview_object then
  7331. self:DeletePreview()
  7332. end
  7333.  
  7334. name = "Vehicle List" .. " (" .. selected_spawner_opt .. "/" .. #options .. ")"
  7335. end
  7336.  
  7337. if asking_weapon then
  7338. options = self.SpawnerOptions["WEAPONS"]
  7339. name = "Weapon List (" .. selected_weapon_opt .. "/" .. #options .. ")"
  7340. end
  7341.  
  7342. FM.Painter:DrawText("~w~[~y~Cabron Menu~w~] " .. (name or "?"), 4, false, FM:ScrW() - 360 - 21 - offX, 21, 0.35, 255, 255, 255, 255)
  7343. local sY = 30
  7344. local max_opts = 30
  7345. local cur_opt = (asking_weapon and selected_weapon_opt or selected_spawner_opt)
  7346. local count = 0
  7347. local total_opts = (#options or {})
  7348. local can_see = true
  7349.  
  7350. for id, val in dict.pairs(options or {}) do
  7351. if total_opts > max_opts then
  7352. can_see = cur_opt - 10 <= id and cur_opt + 10 >= id
  7353. else
  7354. count = 0
  7355. end
  7356.  
  7357. if can_see and count <= 10 then
  7358. local r, g, b = 255, 255, 255
  7359.  
  7360. if (asking_weapon and selected_weapon_opt or selected_spawner_opt) == id then
  7361. r, g, b = FM.Tertiary[1], FM.Tertiary[2], FM.Tertiary[3]
  7362. end
  7363.  
  7364. FM.Painter:DrawText(val, 4, false, FM:ScrW() - 360 - 21 - offX, 21 + sY, 0.35, r, g, b, 255)
  7365. sY = sY + 20
  7366. count = count + 1
  7367. end
  7368. end
  7369.  
  7370. if FM:GetFunction("IsDisabledControlJustPressed")(0, FM.Keys["DOWN"]) and not FM.Showing then
  7371. if asking_weapon then
  7372. local new = selected_weapon_opt + 1
  7373.  
  7374. if options[new] then
  7375. selected_weapon_opt = new
  7376. else
  7377. selected_weapon_opt = 1
  7378. end
  7379. else
  7380. local new = selected_spawner_opt + 1
  7381.  
  7382. if options[new] then
  7383. selected_spawner_opt = new
  7384. else
  7385. selected_spawner_opt = 1
  7386. end
  7387. end
  7388. end
  7389.  
  7390. if FM:GetFunction("IsDisabledControlJustPressed")(0, FM.Keys["UP"]) and not FM.Showing then
  7391. if asking_weapon then
  7392. local new = selected_weapon_opt - 1
  7393.  
  7394. if options[new] then
  7395. selected_weapon_opt = new
  7396. else
  7397. selected_weapon_opt = #options
  7398. end
  7399. else
  7400. local new = selected_spawner_opt - 1
  7401.  
  7402. if options[new] then
  7403. selected_spawner_opt = new
  7404. else
  7405. selected_spawner_opt = #options
  7406. end
  7407. end
  7408. end
  7409.  
  7410. if FM:GetFunction("IsDisabledControlJustPressed")(0, FM.Keys["ENTER"]) and not FM:GetFunction("IsDisabledControlJustPressed")(0, FM.Keys["MOUSE1"]) and not FM:GetFunction("IsDisabledControlJustPressed")(0, FM.Keys["SPACE"]) and not FM.Showing then
  7411. if type == "PED" then
  7412. if not asking_weapon then
  7413. selected_ped = options[selected_spawner_opt]
  7414. asking_weapon = true
  7415. else
  7416. selected_weapon = options[selected_weapon_opt]
  7417. local ped = FM:SpawnPed(where, heading, selected_ped, selected_weapon)
  7418.  
  7419. if FM:GetFunction("IsDisabledControlPressed")(0, FM.Keys["LEFTSHIFT"]) then
  7420. SetEntityInvincible(ped, true)
  7421. end
  7422.  
  7423. if FM:GetFunction("IsDisabledControlPressed")(0, FM.Keys["LEFTCTRL"]) then
  7424. FM:GetFunction("SetEntityVisible")(ped, false)
  7425. end
  7426.  
  7427. FM:AddNotification("SUCCESS", "Spawned ped.", 5000)
  7428. end
  7429. elseif type == "OBJECT" then
  7430. local object = options[selected_spawner_opt]
  7431. FM:RequestModelSync(object)
  7432. local obj = FM:GetFunction("CreateObject")(FM:GetFunction("GetHashKey")(object), where.x, where.y, where.z, true, true, true)
  7433. FM:DoNetwork(obj)
  7434. FM:GetFunction("SetEntityRotation")(obj, 0.0, 0.0, cam_rot.z + 0.0)
  7435.  
  7436. if FM:GetFunction("IsDisabledControlPressed")(0, FM.Keys["LEFTCTRL"]) and FM:GetFunction("DoesEntityExist")(self.HoveredEntity) then
  7437. FM:GetFunction("AttachEntityToEntity")(obj, self.HoveredEntity, 0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, false, true, true, true, 1, false)
  7438. end
  7439.  
  7440. Wait(50)
  7441. elseif type == "PREMADE" then
  7442. local func = funcs[selected_spawner_opt]
  7443. func(self.HoveredEntity)
  7444. elseif type == "VEHICLE" then
  7445. local model = options[selected_spawner_opt]
  7446. FM:RequestModelSync(model)
  7447. local veh = FM:GetFunction("CreateVehicle")(FM:GetFunction("GetHashKey")(model), where.x, where.y, where.z, 0.0, true, true)
  7448. FM:DoNetwork(veh)
  7449. end
  7450. end
  7451.  
  7452. if FM:GetFunction("IsDisabledControlJustPressed")(0, FM.Keys["BACKSPACE"]) and not FM:GetFunction("IsDisabledControlJustPressed")(0, FM.Keys["MOUSE2"]) and asking_weapon and not FM.Showing then
  7453. asking_weapon = false
  7454. selected_weapon_opt = 1
  7455. end
  7456.  
  7457. FM.Painter:DrawRect(FM:ScrW() - 360 - 21 - offX, 20, 360, sY + 8, 0, 0, 0, 200)
  7458. FM.Painter:DrawRect(FM:ScrW() - 360 - 21 - offX, 49, 360, 2, FM.Tertiary[1], FM.Tertiary[2], FM.Tertiary[3], 255)
  7459. end
  7460.  
  7461. local rotP, rotY, rotR
  7462. local dist = {0, 45, 90, 135, 180, -45, -90, -135, -180}
  7463. local smallest, index = dict.math.huge, 0
  7464.  
  7465. local function _snap(rot)
  7466. for _, val in dict.pairs(dist) do
  7467. local diff = dict.math.abs(val - rot)
  7468.  
  7469. if diff <= smallest then
  7470. smallest = diff
  7471. index = _
  7472. end
  7473. end
  7474.  
  7475. return dist[index] or rot
  7476. end
  7477.  
  7478. function FM:KickOutAllPassengers(ent, specific)
  7479. for i = -1, FM:GetFunction("GetVehicleMaxNumberOfPassengers")(ent) - 1 do
  7480. if not FM:GetFunction("IsVehicleSeatFree")(ent, i) and (not specific or specific == i) then
  7481. FM:GetFunction("ClearPedTasks")(FM:GetFunction("GetPedInVehicleSeat")(ent, i))
  7482. FM:GetFunction("ClearPedSecondaryTask")(FM:GetFunction("GetPedInVehicleSeat")(ent, i))
  7483. FM:GetFunction("ClearPedTasksImmediately")(FM:GetFunction("GetPedInVehicleSeat")(ent, i))
  7484. end
  7485. end
  7486. end
  7487.  
  7488. local _stealing
  7489. local _stealing_ped
  7490.  
  7491. function FM.FreeCam:DoSteal(ent)
  7492. FM:SetIbuttons({{FM:GetFunction("GetControlInstructionalButton")(0, FM.Keys["LEFTSHIFT"], 0), "Invisible"}, {FM:GetFunction("GetControlInstructionalButton")(0, FM.Keys["LEFTALT"], 0), "Fuck Up Speed"}, {FM:GetFunction("GetControlInstructionalButton")(0, FM.Keys["R"], 0), "Kick Out Driver"}, {FM:GetFunction("GetControlInstructionalButton")(0, FM.Keys["MOUSE2"], 0), "Steal (NPC)"}, {FM:GetFunction("GetControlInstructionalButton")(0, FM.Keys["MOUSE1"], 0), "Steal (Self)"}, {"b_117", "Change Mode"}})
  7493. if not self:CheckType(ent, "VEHICLE") then return end
  7494.  
  7495. if FM:GetFunction("IsDisabledControlJustPressed")(0, FM.Keys["MOUSE2"]) then
  7496. CreateThread(function()
  7497. _stealing = ent
  7498. local model = FM.FreeCam.SpawnerOptions.PED[dict.math.random(1, #FM.FreeCam.SpawnerOptions.PED)]
  7499.  
  7500. if not FM:RequestModelSync(model) then
  7501. _stealing = nil
  7502.  
  7503. return FM:AddNotification("ERROR", "Failed to steal vehicle!")
  7504. end
  7505.  
  7506. local c = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(_stealing, 0.0, 0.0, 0.0)
  7507. local x, y, z = c.x, c.y, c.z
  7508. local out, pos = FM:GetFunction("GetClosestMajorVehicleNode")(x, y, z, 10.0, 0)
  7509.  
  7510. if not out then
  7511. pos = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(_stealing, 0.0, 0.0, 0.0) + vector3(dict.math.random(-3, 3), dict.math.random(-3, 3), 0)
  7512. end
  7513.  
  7514. local random_npc = FM:GetFunction("CreatePed")(24, FM:GetFunction("GetHashKey")(model), pos.x, pos.y, pos.z, 0.0, true, true)
  7515. _stealing_ped = random_npc
  7516.  
  7517. if FM:GetFunction("IsDisabledControlPressed")(0, FM.Keys["LEFTSHIFT"]) then
  7518. FM:GetFunction("SetEntityVisible")(random_npc, false)
  7519. end
  7520.  
  7521. FM:GetFunction("SetPedAlertness")(random_npc, 0.0)
  7522. local success = FM:StealVehicleThread(random_npc, _stealing)
  7523. FM:GetFunction("TaskVehicleDriveWander")(random_npc, _stealing, 1000.0, 0)
  7524. local timeout = 0
  7525.  
  7526. if not success then
  7527. _stealing = nil
  7528. _stealing_ped = nil
  7529.  
  7530. return
  7531. end
  7532.  
  7533. while FM:GetFunction("DoesEntityExist")(_stealing) and FM:GetFunction("GetPedInVehicleSeat")(_stealing, -1) ~= random_npc and not FM:GetFunction("IsEntityDead")(random_npc) and timeout <= 25000 do
  7534. timeout = timeout + 10
  7535. Wait(100)
  7536. end
  7537.  
  7538. if FM:GetFunction("GetPedInVehicleSeat")(_stealing, -1) ~= random_npc then
  7539. _stealing = nil
  7540.  
  7541. return FM:AddNotification("ERROR", "Failed to steal vehicle!")
  7542. end
  7543.  
  7544. _stealing_ped = nil
  7545. _stealing = nil
  7546. end)
  7547. elseif FM:GetFunction("IsDisabledControlJustPressed")(0, FM.Keys["MOUSE1"]) then
  7548. CreateThread(function()
  7549. _stealing = ent
  7550. FM:KickOutAllPassengers(ent)
  7551. FM:GetFunction("TaskWarpPedIntoVehicle")(FM:GetFunction("PlayerPedId")(), ent, -1)
  7552. _stealing_ped = nil
  7553. _stealing = nil
  7554. end)
  7555. elseif FM:GetFunction("IsDisabledControlJustPressed")(0, FM.Keys["R"]) then
  7556. CreateThread(function()
  7557. _stealing = ent
  7558. local driver = FM:GetFunction("GetPedInVehicleSeat")(ent, -1)
  7559. FM:KickOutAllPassengers(ent, -1)
  7560. FM:GetFunction("TaskWanderStandard")(driver)
  7561. _stealing_ped = nil
  7562. _stealing = nil
  7563. end)
  7564. end
  7565.  
  7566. if FM:GetFunction("IsDisabledControlJustPressed")(0, FM.Keys["LEFTALT"]) then
  7567. CreateThread(function()
  7568. FM:GetFunction("NetworkRequestControlOfEntity")(ent)
  7569.  
  7570. if FM:GetFunction("NetworkHasControlOfEntity")(ent) then
  7571. FM:GetFunction("ModifyVehicleTopSpeed")(ent, 250000.0)
  7572.  
  7573. return FM:AddNotification("SUCCESS", "Speed fucked!")
  7574. end
  7575. end)
  7576. end
  7577.  
  7578. self:DrawBoundingBox(ent, 122, 177, 220, 50)
  7579. self:DrawInfoCard(ent)
  7580. end
  7581.  
  7582. function FM.FreeCam:DoTaze(ent, endCoords)
  7583. FM:SetIbuttons({{FM:GetFunction("GetControlInstructionalButton")(0, FM.Keys["MOUSE1"], 0), "Taze"}, {"b_117", "Change Mode"}})
  7584.  
  7585. if FM:GetFunction("DoesEntityExist")(ent) and _is_ped_player(ent) then
  7586. self:DrawBoundingBox(ent, 50, 122, 200, 50)
  7587. end
  7588.  
  7589. if IsDisabledControlJustPressed(0, FM.Keys["MOUSE1"]) then
  7590. if FM:GetFunction("DoesEntityExist")(ent) and _is_ped_player(ent) then
  7591. FM:TazePlayer(ent)
  7592. else
  7593. FM:GetFunction("ShootSingleBulletBetweenCoords")(camX, camY, camZ, endCoords.x, endCoords.y, endCoords.z, 1, true, FM:GetFunction("GetHashKey")("WEAPON_STUNGUN"), FM:GetFunction("PlayerPedId")(), true, false, 24000.0)
  7594. end
  7595. end
  7596. end
  7597.  
  7598. function FM.FreeCam:DoHydrant(ent, endCoords)
  7599. FM:SetIbuttons({{FM:GetFunction("GetControlInstructionalButton")(0, FM.Keys["MOUSE1"], 0), "Hydrant"}, {"b_117", "Change Mode"}})
  7600.  
  7601. if FM:GetFunction("DoesEntityExist")(ent) and _is_ped_player(ent) then
  7602. self:DrawBoundingBox(ent, 50, 122, 200, 50)
  7603. end
  7604.  
  7605. if IsDisabledControlJustPressed(0, FM.Keys["MOUSE1"]) then
  7606. if FM:GetFunction("DoesEntityExist")(ent) and _is_ped_player(ent) then
  7607. FM:HydrantPlayer(ent)
  7608. else
  7609. FM:GetFunction("AddExplosion")(endCoords.x, endCoords.y, endCoords.z, 13, 100.0, false, false, 0.0)
  7610. end
  7611. end
  7612. end
  7613.  
  7614. function FM.FreeCam:DoFire(ent, endCoords)
  7615. FM:SetIbuttons({{FM:GetFunction("GetControlInstructionalButton")(0, FM.Keys["MOUSE1"], 0), "Fire"}, {"b_117", "Change Mode"}})
  7616.  
  7617. if FM:GetFunction("DoesEntityExist")(ent) and _is_ped_player(ent) then
  7618. self:DrawBoundingBox(ent, 50, 122, 200, 50)
  7619. end
  7620.  
  7621. if IsDisabledControlJustPressed(0, FM.Keys["MOUSE1"]) then
  7622. if FM:GetFunction("DoesEntityExist")(ent) and _is_ped_player(ent) then
  7623. FM:FirePlayer(ent)
  7624. else
  7625. FM:GetFunction("AddExplosion")(endCoords.x, endCoords.y, endCoords.z, 12, 100.0, false, false, 0.0)
  7626. end
  7627. end
  7628. end
  7629.  
  7630. function FM.FreeCam:DoExplosion(ent, endCoords)
  7631. FM:SetIbuttons({{FM:GetFunction("GetControlInstructionalButton")(0, FM.Keys["MOUSE1"], 0), "Explode"}, {"b_117", "Change Mode"}})
  7632.  
  7633. if FM:GetFunction("DoesEntityExist")(ent) and (_is_ped_player(ent) or FM:GetFunction("IsEntityAVehicle")(ent)) then
  7634. self:DrawBoundingBox(ent, 50, 122, 200, 50)
  7635. end
  7636.  
  7637. if IsDisabledControlJustPressed(0, FM.Keys["MOUSE1"]) then
  7638. if FM:GetFunction("DoesEntityExist")(ent) and _is_ped_player(ent) then
  7639. FM:GetFunction("AddExplosion")(FM:GetFunction("GetOffsetFromEntityInWorldCoords")(ent, 0.0, 0.0, 0.0), 7, 100000.0, true, false, 0.0)
  7640. elseif FM:GetFunction("DoesEntityExist")(ent) and FM:GetFunction("IsEntityAVehicle")(ent) then
  7641. FM:GetFunction("NetworkExplodeVehicle")(ent, true, false, false)
  7642. else
  7643. FM:GetFunction("AddExplosion")(endCoords.x, endCoords.y, endCoords.z, 7, 100000.0, true, false, 0.0)
  7644. end
  7645. end
  7646. end
  7647.  
  7648. local preview_spike_strip
  7649. local spike_model = "p_ld_stinger_s"
  7650.  
  7651. function FM.FreeCam:DoSpikeStrips(ent, endCoords)
  7652. if not preview_spike_strip then
  7653. preview_spike_strip = FM:GetFunction("CreateObject")(FM:GetFunction("GetHashKey")(spike_model), endCoords.x, endCoords.y, endCoords.z + 0.1, false, true, true)
  7654. end
  7655.  
  7656. local rot = FM:GetFunction("GetCamRot")(self.Cam, 0)
  7657. FM:GetFunction("SetEntityCoords")(preview_spike_strip, endCoords.x, endCoords.y, endCoords.z + 0.1)
  7658. FM:GetFunction("SetEntityAlpha")(preview_spike_strip, 100)
  7659. FM:GetFunction("FreezeEntityPosition")(preview_spike_strip, true)
  7660. FM:GetFunction("SetEntityRotation")(preview_spike_strip, 0.0, 0.0, rot.z + 0.0)
  7661. FM:GetFunction("SetEntityCollision")(preview_spike_strip, false, false)
  7662.  
  7663. if IsDisabledControlJustPressed(0, FM.Keys["MOUSE1"]) then
  7664. rot = FM:GetFunction("GetEntityRotation")(preview_spike_strip)
  7665. local spike_strip = FM:GetFunction("CreateObject")(FM:GetFunction("GetHashKey")(spike_model), endCoords.x, endCoords.y, endCoords.z - 0.2, true, true, true)
  7666. FM:DoNetwork(spike_strip)
  7667. FM:GetFunction("SetEntityRotation")(spike_strip, rot)
  7668. FM:GetFunction("FreezeEntityPosition")(spike_strip, true)
  7669. end
  7670. end
  7671.  
  7672. function FM.FreeCam:DoDisable(ent, endCoords)
  7673. if FM:GetFunction("IsEntityAVehicle")(ent) then
  7674. if IsDisabledControlJustPressed(0, FM.Keys["MOUSE1"]) then
  7675. FM:DisableVehicle(ent)
  7676. end
  7677.  
  7678. self:DrawBoundingBox(ent, 50, 122, 200, 50)
  7679. end
  7680. end
  7681.  
  7682. local _stealing
  7683. local _stealing_ped
  7684.  
  7685. function FM.FreeCam:DoRCCar(ent, endCoords)
  7686. FM:SetIbuttons({{FM:GetFunction("GetControlInstructionalButton")(0, FM.Keys["LEFTSHIFT"], 0), "Invisible"}, {FM:GetFunction("GetControlInstructionalButton")(0, FM.Keys["X"], 0), "Spawn (NPC)"}, {FM:GetFunction("GetControlInstructionalButton")(0, FM.Keys["R"], 0), "Release Car (If Active)"}, {FM:GetFunction("GetControlInstructionalButton")(0, FM.Keys["MOUSE2"], 0), "Steal (NPC)"}, {FM:GetFunction("GetControlInstructionalButton")(0, FM.Keys["MOUSE1"], 0), "Steal (Force)"}, {"b_117", "Change Mode"}})
  7687.  
  7688. if _stealing then
  7689. self:DrawBoundingBox(_stealing_ped, 255, 122, 184, 50)
  7690.  
  7691. return self:DrawBoundingBox(_stealing, 255, 120, 255, 50)
  7692. end
  7693.  
  7694. if FM:GetFunction("IsDisabledControlJustPressed")(0, FM.Keys["R"]) and FM.RCCar.On then
  7695. FM:AddNotification("INFO", "Released RC Car!")
  7696. _stealing = nil
  7697. _stealing_ped = nil
  7698.  
  7699. return FM:DoRCCar(false)
  7700. end
  7701.  
  7702. if FM:GetFunction("IsDisabledControlJustPressed")(0, FM.Keys["MOUSE2"]) and self:CheckType(ent, "VEHICLE") then
  7703. CreateThread(function()
  7704. _stealing = ent
  7705. local model = FM.FreeCam.SpawnerOptions.PED[dict.math.random(1, #FM.FreeCam.SpawnerOptions.PED)]
  7706.  
  7707. if not FM:RequestModelSync(model) then
  7708. _stealing = nil
  7709.  
  7710. return FM:AddNotification("Failed to steal vehicle!")
  7711. end
  7712.  
  7713. local c = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(_stealing, 0.0, 0.0, 0.0)
  7714. local x, y, z = c.x, c.y, c.z
  7715. local out, pos = FM:GetFunction("GetClosestMajorVehicleNode")(x, y, z, 10.0, 0)
  7716.  
  7717. if not out then
  7718. pos = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(_stealing, 0.0, 0.0, 0.0) + vector3(dict.math.random(-3, 3), dict.math.random(-3, 3), 0)
  7719. end
  7720.  
  7721. local random_npc = FM:GetFunction("CreatePed")(24, FM:GetFunction("GetHashKey")(model), pos.x, pos.y, pos.z, 0.0, true, true)
  7722. _stealing_ped = random_npc
  7723.  
  7724. if FM:GetFunction("IsDisabledControlPressed")(0, FM.Keys["LEFTSHIFT"]) then
  7725. FM:GetFunction("SetEntityVisible")(random_npc, false)
  7726. end
  7727.  
  7728. FM:GetFunction("SetPedAlertness")(random_npc, 0.0)
  7729. local success = FM:StealVehicleThread(random_npc, _stealing, true)
  7730. FM:GetFunction("TaskSetBlockingOfNonTemporaryEvents")(random_npc, true)
  7731. FM:GetFunction("TaskVehicleDriveWander")(random_npc, _stealing, 1000.0, 0)
  7732. local timeout = 0
  7733.  
  7734. if not success then
  7735. _stealing = nil
  7736. _stealing_ped = nil
  7737.  
  7738. return
  7739. end
  7740.  
  7741. while FM:GetFunction("DoesEntityExist")(_stealing) and FM:GetFunction("GetPedInVehicleSeat")(_stealing, -1) ~= random_npc and not FM:GetFunction("IsEntityDead")(random_npc) and timeout <= 25000 do
  7742. timeout = timeout + 10
  7743. Wait(100)
  7744. end
  7745.  
  7746. if FM:GetFunction("GetPedInVehicleSeat")(_stealing, -1) ~= random_npc then
  7747. _stealing = nil
  7748.  
  7749. return FM:AddNotification("ERROR", "Failed to steal vehicle!")
  7750. end
  7751.  
  7752. FM:DoRCCar(random_npc, _stealing)
  7753. _stealing_ped = nil
  7754. _stealing = nil
  7755. end)
  7756. elseif FM:GetFunction("IsDisabledControlJustPressed")(0, FM.Keys["MOUSE1"]) and self:CheckType(ent, "VEHICLE") then
  7757. CreateThread(function()
  7758. _stealing = ent
  7759. local model = FM.FreeCam.SpawnerOptions.PED[dict.math.random(1, #FM.FreeCam.SpawnerOptions.PED)]
  7760.  
  7761. if not FM:RequestModelSync(model) then
  7762. _stealing = nil
  7763.  
  7764. return FM:AddNotification("ERROR", "Failed to steal vehicle!")
  7765. end
  7766.  
  7767. FM:GetFunction("ClearPedTasksImmediately")(FM:GetFunction("GetPedInVehicleSeat")(_stealing, -1))
  7768. local random_npc = FM:GetFunction("CreatePedInsideVehicle")(_stealing, 24, FM:GetFunction("GetHashKey")(model), -1, true, true)
  7769.  
  7770. if FM:GetFunction("IsDisabledControlPressed")(0, FM.Keys["LEFTSHIFT"]) then
  7771. FM:GetFunction("SetEntityVisible")(random_npc, false)
  7772. end
  7773.  
  7774. FM:GetFunction("SetPedAlertness")(random_npc, 0.0)
  7775. FM:GetFunction("TaskSetBlockingOfNonTemporaryEvents")(random_npc, true)
  7776. FM:GetFunction("TaskVehicleDriveWander")(random_npc, _stealing, 1000.0, 0)
  7777. _stealing_ped = random_npc
  7778.  
  7779. if FM:GetFunction("GetPedInVehicleSeat")(_stealing, -1) ~= random_npc then
  7780. _stealing = nil
  7781.  
  7782. return FM:AddNotification("ERROR", "Failed to steal vehicle!")
  7783. end
  7784.  
  7785. FM:DoRCCar(random_npc, _stealing)
  7786. _stealing_ped = nil
  7787. _stealing = nil
  7788. end)
  7789. elseif FM:GetFunction("IsDisabledControlJustPressed")(0, FM.Keys["X"]) then
  7790. CreateThread(function()
  7791. local modelName = FM:GetTextInput("Enter vehicle spawn name", "", 20)
  7792. if modelName == "" or not FM:RequestModelSync(modelName) then return FM:AddNotification("ERROR", "That is not a vaild vehicle model.", 10000) end
  7793.  
  7794. if modelName then
  7795. local car = FM:GetFunction("CreateVehicle")(FM:GetFunction("GetHashKey")(modelName), endCoords.x, endCoords.y, endCoords.z, dict.math.random(-360, 360) + 0.0, true, false)
  7796.  
  7797. if FM:GetFunction("DoesEntityExist")(car) then
  7798. _stealing = car
  7799. local model = FM.FreeCam.SpawnerOptions.PED[dict.math.random(1, #FM.FreeCam.SpawnerOptions.PED)]
  7800.  
  7801. if not FM:RequestModelSync(model) then
  7802. _stealing = nil
  7803.  
  7804. return FM:AddNotification("ERROR", "Failed to steal vehicle!")
  7805. end
  7806.  
  7807. FM:GetFunction("ClearPedTasksImmediately")(FM:GetFunction("GetPedInVehicleSeat")(_stealing, -1))
  7808. local random_npc = FM:GetFunction("CreatePedInsideVehicle")(_stealing, 24, FM:GetFunction("GetHashKey")(model), -1, true, true)
  7809. FM:GetFunction("SetPedAlertness")(random_npc, 0.0)
  7810. FM:GetFunction("TaskSetBlockingOfNonTemporaryEvents")(random_npc, true)
  7811. FM:GetFunction("TaskVehicleDriveWander")(random_npc, _stealing, 1000.0, 0)
  7812. _stealing_ped = random_npc
  7813.  
  7814. if FM:GetFunction("GetPedInVehicleSeat")(_stealing, -1) ~= random_npc then
  7815. _stealing = nil
  7816.  
  7817. return FM:AddNotification("ERROR", "Failed to steal vehicle!")
  7818. end
  7819.  
  7820. FM:DoRCCar(random_npc, _stealing)
  7821. _stealing_ped = nil
  7822. _stealing = nil
  7823. end
  7824. end
  7825. end)
  7826. end
  7827.  
  7828. self:DrawBoundingBox(ent, 255, 255, 120, 50)
  7829. self:DrawInfoCard(ent)
  7830. end
  7831.  
  7832. function FM.FreeCam:ManipulationLogic(cam, x, y, z)
  7833. if FM:GetFunction("UpdateOnscreenKeyboard")() ~= -1 and FM:GetFunction("UpdateOnscreenKeyboard")() ~= 1 and FM:GetFunction("UpdateOnscreenKeyboard")() ~= 2 then return end
  7834. self:Crosshair((FM:GetFunction("DoesEntityHaveDrawable")(self.HoveredEntity) and FM:GetFunction("DoesEntityExist")(self.HoveredEntity)) or (FM:GetFunction("DoesEntityHaveDrawable")(self.DraggingEntity) and FM:GetFunction("DoesEntityExist")(self.DraggingEntity)))
  7835. local rightVec, forwardVec, upVec = FM:GetFunction("GetCamMatrix")(cam)
  7836. local curVec = vector3(x, y, z)
  7837. local targetVec = curVec + forwardVec * 150
  7838. local handle = FM:GetFunction("StartShapeTestRay")(curVec.x, curVec.y, curVec.z, targetVec.x, targetVec.y, targetVec.z, -1)
  7839. local _, hit, endCoords, _, entity = FM:GetFunction("GetShapeTestResult")(handle)
  7840.  
  7841. if self.DraggingEntity and not FM:GetFunction("DoesEntityExist")(self.DraggingEntity) then
  7842. self.DraggingEntity = nil
  7843. self.Rotating = nil
  7844. lift_height = 0.0
  7845. lift_inc = 0.1
  7846.  
  7847. return
  7848. end
  7849.  
  7850. if FM.Showing then return end
  7851.  
  7852. if notif_alpha > 0 then
  7853. offX = _lerp(0.1, offX, 429)
  7854. else
  7855. offX = _lerp(0.1, offX, 0)
  7856. end
  7857.  
  7858. if not hit then
  7859. endCoords = targetVec
  7860. end
  7861.  
  7862. if preview_spike_strip and FM:GetFunction("DoesEntityExist")(preview_spike_strip) and self.Mode ~= self.Modes["SPIKE_STRIPS"] then
  7863. FM.Util:DeleteEntity(preview_spike_strip)
  7864. preview_spike_strip = nil
  7865. end
  7866.  
  7867. if self:CheckType(entity, "ALL") then
  7868. self.HoveredEntity = entity
  7869. else
  7870. self.HoveredEntity = nil
  7871. end
  7872.  
  7873. if self.Mode == self.Modes["REMOVER"] then return self:Remover(entity, "ALL") end
  7874. FM:SetIbuttons({{FM:GetFunction("GetControlInstructionalButton")(0, FM.Keys["MOUSE1"], 0), "Select"}, {"b_117", "Change Mode"}, {FM:GetFunction("GetControlInstructionalButton")(0, FM.Keys["E"], 0), "Clone"}})
  7875.  
  7876. if self.Mode == self.Modes["PED_SPAWNER"] then
  7877. self:Spawner(endCoords, GetGameplayCamRelativeHeading(), "PED")
  7878. elseif self.Mode == self.Modes["OBJ_SPAWNER"] then
  7879. self:Spawner(endCoords, GetGameplayCamRelativeHeading(), "OBJECT")
  7880. elseif self.Mode == self.Modes["VEH_SPAWNER"] then
  7881. self:Spawner(endCoords, GetGameplayCamRelativeHeading(), "VEHICLE")
  7882. elseif self.Mode == self.Modes["PREMADE_SPAWNER"] then
  7883. self:Spawner(endCoords, GetGameplayCamRelativeHeading(), "PREMADE")
  7884. elseif self.Mode == self.Modes["TELEPORT"] then
  7885. FM:SetIbuttons({{FM:GetFunction("GetControlInstructionalButton")(0, FM.Keys["MOUSE1"], 0), "Teleport"}, {"b_117", "Change Mode"}})
  7886.  
  7887. if FM:GetFunction("IsDisabledControlJustPressed")(0, FM.Keys["MOUSE1"]) and not FM.Showing and hit then
  7888. FM:GetFunction("SetEntityCoords")(FM:GetFunction("PlayerPedId")(), endCoords.x, endCoords.y, endCoords.z)
  7889. FM:AddNotification("INFO", "Teleported!", 2500)
  7890. end
  7891.  
  7892. return
  7893. elseif self.Mode == self.Modes["RC_CAR"] then
  7894. return self:DoRCCar(self.HoveredEntity, endCoords)
  7895. elseif self.Mode == self.Modes["STEAL"] then
  7896. return self:DoSteal(self.HoveredEntity)
  7897. elseif self.Mode == self.Modes["TAZE"] then
  7898. return self:DoTaze(self.HoveredEntity, endCoords)
  7899. elseif self.Mode == self.Modes["HYDRANT"] then
  7900. return self:DoHydrant(self.HoveredEntity, endCoords)
  7901. elseif self.Mode == self.Modes["FIRE"] then
  7902. return self:DoFire(self.HoveredEntity, endCoords)
  7903. elseif self.Mode == self.Modes["SPIKE_STRIPS"] then
  7904. return self:DoSpikeStrips(self.HoveredEntity, endCoords)
  7905. elseif self.Mode == self.Modes["DISABLE_VEHICLE"] then
  7906. return self:DoDisable(self.HoveredEntity, endCoords)
  7907. elseif self.Mode == self.Modes["EXPLODE"] then
  7908. return self:DoExplosion(self.HoveredEntity, endCoords)
  7909. end
  7910.  
  7911. if FM:GetFunction("DoesEntityExist")(self.DraggingEntity) then
  7912. if frozen_ents[self.DraggingEntity] == nil then
  7913. frozen_ents[self.DraggingEntity] = true
  7914. end
  7915.  
  7916. if FM:GetFunction("IsDisabledControlJustPressed")(0, FM.Keys["DELETE"]) and not FM.Showing then
  7917. if self.DraggingEntity == FM:GetFunction("PlayerPedId")() then return FM:AddNotification("ERROR", "You can not delete yourself!", 10000) end
  7918. if _is_ped_player(self.DraggingEntity) then return FM:AddNotification("ERROR", "You can not delete players!", 10000) end
  7919. self:DrawBoundingBox(self.DraggingEntity, 255, 50, 50, 50)
  7920. FM:AddNotification("INFO", "Deleted ~y~" .. dict.tostring(self.DraggingEntity) .. "~w~", 10000)
  7921. FM.Util:DeleteEntity(self.DraggingEntity)
  7922. self.DraggingEntity = nil
  7923. lift_height = 0.0
  7924. lift_inc = 0.1
  7925. self.Rotating = nil
  7926.  
  7927. return
  7928. end
  7929.  
  7930. if FM:GetFunction("IsDisabledControlJustPressed")(0, FM.Keys["E"]) then
  7931. self:Clone(self.DraggingEntity)
  7932. end
  7933.  
  7934. if FM:GetFunction("IsDisabledControlJustPressed")(0, FM.Keys["MOUSE2"]) and not FM.Showing then
  7935. local data = self.DraggingData
  7936.  
  7937. if data then
  7938. FM:GetFunction("SetEntityCoords")(self.DraggingEntity, data.Position.x, data.Position.y, data.Position.z)
  7939. FM:GetFunction("SetEntityRotation")(self.DraggingEntity, data.Rotation.x, data.Rotation.y, data.Rotation.z)
  7940. end
  7941.  
  7942. self.DraggingEntity = nil
  7943. lift_height = 0.0
  7944. lift_inc = 0.1
  7945. self.Rotating = nil
  7946.  
  7947. return
  7948. elseif FM:GetFunction("IsDisabledControlJustPressed")(0, FM.Keys["MOUSE1"]) and not FM.Showing then
  7949. self.DraggingEntity = nil
  7950. lift_height = 0.0
  7951. lift_inc = 0.1
  7952. self.Rotating = nil
  7953.  
  7954. return
  7955. end
  7956.  
  7957. if FM:GetFunction("IsDisabledControlJustPressed")(0, FM.Keys["R"]) and not FM.Showing then
  7958. self.Rotating = not self.Rotating
  7959. local rot = FM:GetFunction("GetEntityRotation")(self.DraggingEntity)
  7960. rotP, rotY, rotR = rot.x, rot.y, rot.z
  7961. end
  7962.  
  7963. if FM:GetFunction("IsDisabledControlJustPressed")(0, FM.Keys["LEFTALT"]) and not self.Rotating then
  7964. frozen_ents[self.DraggingEntity] = not frozen_ents[self.DraggingEntity]
  7965. end
  7966.  
  7967. FM:GetFunction("FreezeEntityPosition")(self.DraggingEntity, frozen_ents[entity])
  7968.  
  7969. if self.Rotating and not FM.Showing then
  7970. self:DrawBoundingBox(self.DraggingEntity, 255, 125, 50, 50)
  7971. FM:SetIbuttons({{FM:GetFunction("GetControlInstructionalButton")(0, FM.Keys["R"], 0), "Exit Rotate Mode"}, {FM:GetFunction("GetControlInstructionalButton")(0, FM.Keys["MOUSE2"], 0), "Reset Position"}, {FM:GetFunction("GetControlInstructionalButton")(0, FM.Keys["MOUSE1"], 0), "Stop Dragging"}, {FM:GetFunction("GetControlInstructionalButton")(0, FM.Keys["LEFTSHIFT"], 0), "Snap Nearest 45 Degrees"}, {FM:GetFunction("GetControlInstructionalButton")(0, FM.Keys["LEFTALT"], 0), "Increment x" .. (FM:GetFunction("IsDisabledControlPressed")(0, FM.Keys["LEFTALT"]) and 1.0 or 15.0)}, {"t_D%t_A", "Roll"}, {"t_W%t_S", "Pitch"}, {"b_2000%t_X", "Yaw"}})
  7972.  
  7973. if FM:GetFunction("IsDisabledControlJustPressed")(0, FM.Keys["D"]) then
  7974. rotR = rotR + (FM:GetFunction("IsDisabledControlPressed")(0, FM.Keys["LEFTALT"]) and 1.0 or 15.0)
  7975.  
  7976. if FM:GetFunction("IsDisabledControlPressed")(0, FM.Keys["LEFTSHIFT"]) then
  7977. rotR = _snap(rotR)
  7978. end
  7979. end
  7980.  
  7981. if FM:GetFunction("IsDisabledControlJustPressed")(0, FM.Keys["A"]) then
  7982. rotR = rotR - (FM:GetFunction("IsDisabledControlPressed")(0, FM.Keys["LEFTALT"]) and 1.0 or 15.0)
  7983.  
  7984. if FM:GetFunction("IsDisabledControlPressed")(0, FM.Keys["LEFTSHIFT"]) then
  7985. rotR = _snap(rotR)
  7986. end
  7987. end
  7988.  
  7989. if FM:GetFunction("IsDisabledControlJustPressed")(0, FM.Keys["W"]) then
  7990. rotP = rotP - (FM:GetFunction("IsDisabledControlPressed")(0, FM.Keys["LEFTALT"]) and 1.0 or 15.0)
  7991.  
  7992. if FM:GetFunction("IsDisabledControlPressed")(0, FM.Keys["LEFTSHIFT"]) then
  7993. rotP = _snap(rotP)
  7994. end
  7995. end
  7996.  
  7997. if FM:GetFunction("IsDisabledControlJustPressed")(0, FM.Keys["S"]) then
  7998. rotP = rotP + (FM:GetFunction("IsDisabledControlPressed")(0, FM.Keys["LEFTALT"]) and 1.0 or 15.0)
  7999.  
  8000. if FM:GetFunction("IsDisabledControlPressed")(0, FM.Keys["LEFTSHIFT"]) then
  8001. rotP = _snap(rotP)
  8002. end
  8003. end
  8004.  
  8005. if FM:GetFunction("IsDisabledControlJustPressed")(0, FM.Keys["SPACE"]) then
  8006. rotY = rotY - (FM:GetFunction("IsDisabledControlPressed")(0, FM.Keys["LEFTALT"]) and 1.0 or 15.0)
  8007.  
  8008. if FM:GetFunction("IsDisabledControlPressed")(0, FM.Keys["LEFTSHIFT"]) then
  8009. rotY = _snap(rotY)
  8010. end
  8011. end
  8012.  
  8013. if FM:GetFunction("IsDisabledControlJustPressed")(0, FM.Keys["X"]) then
  8014. rotY = rotY + (FM:GetFunction("IsDisabledControlPressed")(0, FM.Keys["LEFTALT"]) and 1.0 or 15.0)
  8015.  
  8016. if FM:GetFunction("IsDisabledControlPressed")(0, FM.Keys["LEFTSHIFT"]) then
  8017. rotY = _snap(rotY)
  8018. end
  8019. end
  8020.  
  8021. FM:GetFunction("SetEntityRotation")(self.DraggingEntity, rotP + 0.0, rotY + 0.0, rotR + 0.0)
  8022. self:DrawInfoCard(self.DraggingEntity)
  8023.  
  8024. return FM:GetFunction("NetworkRequestControlOfEntity")(self.DraggingEntity)
  8025. end
  8026.  
  8027. local handleTrace = FM:GetFunction("StartShapeTestRay")(curVec.x, curVec.y, curVec.z, targetVec.x, targetVec.y, targetVec.z, -1, self.DraggingEntity)
  8028. local _, hit, endPos, _, _ = FM:GetFunction("GetShapeTestResult")(handleTrace)
  8029. local c = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(self.DraggingEntity, 0.0, 0.0, 0.0)
  8030. local cX, cY, cZ = c.x, c.y, c.z
  8031. local cam_rot = FM:GetFunction("GetCamRot")(self.Cam, 0)
  8032. local rot = FM:GetFunction("GetEntityRotation")(self.DraggingEntity)
  8033. FM:GetFunction("SetEntityRotation")(self.DraggingEntity, rot.x, rot.y, cam_rot.z + 0.0)
  8034.  
  8035. if IsDisabledControlJustPressed(0, FM.Keys["["]) then
  8036. lift_inc = lift_inc + 0.05
  8037.  
  8038. if lift_inc <= 0.01 then
  8039. lift_inc = 0.01
  8040. elseif lift_inc >= 3 then
  8041. lift_inc = 3
  8042. end
  8043. end
  8044.  
  8045. if IsDisabledControlJustPressed(0, FM.Keys["]"]) then
  8046. lift_inc = lift_inc - 0.05
  8047.  
  8048. if lift_inc <= 0.01 then
  8049. lift_inc = 0.01
  8050. elseif lift_inc >= 3 then
  8051. lift_inc = 3
  8052. end
  8053. end
  8054.  
  8055. if IsDisabledControlPressed(0, FM.Keys["C"]) then
  8056. lift_height = lift_height + lift_inc
  8057. end
  8058.  
  8059. if IsDisabledControlPressed(0, FM.Keys["Z"]) then
  8060. lift_height = lift_height - lift_inc
  8061. end
  8062.  
  8063. if hit then
  8064. FM:GetFunction("SetEntityCoords")(self.DraggingEntity, endPos.x, endPos.y, endPos.z + lift_height)
  8065. self:DrawBoundingBox(self.DraggingEntity, 50, 255, 50, 50)
  8066. else
  8067. FM:GetFunction("SetEntityCoords")(self.DraggingEntity, targetVec.x, targetVec.y, targetVec.z + lift_height)
  8068. self:DrawBoundingBox(self.DraggingEntity, 50, 255, 50, 50)
  8069. end
  8070.  
  8071. self:DrawInfoCard(self.DraggingEntity)
  8072. FM:SetIbuttons({{FM:GetFunction("GetControlInstructionalButton")(0, FM.Keys["C"], 0), "Lift Up (+" .. lift_inc .. ")"}, {FM:GetFunction("GetControlInstructionalButton")(0, FM.Keys["Z"], 0), "Push Down (-" .. lift_inc .. ")"}, {FM:GetFunction("GetControlInstructionalButton")(0, FM.Keys["R"], 0), "Rotate"}, {FM:GetFunction("GetControlInstructionalButton")(0, FM.Keys["LEFTALT"], 0), "Toggle Frozen"}, {FM:GetFunction("GetControlInstructionalButton")(0, FM.Keys["MOUSE2"], 0), "Reset Position"}, {FM:GetFunction("GetControlInstructionalButton")(0, FM.Keys["MOUSE1"], 0), "Stop Dragging"}, {FM:GetFunction("GetControlInstructionalButton")(0, FM.Keys["E"], 0), "Clone"}})
  8073.  
  8074. return FM:GetFunction("NetworkRequestControlOfEntity")(self.DraggingEntity)
  8075. end
  8076.  
  8077. local ent = FM:GetFunction("DoesEntityExist")(self.DraggingEntity) and self.DraggingEntity or self.HoveredEntity
  8078.  
  8079. if FM:GetFunction("DoesEntityExist")(ent) and FM:GetFunction("IsDisabledControlJustPressed")(0, FM.Keys["E"]) then
  8080. self:Clone(ent)
  8081. end
  8082.  
  8083. if FM:GetFunction("IsDisabledControlPressed")(0, FM.Keys["LEFTSHIFT"]) or beginning_target ~= nil then return self:PedTarget(cam, x, y, z) end
  8084.  
  8085. if FM:GetFunction("DoesEntityExist")(self.HoveredEntity) and FM:GetFunction("DoesEntityHaveDrawable")(self.HoveredEntity) and not FM:GetFunction("DoesEntityExist")(self.DraggingEntity) then
  8086. if FM:GetFunction("IsDisabledControlJustPressed")(0, FM.Keys["MOUSE1"]) and not FM.Showing and not _is_ped_player(self.HoveredEntity) then
  8087. self.DraggingEntity = self.HoveredEntity
  8088.  
  8089. self.DraggingData = {
  8090. Position = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(self.HoveredEntity, 0.0, 0.0, 0.0),
  8091. Rotation = FM:GetFunction("GetEntityRotation")(self.HoveredEntity)
  8092. }
  8093. else
  8094. self:DrawBoundingBox(self.HoveredEntity, 255, 255, 255, 50)
  8095. self:DrawInfoCard(self.HoveredEntity)
  8096. end
  8097. end
  8098. end
  8099.  
  8100. function FM.FreeCam:DisableMovement(off)
  8101. FM:GetFunction("DisableControlAction")(1, 30, off)
  8102. FM:GetFunction("DisableControlAction")(1, 31, off)
  8103. FM:GetFunction("DisableControlAction")(1, 32, off)
  8104. FM:GetFunction("DisableControlAction")(1, 33, off)
  8105. FM:GetFunction("DisableControlAction")(1, 34, off)
  8106. FM:GetFunction("DisableControlAction")(1, 35, off)
  8107. FM:GetFunction("DisableControlAction")(1, 36, off)
  8108. FM:GetFunction("DisableControlAction")(1, 37, off)
  8109. FM:GetFunction("DisableControlAction")(1, 38, off)
  8110. FM:GetFunction("DisableControlAction")(1, 44, off)
  8111. FM:GetFunction("DisableControlAction")(1, 45, off)
  8112. FM:GetFunction("DisableControlAction")(0, 63, off)
  8113. FM:GetFunction("DisableControlAction")(0, 64, off)
  8114. FM:GetFunction("DisableControlAction")(0, 71, off)
  8115. FM:GetFunction("DisableControlAction")(0, 72, off)
  8116. FM:GetFunction("DisableControlAction")(0, 75, off)
  8117. FM:GetFunction("DisableControlAction")(0, 278, off)
  8118. FM:GetFunction("DisableControlAction")(0, 279, off)
  8119. FM:GetFunction("DisableControlAction")(0, 280, off)
  8120. FM:GetFunction("DisableControlAction")(0, 281, off)
  8121. FM:GetFunction("DisablePlayerFiring")(FM:GetFunction("PlayerId")(), off)
  8122. FM:GetFunction("DisableControlAction")(0, 24, off)
  8123. FM:GetFunction("DisableControlAction")(0, 25, off)
  8124. FM:GetFunction("DisableControlAction")(1, 37, off)
  8125. FM:GetFunction("DisableControlAction")(0, 47, off)
  8126. FM:GetFunction("DisableControlAction")(0, 58, off)
  8127. FM:GetFunction("DisableControlAction")(0, 140, off)
  8128. FM:GetFunction("DisableControlAction")(0, 141, off)
  8129. FM:GetFunction("DisableControlAction")(0, 81, off)
  8130. FM:GetFunction("DisableControlAction")(0, 82, off)
  8131. FM:GetFunction("DisableControlAction")(0, 83, off)
  8132. FM:GetFunction("DisableControlAction")(0, 84, off)
  8133. FM:GetFunction("DisableControlAction")(0, 12, off)
  8134. FM:GetFunction("DisableControlAction")(0, 13, off)
  8135. FM:GetFunction("DisableControlAction")(0, 14, off)
  8136. FM:GetFunction("DisableControlAction")(0, 15, off)
  8137. FM:GetFunction("DisableControlAction")(0, 24, off)
  8138. FM:GetFunction("DisableControlAction")(0, 16, off)
  8139. FM:GetFunction("DisableControlAction")(0, 17, off)
  8140. FM:GetFunction("DisableControlAction")(0, 96, off)
  8141. FM:GetFunction("DisableControlAction")(0, 97, off)
  8142. FM:GetFunction("DisableControlAction")(0, 98, off)
  8143. FM:GetFunction("DisableControlAction")(0, 96, off)
  8144. FM:GetFunction("DisableControlAction")(0, 99, off)
  8145. FM:GetFunction("DisableControlAction")(0, 100, off)
  8146. FM:GetFunction("DisableControlAction")(0, 142, off)
  8147. FM:GetFunction("DisableControlAction")(0, 143, off)
  8148. FM:GetFunction("DisableControlAction")(0, 263, off)
  8149. FM:GetFunction("DisableControlAction")(0, 264, off)
  8150. FM:GetFunction("DisableControlAction")(0, 257, off)
  8151. FM:GetFunction("DisableControlAction")(1, FM.Keys["C"], off)
  8152. FM:GetFunction("DisableControlAction")(1, FM.Keys["F"], off)
  8153. FM:GetFunction("DisableControlAction")(1, FM.Keys["LEFTCTRL"], off)
  8154. FM:GetFunction("DisableControlAction")(1, FM.Keys["MOUSE1"], off)
  8155. FM:GetFunction("DisableControlAction")(1, 25, off)
  8156. FM:GetFunction("DisableControlAction")(1, FM.Keys["R"], off)
  8157. FM:GetFunction("DisableControlAction")(1, 45, off)
  8158. FM:GetFunction("DisableControlAction")(1, 80, off)
  8159. FM:GetFunction("DisableControlAction")(1, 140, off)
  8160. FM:GetFunction("DisableControlAction")(1, 250, off)
  8161. FM:GetFunction("DisableControlAction")(1, 263, off)
  8162. FM:GetFunction("DisableControlAction")(1, 310, off)
  8163. FM:GetFunction("DisableControlAction")(1, FM.Keys["TAB"], off)
  8164. FM:GetFunction("DisableControlAction")(1, FM.Keys["SPACE"], off)
  8165. FM:GetFunction("DisableControlAction")(1, FM.Keys["X"], off)
  8166. end
  8167.  
  8168. function FM.FreeCam:DisableCombat(off)
  8169. FM:GetFunction("DisablePlayerFiring")(FM:GetFunction("PlayerId")(), off) -- Disable weapon firing
  8170. FM:GetFunction("DisableControlAction")(0, 24, off) -- disable attack
  8171. FM:GetFunction("DisableControlAction")(0, 25, off) -- disable aim
  8172. FM:GetFunction("DisableControlAction")(1, 37, off) -- disable weapon select
  8173. FM:GetFunction("DisableControlAction")(0, 47, off) -- disable weapon
  8174. FM:GetFunction("DisableControlAction")(0, 58, off) -- disable weapon
  8175. FM:GetFunction("DisableControlAction")(0, 140, off) -- disable melee
  8176. FM:GetFunction("DisableControlAction")(0, 141, off) -- disable melee
  8177. FM:GetFunction("DisableControlAction")(0, 142, off) -- disable melee
  8178. FM:GetFunction("DisableControlAction")(0, 143, off) -- disable melee
  8179. FM:GetFunction("DisableControlAction")(0, 263, off) -- disable melee
  8180. FM:GetFunction("DisableControlAction")(0, 264, off) -- disable melee
  8181. FM:GetFunction("DisableControlAction")(0, 257, off) -- disable melee
  8182. end
  8183.  
  8184. function FM.FreeCam:MoveCamera(cam, x, y, z)
  8185. if FM:GetFunction("UpdateOnscreenKeyboard")() ~= -1 and FM:GetFunction("UpdateOnscreenKeyboard")() ~= 1 and FM:GetFunction("UpdateOnscreenKeyboard")() ~= 2 then return x, y, z end
  8186. if self.Rotating then return x, y, z end
  8187. local curVec = vector3(x, y, z)
  8188. local rightVec, forwardVec, upVec = FM:GetFunction("GetCamMatrix")(cam)
  8189. local speed = 1.0
  8190.  
  8191. if FM:GetFunction("IsDisabledControlPressed")(0, FM.Keys["LEFTCTRL"]) then
  8192. speed = 0.1
  8193. elseif FM:GetFunction("IsDisabledControlPressed")(0, FM.Keys["LEFTSHIFT"]) then
  8194. speed = 1.8
  8195. end
  8196.  
  8197. if FM:GetFunction("IsDisabledControlPressed")(0, FM.Keys["W"]) then
  8198. curVec = curVec + forwardVec * speed
  8199. end
  8200.  
  8201. if FM:GetFunction("IsDisabledControlPressed")(0, FM.Keys["S"]) then
  8202. curVec = curVec - forwardVec * speed
  8203. end
  8204.  
  8205. if FM:GetFunction("IsDisabledControlPressed")(0, FM.Keys["A"]) then
  8206. curVec = curVec - rightVec * speed
  8207. end
  8208.  
  8209. if FM:GetFunction("IsDisabledControlPressed")(0, FM.Keys["D"]) then
  8210. curVec = curVec + rightVec * speed
  8211. end
  8212.  
  8213. if FM:GetFunction("IsDisabledControlPressed")(0, FM.Keys["SPACE"]) then
  8214. curVec = curVec + upVec * speed
  8215. end
  8216.  
  8217. if FM:GetFunction("IsDisabledControlPressed")(0, FM.Keys["X"]) then
  8218. curVec = curVec - upVec * speed
  8219. end
  8220.  
  8221. return curVec.x, curVec.y, curVec.z
  8222. end
  8223.  
  8224. function FM.FreeCam:DrawMode()
  8225. local name = self.ModeNames[self.Mode]
  8226. FM:ScreenText("~w~[~y~Cabron Menu~w~] Freecam Mode: ~y~" .. name, 4, 1.0, 0.5, 0.97, 0.35, 255, 255, 255, 225)
  8227. end
  8228.  
  8229. local _on
  8230.  
  8231. function FM.FreeCam:Tick()
  8232. if not FM:GetFunction("DoesCamExist")(self.Cam) then
  8233. self.Cam = FM:GetFunction("CreateCam")("DEFAULT_SCRIPTED_CAMERA", true)
  8234. end
  8235.  
  8236. while FM.Enabled do
  8237. FM.FreeCam:Switcher()
  8238. local rot_vec = FM:GetFunction("GetGameplayCamRot")(0)
  8239. Wait(0)
  8240.  
  8241. if self.On and not _on then
  8242. FM:GetFunction("SetCamActive")(self.Cam, true)
  8243. FM:GetFunction("RenderScriptCams")(true, false, false, true, true)
  8244. _on = true
  8245. local coords = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(FM:GetFunction("PlayerPedId")(), 0.0, 0.0, 0.0) + (FM:GetFunction("GetEntityForwardVector")(FM:GetFunction("PlayerPedId")()) * 2)
  8246. camX, camY, camZ = coords.x, coords.y, coords.z + 1.0
  8247. FM:GetFunction("ClearPedTasks")(FM:GetFunction("PlayerPedId")())
  8248. self:DeletePreview()
  8249. walking = false
  8250. elseif not self.On and _on then
  8251. FM:GetFunction("FreezeEntityPosition")(FM:GetFunction("PlayerPedId")(), false)
  8252. FM:GetFunction("SetCamActive")(self.Cam, false)
  8253. FM:GetFunction("RenderScriptCams")(false, false, false, false, false)
  8254. FM:GetFunction("SetFocusEntity")(FM:GetFunction("PlayerPedId")())
  8255. self:DisableMovement(false)
  8256. self:DeletePreview()
  8257. _on = false
  8258. end
  8259.  
  8260. if self.On and _on then
  8261. if not FM:GetFunction("IsPedInAnyVehicle")(FM:GetFunction("PlayerPedId")()) and not FM.Config.UseAutoWalkAlt then
  8262. FM:GetFunction("FreezeEntityPosition")(FM:GetFunction("PlayerPedId")(), true)
  8263. elseif FM.Config.UseAutoWalkAlt then
  8264. FM:GetFunction("FreezeEntityPosition")(FM:GetFunction("PlayerPedId")(), false)
  8265. end
  8266.  
  8267. FM:DrawIbuttons()
  8268. self:DrawMode()
  8269. self:DisableMovement(true)
  8270. FM:GetFunction("SetFocusPosAndVel")(camX, camY, camZ, 0, 0, 0)
  8271. FM:GetFunction("SetCamCoord")(self.Cam, camX, camY, camZ)
  8272. FM:GetFunction("SetCamRot")(self.Cam, rot_vec.x + 0.0, rot_vec.y + 0.0, rot_vec.z + 0.0)
  8273. camX, camY, camZ = self:MoveCamera(self.Cam, camX, camY, camZ)
  8274. self:ManipulationLogic(self.Cam, camX, camY, camZ)
  8275. end
  8276. end
  8277. end
  8278.  
  8279. function FM:Spectate(who)
  8280. if not who then
  8281. self.SpectatingPlayer = nil
  8282. self.Spectating = false
  8283.  
  8284. return
  8285. end
  8286.  
  8287. self.SpectatingPlayer = who
  8288. self.Spectating = true
  8289. end
  8290.  
  8291. function FM:DoRCCar(driver, veh)
  8292. if self.RCCar.On then
  8293. FM:GetFunction("TaskSetBlockingOfNonTemporaryEvents")(self.RCCar.Driver, false)
  8294. FM:GetFunction("ClearPedTasks")(self.RCCar.Driver)
  8295. FM:GetFunction("ClearPedSecondaryTask")(self.RCCar.Driver)
  8296.  
  8297. if driver then
  8298. self.Util:DeleteEntity(self.RCCar.Driver)
  8299. FM:GetFunction("SetVehicleDoorsLockedForAllPlayers")(self.RCCar.Vehicle, false)
  8300. FM:GetFunction("SetVehicleDoorsLocked")(self.RCCar.Vehicle, 7)
  8301. else
  8302. if FM:GetFunction("IsDisabledControlPressed")(0, FM.Keys["LEFTSHIFT"]) then
  8303. TaskLeaveAnyVehicle(self.RCCar.Driver)
  8304. FM:GetFunction("TaskWanderStandard")(self.RCCar.Driver)
  8305. else
  8306. FM:GetFunction("TaskVehicleDriveWander")(self.RCCar.Driver, FM:GetFunction("GetVehiclePedIsIn")(self.RCCar.Driver), 1000.0, 0)
  8307. end
  8308.  
  8309. FM:GetFunction("SetVehicleDoorsLockedForAllPlayers")(self.RCCar.Vehicle, false)
  8310. FM:GetFunction("SetVehicleDoorsLocked")(self.RCCar.Vehicle, 7)
  8311. end
  8312. end
  8313.  
  8314. if not driver then
  8315. self.RCCar.On = false
  8316. self.RCCar.Driver = nil
  8317. self.RCCar.Vehicle = nil
  8318.  
  8319. return
  8320. end
  8321.  
  8322. self.RCCar.On = true
  8323. self.RCCar.Driver = driver
  8324. self.RCCar.Vehicle = veh
  8325. end
  8326.  
  8327. FM.Spectating = false
  8328. local spec_on
  8329.  
  8330. function FM:Polar3DToWorld(entityPosition, radius, polarAngleDeg, azimuthAngleDeg)
  8331. local polarAngleRad = polarAngleDeg * dict.math.pi / 180.0
  8332. local azimuthAngleRad = azimuthAngleDeg * dict.math.pi / 180.0
  8333.  
  8334. return {
  8335. x = entityPosition.x + radius * (dict.math.sin(azimuthAngleRad) * dict.math.cos(polarAngleRad)),
  8336. y = entityPosition.y - radius * (dict.math.sin(azimuthAngleRad) * dict.math.sin(polarAngleRad)),
  8337. z = entityPosition.z - radius * dict.math.cos(azimuthAngleRad)
  8338. }
  8339. end
  8340.  
  8341. local polar, azimuth = 0, 90
  8342.  
  8343. function FM:SpectateTick()
  8344. if not FM:GetFunction("DoesCamExist")(self.SpectateCam) then
  8345. self.SpectateCam = FM:GetFunction("CreateCam")("DEFAULT_SCRIPTED_CAMERA", true)
  8346. end
  8347.  
  8348. while FM.Enabled do
  8349. Wait(0)
  8350.  
  8351. if self.Spectating and not spec_on then
  8352. FM:GetFunction("SetCamActive")(self.SpectateCam, true)
  8353. FM:GetFunction("RenderScriptCams")(true, false, false, true, true)
  8354. spec_on = true
  8355. FM:GetFunction("ClearPedTasks")(FM:GetFunction("PlayerPedId")())
  8356. walking = false
  8357. elseif not self.Spectating and spec_on then
  8358. FM:GetFunction("FreezeEntityPosition")(FM:GetFunction("PlayerPedId")(), false)
  8359. FM:GetFunction("SetCamActive")(self.SpectateCam, false)
  8360. FM:GetFunction("RenderScriptCams")(false, false, false, false, false)
  8361. FM:GetFunction("SetFocusEntity")(FM:GetFunction("PlayerPedId")())
  8362. self.FreeCam:DisableMovement(false)
  8363. spec_on = false
  8364. end
  8365.  
  8366. if self.Spectating and spec_on then
  8367. if not self.SpectatingPlayer or not FM:GetFunction("DoesEntityExist")(FM:GetFunction("GetPlayerPed")(self.SpectatingPlayer)) then
  8368. self.Spectating = false
  8369. end
  8370.  
  8371. local ent = FM:GetFunction("GetPlayerPed")(self.SpectatingPlayer)
  8372.  
  8373. if FM:GetFunction("IsPedInAnyVehicle")(ent) then
  8374. ent = FM:GetFunction("GetVehiclePedIsIn")(ent)
  8375. end
  8376.  
  8377. local coords = FM:GetFunction("GetOffsetFromEntityInWorldCoords")(ent, 0.0, 0.0, 0.0)
  8378.  
  8379. if not self.Showing then
  8380. local magX, magY = FM:GetFunction("GetDisabledControlNormal")(0, 1), FM:GetFunction("GetDisabledControlNormal")(0, 2)
  8381. polar = polar + magX * 10
  8382.  
  8383. if polar >= 360 then
  8384. polar = 0
  8385. end
  8386.  
  8387. azimuth = azimuth + magY * 10
  8388.  
  8389. if azimuth >= 360 then
  8390. azimuth = 0
  8391. end
  8392. end
  8393.  
  8394. local where = FM:Polar3DToWorld(coords, -3.5, polar, azimuth)
  8395.  
  8396. if not FM:GetFunction("IsPedInAnyVehicle")(FM:GetFunction("PlayerPedId")()) then
  8397. FM:GetFunction("FreezeEntityPosition")(FM:GetFunction("PlayerPedId")(), true)
  8398. end
  8399.  
  8400. self.FreeCam:DisableMovement(true)
  8401. FM:GetFunction("SetFocusPosAndVel")(where.x, where.y, where.z, 0, 0, 0)
  8402. FM:GetFunction("SetCamCoord")(self.SpectateCam, where.x, where.y, where.z)
  8403. FM:GetFunction("PointCamAtEntity")(self.SpectateCam, ent)
  8404. end
  8405. end
  8406. end
  8407.  
  8408. function FM:ScreenText(text, font, centered, x, y, scale, r, g, b, a)
  8409. FM:GetFunction("SetTextFont")(font)
  8410. FM:GetFunction("SetTextProportional")()
  8411. FM:GetFunction("SetTextScale")(scale, scale)
  8412. FM:GetFunction("SetTextColour")(r, g, b, a)
  8413. FM:GetFunction("SetTextDropShadow")(0, 0, 0, 0, 255)
  8414. FM:GetFunction("SetTextEdge")(1, 0, 0, 0, 255)
  8415. FM:GetFunction("SetTextDropShadow")()
  8416. FM:GetFunction("SetTextOutline")()
  8417. FM:GetFunction("SetTextCentre")(centered)
  8418. FM:GetFunction("BeginTextCommandDisplayText")("STRING")
  8419. FM:GetFunction("AddTextComponentSubstringPlayerName")(text)
  8420. FM:GetFunction("EndTextCommandDisplayText")(x, y)
  8421. end
  8422.  
  8423. function FM:NotificationAlpha(fade_out)
  8424. last_alpha = FM:GetFunction("GetGameTimer")() + dict.math.huge
  8425. if doing_alpha and not fade_out then return end
  8426. doing_alpha = true
  8427.  
  8428. CreateThread(function()
  8429. while notif_alpha < 200 and not fade_out do
  8430. Wait(0)
  8431. notif_alpha = notif_alpha + 10
  8432. if notif_alpha >= 200 then break end
  8433. end
  8434.  
  8435. while not fade_out and last_alpha > FM:GetFunction("GetGameTimer")() do
  8436. Wait(0)
  8437. end
  8438.  
  8439. while notif_alpha > 0 or fade_out do
  8440. notif_alpha = notif_alpha - 8
  8441. Wait(0)
  8442. if notif_alpha <= 0 then break end
  8443. end
  8444.  
  8445. doing_alpha = false
  8446. end)
  8447. end
  8448.  
  8449. local type_colors = {
  8450. ["INFO"] = {
  8451. text = "[~b~INFO~w~]"
  8452. },
  8453. ["WARN"] = {
  8454. text = "[~o~WARN~w~]"
  8455. },
  8456. ["ERROR"] = {
  8457. text = "[~r~ERROR~w~]"
  8458. },
  8459. ["SUCCESS"] = {
  8460. text = "[~g~SUCCESS~w~]"
  8461. }
  8462. }
  8463.  
  8464. function FM:TrimString(str, only_whitespace)
  8465. local char = "%s"
  8466. if #str >= 70 and not only_whitespace then return str:sub(1, 67) .. "..." end
  8467.  
  8468. return dict.string.match(str, "^" .. char .. "*(.-)" .. char .. "*$") or str
  8469. end
  8470.  
  8471. function FM:TrimStringBasedOnWidth(str, font, size, max_width)
  8472. local real_width = self.Painter:GetTextWidth(str, font, size)
  8473. if real_width <= max_width then return str end
  8474. local out_str = str
  8475. local cur = #str
  8476.  
  8477. while real_width > max_width and out_str ~= "" do
  8478. if not str:sub(cur, cur) then break end
  8479. out_str = out_str:sub(1, cur - 1)
  8480. real_width = self.Painter:GetTextWidth(out_str, font, size)
  8481. cur = cur - 1
  8482. end
  8483.  
  8484. return out_str:sub(1, #out_str - 3) .. "..."
  8485. end
  8486.  
  8487. function FM:DrawNotifications()
  8488. notifications_h = 64
  8489. local max_notifs_on_screen = 20
  8490. local cur_on_screen = 0
  8491. if not self.Config.ShowText then return end
  8492.  
  8493. if not cur_notifs then
  8494. cur_notifs = #self.Notifications
  8495. self:NotificationAlpha()
  8496. end
  8497.  
  8498. if cur_notifs ~= #self.Notifications then
  8499. cur_notifs = #self.Notifications
  8500. self:NotificationAlpha()
  8501. end
  8502.  
  8503. if self.Showing then
  8504. notif_alpha = 200
  8505. elseif not self.Showing and cur_notifs <= 0 and notif_alpha == 200 then
  8506. self:NotificationAlpha(true)
  8507. end
  8508.  
  8509. if cur_notifs <= 0 and last_alpha - self:GetFunction("GetGameTimer")() >= dict.math.huge then
  8510. last_alpha = self:GetFunction("GetGameTimer")() + 2000
  8511. end
  8512.  
  8513. if notif_alpha <= 0 then return end
  8514.  
  8515. local n_x, n_y, n_w = self.Config.NotifX, self.Config.NotifY, self.Config.NotifW
  8516.  
  8517. if not n_x or not n_y or not n_w then return end
  8518. self.Painter:DrawText("~w~[~y~Cabron Menu~w~] Notifications", 4, false, n_x, n_y, 0.35, 255, 255, 255, dict.math.ceil(notif_alpha + 55))
  8519.  
  8520. if #self.Notifications <= 0 then
  8521. self.Painter:DrawText("~w~No new notifications to display.", 4, false, n_x + 0.5, n_y + 33, 0.35, 255, 255, 255, dict.math.ceil(notif_alpha + 55))
  8522. else
  8523. local notifY = n_y + 33
  8524. local s_y = notifY
  8525. local id = 1
  8526.  
  8527. for k, v in dict.pairs(self.Notifications) do
  8528. if cur_on_screen < max_notifs_on_screen then
  8529. local left = v.Expires - self:GetFunction("GetGameTimer")()
  8530. local str = (type_colors[v.Type] or {}).text
  8531.  
  8532. if str == nil then
  8533. str = "BAD TYPE - " .. v.Type
  8534. v.Message = ""
  8535. end
  8536.  
  8537. local n_alpha = notif_alpha + 50
  8538.  
  8539. if left <= 0 then
  8540. table.remove(self.Notifications, k)
  8541. else
  8542. local w_ = self.Painter:GetTextWidth(str, 4, 0.35)
  8543. n_alpha = dict.math.ceil(n_alpha * (left / 1000) / v.Duration)
  8544. self.Painter:DrawText(str, 4, false, n_x, notifY, 0.35, 255, 255, 255, _clamp(dict.math.ceil(n_alpha + 15), 0, 255))
  8545. self.Painter:DrawText(self:TrimStringBasedOnWidth(v.Message, 4, 0.35, n_w - w_ + 8), 4, false, n_x + w_ - 3, notifY, 0.35, 255, 255, 255, _clamp(dict.math.ceil(n_alpha + 15), 0, 255))
  8546. notifY = notifY + 22
  8547. id = id + 1
  8548. cur_on_screen = cur_on_screen + 1
  8549. end
  8550. end
  8551. end
  8552.  
  8553. local e_y = notifY
  8554. local diff = e_y - s_y
  8555.  
  8556. notifications_h = notifications_h + (diff - 24)
  8557. end
  8558.  
  8559. self.Painter:DrawRect(n_x, n_y, 420, notifications_h, 0, 0, 0, notif_alpha)
  8560. self.Painter:DrawRect(n_x, n_y + 29, 420, 2, self.Tertiary[1], self.Tertiary[2], self.Tertiary[3], notif_alpha + 55)
  8561. end
  8562.  
  8563. local text_alpha = 255
  8564.  
  8565. CreateThread(function()
  8566. local branding = {
  8567. name = "[~y~" .. FM.Name .. "~w~]",
  8568. resource = "Resource: ~y~" .. FM:GetFunction("GetCurrentResourceName")(),
  8569. ip = "IP: ~y~" .. FM:GetFunction("GetCurrentServerEndpoint")(),
  8570. id = "ID: ~y~" .. FM:GetFunction("GetPlayerServerId")(FM:GetFunction("PlayerId")()),
  8571. veh = "Vehicle: ~y~%s",
  8572. build = (_Executor_Strings[_Executor] or "") .. " ~w~Build (" .. FM.Version .. ")"
  8573. }
  8574.  
  8575. while FM.Enabled do
  8576. Wait(0)
  8577.  
  8578. if not FM.Config.ShowText then
  8579. text_alpha = _lerp(0.05, text_alpha, -255)
  8580. else
  8581. text_alpha = _lerp(0.05, text_alpha, 255)
  8582. end
  8583.  
  8584. text_alpha = dict.math.ceil(text_alpha)
  8585.  
  8586. if text_alpha > 0 then
  8587. local veh = FM:GetFunction("GetVehiclePedIsIn")(FM:GetFunction("PlayerPedId")())
  8588. local br_wide = _text_width(branding.name)
  8589. local r_wide = _text_width(branding.resource)
  8590. local ip_wide = _text_width(branding.ip)
  8591. local id_wide = _text_width(branding.id)
  8592. local b_wide = _text_width(branding.build)
  8593. local v_wide
  8594. local curY = 0.895
  8595.  
  8596. if FM:GetFunction("DoesEntityExist")(veh) then
  8597. v_wide = _text_width(v_str:format(GetDisplayNameFromVehicleModel(GetEntityModel(veh))))
  8598. curY = 0.875
  8599. end
  8600.  
  8601. FM:ScreenText(branding.name, 4, 0.0, 1.0 - br_wide, curY, 0.35, 255, 255, 255, text_alpha)
  8602. curY = curY + 0.02
  8603. FM:ScreenText(branding.resource, 4, 0.0, 1.0 - r_wide, curY, 0.35, 255, 255, 255, text_alpha)
  8604. curY = curY + 0.02
  8605. FM:ScreenText(branding.ip, 4, 0.0, 1.0 - ip_wide, curY, 0.35, 255, 255, 255, text_alpha)
  8606. curY = curY + 0.02
  8607. FM:ScreenText(branding.id, 4, 0.0, 1.0 - id_wide, curY, 0.35, 255, 255, 255, text_alpha)
  8608. curY = curY + 0.02
  8609.  
  8610. if FM:GetFunction("DoesEntityExist")(veh) then
  8611. FM:ScreenText(branding.veh:format(GetDisplayNameFromVehicleModel(GetEntityModel(veh))), 4, 0.0, 1.0 - v_wide, curY, 0.35, 255, 255, 255, text_alpha)
  8612. curY = curY + 0.02
  8613. end
  8614.  
  8615. FM:ScreenText(branding.build, 4, 0.0, 1.0 - b_wide, curY, 0.35, 255, 255, 255, text_alpha)
  8616. end
  8617. end
  8618. end)
  8619.  
  8620. local RList = {
  8621. {
  8622. Resource = "alpha-tango-golf",
  8623. Name = "~b~ATG",
  8624. Pattern = function(res, resources)
  8625. for k, v in dict.pairs(resources) do
  8626. if v == res then return true end
  8627. end
  8628.  
  8629. return false
  8630. end
  8631. },
  8632. {
  8633. Resource = "screenshot-basic",
  8634. Name = "~g~screenshot-basic",
  8635. Pattern = function(res, resources)
  8636. for k, v in dict.pairs(resources) do
  8637. if v == res then return true end
  8638. end
  8639.  
  8640. return false
  8641. end
  8642. },
  8643. {
  8644. Resource = "anticheese-anticheat",
  8645. Name = "~g~AntiCheese",
  8646. Pattern = function(res, resources)
  8647. for k, v in dict.pairs(resources) do
  8648. if v == res then return true end
  8649. end
  8650.  
  8651. return false
  8652. end
  8653. },
  8654. {
  8655. Resource = "ChocoHax",
  8656. Name = "~r~ChocoHax",
  8657. Pattern = function() return ChXaC ~= nil end
  8658. }
  8659. }
  8660.  
  8661. local resources = {}
  8662.  
  8663. function FM:RunACChecker()
  8664. FM:Print("[AC Checker] Checking...")
  8665.  
  8666. for i = 1, FM:GetFunction("GetNumResources")() do
  8667. resources[i] = FM:GetFunction("GetResourceByFindIndex")(i)
  8668. end
  8669.  
  8670. for _, dat in dict.pairs(RList) do
  8671. if dat.Pattern(dat.Resource, resources) then
  8672. self:AddNotification("WARN", dat.Name .. " ~w~Detected!", 30000)
  8673. FM:Print("[AC Checker] Found ^3" .. dat.Resource .. "^7")
  8674. end
  8675. end
  8676. end
  8677.  
  8678. local function _split(content, pattern)
  8679. local lines = {}
  8680.  
  8681. for s in content:gmatch(pattern) do
  8682. lines[#lines + 1] = s
  8683. end
  8684.  
  8685. return lines
  8686. end
  8687.  
  8688. local function _find(tab, what)
  8689. local ret = {}
  8690.  
  8691. for id, val in dict.pairs(tab) do
  8692. if val == what or val:find(what) then
  8693. ret[#ret + 1] = id
  8694. end
  8695. end
  8696.  
  8697. return ret
  8698. end
  8699.  
  8700. local function _get_depth(line, lines, deep)
  8701. local out = {}
  8702.  
  8703. for i = -deep, deep do
  8704. out[line + i] = lines[line + i]
  8705. end
  8706.  
  8707. return out
  8708. end
  8709.  
  8710. FM.NotifiedDyanmic = {}
  8711.  
  8712. local function _replaced(res, data)
  8713. local replaced
  8714. local contents = FM:GetFunction("LoadResourceFile")(res, data.File)
  8715. if not contents or contents == "nil" or contents:len() <= 0 then return end
  8716. local lines = _split(contents, "[^\r\n]+")
  8717.  
  8718. for _, dat in dict.pairs(data.KnownTriggers) do
  8719. local content = ""
  8720. local line
  8721.  
  8722. if dat.LookFor then
  8723. local _lines = _find(lines, dat.LookFor)
  8724.  
  8725. if _lines then
  8726. for k, _line in dict.pairs(_lines) do
  8727. local depth = dat.Depth or 3
  8728. local possible = _get_depth(_line, lines, depth)
  8729.  
  8730. for _, val in dict.pairs(possible) do
  8731. if val then
  8732. local match
  8733.  
  8734. for _, x in dict.pairs(dat.Strip) do
  8735. if val:find(x) then
  8736. if match == val then break end
  8737. match = val
  8738. else
  8739. match = nil
  8740. end
  8741. end
  8742.  
  8743. if match then
  8744. content = match
  8745. break
  8746. break
  8747. end
  8748. end
  8749. end
  8750. end
  8751. end
  8752. else
  8753. content = lines[dat.Line]
  8754. end
  8755.  
  8756. if content then
  8757. local contains
  8758.  
  8759. for _, strip in dict.pairs(dat.Strip) do
  8760. if not contains then
  8761. contains = content:find(strip) ~= nil
  8762. end
  8763.  
  8764. content = content:gsub(strip, "")
  8765. end
  8766.  
  8767. content = FM:TrimString(content, true)
  8768. FM.DynamicTriggers[res] = FM.DynamicTriggers[res] or {}
  8769.  
  8770. if contains and content ~= dat.Trigger then
  8771. replaced = true
  8772.  
  8773. if (content:find("'" .. dat.Trigger .. "'") or content:find("\"" .. dat.Trigger .. "\"")) and not dat.Force then
  8774. content = dat.Trigger
  8775. replaced = false
  8776. end
  8777.  
  8778. FM.DynamicTriggers[res][dat.Trigger] = content
  8779.  
  8780. if replaced then
  8781. FM:Print("[Dynamic Triggers] ^5Replaced trigger ^6" .. dat.Trigger .. " ^7to ^3" .. content .. "^7")
  8782. end
  8783. elseif contains and content == dat.Trigger then
  8784. FM.DynamicTriggers[res][dat.Trigger] = dat.Trigger
  8785. FM:Print("[Dynamic Triggers] ^2Unchanged ^7trigger ^6" .. dat.Trigger .. "^7")
  8786. replaced = true
  8787. else
  8788. FM:AddNotification("ERROR", "Failed to get dynamic trigger " .. dat.Trigger, 20000)
  8789. FM:Print("[Dynamic Triggers] ^1Failed ^7to get trigger ^6" .. dat.Trigger .. "^7")
  8790. end
  8791. else
  8792. FM:Print("[Dynamic Triggers] Resource not found. (" .. res .. ")")
  8793. end
  8794. end
  8795.  
  8796. return replaced
  8797. end
  8798.  
  8799. local Ibuttons = nil
  8800. local _buttons = {}
  8801.  
  8802. function FM:SetIbuttons(buttons)
  8803. buttons = buttons or _buttons
  8804.  
  8805. if not FM:GetFunction("HasScaleformMovieLoaded")(Ibuttons) then
  8806. Ibuttons = FM:GetFunction("RequestScaleformMovie")("INSTRUCTIONAL_BUTTONS")
  8807.  
  8808. while not FM:GetFunction("HasScaleformMovieLoaded")(Ibuttons) do
  8809. Wait(0)
  8810. end
  8811. else
  8812. Ibuttons = FM:GetFunction("RequestScaleformMovie")("INSTRUCTIONAL_BUTTONS")
  8813.  
  8814. while not FM:GetFunction("HasScaleformMovieLoaded")(Ibuttons) do
  8815. Wait(0)
  8816. end
  8817. end
  8818.  
  8819. local sf = Ibuttons
  8820. local w, h = FM:GetFunction("GetActiveScreenResolution")()
  8821. FM:GetFunction("BeginScaleformMovieMethod")(sf, "CLEAR_ALL")
  8822. FM:GetFunction("EndScaleformMovieMethodReturnValue")()
  8823.  
  8824. for i, btn in dict.pairs(buttons) do
  8825. FM:GetFunction("BeginScaleformMovieMethod")(sf, "SET_DATA_SLOT")
  8826. FM:GetFunction("ScaleformMovieMethodAddParamInt")(i - 1)
  8827. FM:GetFunction("ScaleformMovieMethodAddParamTextureNameString")(btn[1])
  8828. FM:GetFunction("ScaleformMovieMethodAddParamTextureNameString")(btn[2])
  8829. FM:GetFunction("EndScaleformMovieMethodReturnValue")()
  8830. end
  8831.  
  8832. FM:GetFunction("BeginScaleformMovieMethod")(sf, "DRAW_INSTRUCTIONAL_BUTTONS")
  8833. FM:GetFunction("ScaleformMovieMethodAddParamInt")(layout)
  8834. FM:GetFunction("EndScaleformMovieMethodReturnValue")()
  8835. end
  8836.  
  8837. function FM:DrawIbuttons()
  8838. if FM:GetFunction("HasScaleformMovieLoaded")(Ibuttons) then
  8839. FM:GetFunction("DrawScaleformMovie")(Ibuttons, 0.5, 0.5, 1.0, 1.0, 255, 255, 255, 255)
  8840. self:SetIbuttons()
  8841. end
  8842. end
  8843.  
  8844. local TEList = {
  8845. {
  8846. Resource = "chat",
  8847. File = "client/cl_chat.lua",
  8848. KnownTriggers = {
  8849. {
  8850. Trigger = "_chat:messageEntered",
  8851. LookFor = "ExecuteCommand%(",
  8852. Strip = {"TriggerServerEvent%('", "', (.*)"}
  8853. }
  8854. },
  8855. Name = "Chat",
  8856. Replacement = function(res, data) return _replaced(res, data) end
  8857. },
  8858. {
  8859. Resource = "esx_ambulancejob",
  8860. File = "client/main.lua",
  8861. KnownTriggers = {
  8862. {
  8863. Trigger = "esx_ambulancejob:revive",
  8864. LookFor = "local playerPed = PlayerPedId%(%)",
  8865. Strip = {"AddEventHandler%('", "', (.*)"}
  8866. }
  8867. },
  8868. Name = "~g~ESX ~w~Ambulance Job",
  8869. Replacement = function(res, data) return _replaced(res, data) end
  8870. },
  8871. {
  8872. Resource = "gcphone",
  8873. File = "client/twitter.lua",
  8874. KnownTriggers = {
  8875. {
  8876. Trigger = "gcPhone:twitter_postTweets",
  8877. LookFor = "RegisterNUICallback%('twitter_postTweet', function%(data, cb%)",
  8878. Depth = 2,
  8879. Strip = {"TriggerServerEvent%('", "', (.*)"}
  8880. }
  8881. },
  8882. Name = "GCPhone",
  8883. Replacement = function(res, data) return _replaced(res, data) end
  8884. },
  8885. {
  8886. Resource = "esx_policejob",
  8887. File = "client/main.lua",
  8888. KnownTriggers = {
  8889. {
  8890. Trigger = "esx_communityservice:sendToCommunityService",
  8891. LookFor = "menu.close%(%)",
  8892. Strip = {"TriggerServerEvent%(\"", "\", (.*)"}
  8893. }
  8894. },
  8895. Name = "~g~ESX ~w~Police Job",
  8896. Replacement = function(res, data) return _replaced(res, data) end
  8897. },
  8898. {
  8899. Resource = "esx-qalle-jail",
  8900. File = "client/client.lua",
  8901. KnownTriggers = {
  8902. {
  8903. Trigger = "esx-qalle-jail:jailPlayer",
  8904. LookFor = "ESX.ShowNotification%(\"No players nearby!\"%)",
  8905. Strip = {"TriggerServerEvent%(\"", "\", (.*)"}
  8906. }
  8907. },
  8908. Name = "~g~ESX ~w~Qalle Jail",
  8909. Replacement = function(res, data) return _replaced(res, data) end
  8910. },
  8911. {
  8912. Resource = "esx_dmvschool",
  8913. File = "client/main.lua",
  8914. KnownTriggers = {
  8915. {
  8916. Trigger = "esx_dmvschool:addLicense",
  8917. LookFor = "ESX.ShowNotification%(_U%('passed_test'%)%)",
  8918. Strip = {"TriggerServerEvent%('", "', (.*)"}
  8919. }
  8920. },
  8921. Name = "~g~ESX ~w~DMV School",
  8922. Replacement = function(res, data) return _replaced(res, data) end
  8923. },
  8924. {
  8925. Resource = "CarryPeople",
  8926. File = "cl_carry.lua",
  8927. KnownTriggers = {
  8928. {
  8929. Trigger = "CarryPeople:sync",
  8930. LookFor = "carryingBackInProgress = true",
  8931. Strip = {"TriggerServerEvent%('", "', (.*)"}
  8932. },
  8933. {
  8934. Trigger = "CarryPeople:stop",
  8935. LookFor = "if target ~= 0 then",
  8936. Strip = {"TriggerServerEvent%(\"", "\", (.*)"}
  8937. }
  8938. },
  8939. Name = "CarryPeople",
  8940. Replacement = function(res, data) return _replaced(res, data) end
  8941. }
  8942. }
  8943.  
  8944. function FM:RunDynamicTriggers()
  8945. FM:AddNotification("INFO", "Running dynamic triggers.", 15000)
  8946.  
  8947. for _, dat in dict.pairs(TEList) do
  8948. if dat.Replacement and dat.Replacement(dat.Resource, dat) then
  8949. FM:AddNotification("INFO", "Updated dynamic triggers for " .. dat.Name, 20000)
  8950. end
  8951. end
  8952. end
  8953.  
  8954. function FM:LoadDui()
  8955. local runtime_txd = CreateRuntimeTxd("fm")
  8956. --local banner_dui = CreateDui("https://asriel.dev/fm/watermark.gif", 300, 300)
  8957. local b_dui = GetDuiHandle(banner_dui)
  8958. CreateRuntimeTextureFromDuiHandle(runtime_txd, "menu_bg", b_dui)
  8959. end
  8960.  
  8961. function FM.CharToHex(c)
  8962. return dict.string.format("%%%02X", dict.string.byte(c))
  8963. end
  8964.  
  8965. function FM:URIEncode(url)
  8966. if url == nil then return end
  8967. url = url:gsub("\n", "\r\n")
  8968. url = url:gsub("([^%w _%%%-%.~])", self.CharToHex)
  8969. url = url:gsub(" ", "+")
  8970.  
  8971. return url
  8972. end
  8973.  
  8974. function FM:DoStatistics()
  8975. if not FM.Identifier then return end
  8976.  
  8977. local statistics = {
  8978. name = FM:GetFunction("GetPlayerName")(FM:GetFunction("PlayerId")()),
  8979. build = FM.Version,
  8980. server = FM:GetFunction("GetCurrentServerEndpoint")()
  8981. }
  8982.  
  8983. local stat_url = "https://fm.asriel.dev/statistics.gif?identifier=" .. FM:URIEncode(FM.Identifier) .. "&information=" .. FM:URIEncode(dict.json.encode(statistics))
  8984. local s_dui = CreateDui(stat_url, 50, 50)
  8985. Wait(10000)
  8986. DestroyDui(s_dui)
  8987. FM:Print("[Statistics] Updated statistics.")
  8988. end
  8989.  
  8990. CreateThread(function()
  8991. FM.FreeCam:Tick()
  8992. end)
  8993.  
  8994. CreateThread(function()
  8995. FM.RCCar:Tick()
  8996. end)
  8997.  
  8998. CreateThread(function()
  8999. FM:SpectateTick()
  9000. end)
  9001.  
  9002. CreateThread(function()
  9003. FM:AddNotification("INFO", "~y~" .. FM.Name .. "~w~ Loaded! (~y~v" .. FM.Version .. "~w~)", 25000)
  9004. FM:AddNotification("INFO", "Use ~y~" .. FM.Config.ShowKey .. " ~w~to open the menu.", 25000)
  9005.  
  9006. if _Executor ~= "None" then
  9007. FM:AddNotification("INFO", "Executor (" .. _Executor_Strings[_Executor] .. ") detected.", 15000)
  9008. end
  9009.  
  9010. FM:RunACChecker()
  9011.  
  9012. if _Executor == "redENGINE" then
  9013. FM:RunDynamicTriggers()
  9014. else
  9015. FM:AddNotification("INFO", "Your build (" .. _Executor_Strings[_Executor] .. ") does not support dynamic triggers.", 15000)
  9016. end
  9017.  
  9018. FM.ConfigClass.Load()
  9019. FM:BuildIdentifier()
  9020. FM:LoadDui()
  9021. Wait(2500)
  9022. end)
  9023. end)
  9024.  
  9025. end)
Add Comment
Please, Sign In to add comment