SlonPvpru

[Rodina] AdminTools v1.0

Apr 27th, 2020
1,351
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 63.43 KB | None | 0 0
  1. script_version"1.0"
  2. script_author"Glade"
  3.  
  4. -- Подрубаем библиотеки
  5. require "lib.moonloader"
  6. local GK = require 'game.keys'
  7. local sampev = require 'lib.samp.events'
  8. local keys = require "vkeys"
  9. local cjson = require"cjson"
  10. local imgui = require 'imgui'
  11. inicfg = require 'inicfg'
  12. effil = require"effil"
  13. ffi = require 'ffi'
  14. local encoding = require"encoding"
  15. dlstatus = require('moonloader').download_status
  16. encoding.default = "cp1251"
  17. local vkeys = require 'vkeys'
  18. local wm = require 'lib.windows.message'
  19. local rkeys = require 'rkeys'
  20. imgui.HotKey = require('imgui_addons').HotKey
  21. imgui.ToggleButton = require("imgui_addons").ToggleButton
  22. u8 = require("encoding").UTF8
  23. ----------------------------------------------------------
  24.  
  25. local main_window_state = imgui.ImBool(false)
  26. local tab = {
  27.     false,
  28.         false,
  29. }
  30. update_ok = false
  31. startwork_ok = false
  32. my_lvl_adm = 0
  33.  
  34. admchecker_adminList = {{"checking..", 1}}
  35. admchecker_timerForCheck = 3000
  36. scores = {}
  37. check_lvl_admbool = false
  38. admchecker_adminList_forCMD = {}
  39. nameINI = "RodinaTools.ini"
  40. admchecker_recon_text = ""
  41. admchecker_nick_text = ""
  42. admchecker_helpmark = false
  43. hide_imguiCursor = true
  44. admchecker_CheckList = false
  45. admchecker_auth = false
  46. admchecker_SortingList = false
  47. admchecker_SortingTime = 0
  48. serverIPandPort_auth = false
  49. authorization = false
  50. check_my_lvlAdm = false
  51.  
  52. recon_ID = 0
  53. recon_checkstats = false
  54. recon_status = false
  55. recon_getipCheck = false
  56. recon_getipCheck = false
  57. recon_cmdWeap = false
  58. LIP = {}
  59. CarName = {
  60.     "Mercedes Gl63", -- 400
  61.     "Volkswagen Bus", -- 401
  62.     "Mercedes E63", -- 402
  63.     "SCANIA", -- 403
  64.     "Renault Megane", -- 404
  65.     "Audi A6", -- 405
  66.     "ZIL", -- 406
  67.     "FireTruck",
  68.     "TrashMaster", -- 408
  69.     "Porsche Panamera",
  70.     "Audi S8",
  71.     "Daewoo Lanos",
  72.     "Volvo 850",
  73.     "Amry Bus",
  74.     "Long Bus",
  75.     "BMW M6", -- 415
  76.     "Ambulance", -- 416
  77.     "Leviathan", -- 417
  78.     "Volkswagen Bus", -- 418
  79.     "Citroen C4",
  80.     "Renault Megane (Taxi)",
  81.     "Mercedes 560 Sel",
  82.     "Loaf",
  83.     "Ice Cream Van",
  84.     "Oka",
  85.     "Military helicopter",
  86.     "Lexus gs350",
  87.     "Gazel (Police)",
  88.     "Gazel (Incasator)",
  89.     "Mercedes A45",
  90.     "Boat (Police)",
  91.     "Bus",
  92.     "Tank",
  93.     "Katyusha",
  94.     "Hotknife", -- 434
  95.     "Trailer (X)",
  96.     "Mercedes CLS",
  97.     "Bus",
  98.     "Audi Rs5",
  99.     "Lada 112",
  100.     "Gazel",
  101.     "RCBandit", -- 441
  102.     "Zhiguli 1300",
  103.     "Packer", -- 443
  104.     "Monster",
  105.     "Volkswagen Passat",
  106.     "Squalo", -- 446
  107.     "Seasparrow", -- 447
  108.     "Pizzaboy", -- 448
  109.     "Tram (X)", -- 449
  110.     "Trailer (X)", -- 450
  111.     "Lamborgini Huracan",
  112.     "Speeder",
  113.     "Reefer", -- 453
  114.     "Tropic",  -- 454
  115.     "Flatbed", -- 455
  116.     "Hlebovozka", -- 456
  117.     "Caddy", -- 457
  118.     "Volga",
  119.     "Ford Transit",
  120.     "CCCP-03735",
  121.     "Kawasaki (low)",
  122.     "Faggio", -- 462
  123.     "Freeway", -- 463
  124.     "RCBaron",
  125.     "RCRaider",
  126.     "BMW M5",
  127.     "Lada 2107",
  128.     "Sanchez", -- 468
  129.     "Robinson",
  130.     "Hummer H1",
  131.     "Quad", -- 471
  132.     "Coastguard",
  133.     "Dinghy",
  134.     "Lada Samara",
  135.     "BMW X5M",
  136.     "Rustler (X)", -- 477
  137.     "BMW M4",
  138.     "Walton",
  139.     "Lada Westa",
  140.     "Porsche Cayman",
  141.     "BMX",
  142.     "Mercedes Vito",
  143.     "Paz",
  144.     "Yacht",
  145.     "Volga (AirFloat)",
  146.     "Dozer", -- 486
  147.     "Maverick",
  148.     "NewsChopper",
  149.     "Lexus LX570",
  150.     "Range Rover",
  151.     "Mercedes E320",
  152.     "Lada Samara 1500",
  153.     "Jetmax",
  154.     "BMW I8",
  155.     "Ford Raptor",
  156.     "Skoda Rapid",
  157.     "Maverick (Police)",
  158.     "Boxvillde",
  159.     "Gazon",
  160.     "UAZ Patriot",
  161.     "RCGoblin",
  162.     "Tesla Model S",
  163.     "Ford Mustang GT",
  164.     "Dodge SRT",
  165.     "Toyota Land Cruiser",
  166.     "Audi R8",
  167.     "Chevrolet Cruze",
  168.     "Zaz (Buhanka)", -- 508
  169.     "Bike", -- 509
  170.     "MountainBike", -- 510
  171.     "Beagle", -- 511
  172.     "Cropduster", -- 512
  173.     "Stunt",
  174.     "Volvo FH12", -- 514
  175.     "Mercedes Actros",
  176.     "Ford Focus",
  177.     "Majestic",
  178.     "Buccaneer", -- 518
  179.     "Shamal",
  180.     "hydra",
  181.     "Jupiter",
  182.     "Yamaha",
  183.     "HPV1000 (Police)",
  184.     "CementTruck", -- 524
  185.     "TowTruck", -- 525
  186.     "Opel Monza", -- 526
  187.     "Lada Pro Sport",
  188.     "Grobovozka",
  189.     "BMW M5",
  190.     "Forklift",
  191.     "Tractor", -- 531
  192.     "Combine",
  193.     "BMW M3",
  194.     "Volkswagen Polo",
  195.     "Porsche Cayenne",
  196.     "Audi RS6",
  197.     "Freight (X)",
  198.     "Streak (X)",
  199.     "Vortex",
  200.     "Lada Priora",
  201.     "Mercedes AMG GT",
  202.     "Lada Niva",
  203.     "Mercedes SL65",
  204.     "Firetruck",
  205.     "Zhiguli 2106",
  206.     "Combi",
  207.     "KIA Ceed",
  208.     "Mi28",
  209.     "Zaporozhec",
  210.     "Hyunday Elantra",
  211.     "Honda Accord",
  212.     "Utility", -- 552
  213.     "Nevada", -- 553
  214.     "Gazel",
  215.     "Zaporozhec",
  216.     "Monster",
  217.     "Monster",
  218.     "Honda Civic", -- 558
  219.     "Rolls-Royce Wraith", -- 559
  220.     "Audi RS7",
  221.     "Moscvich",
  222.     "Nissan GTR",
  223.     "Raindance",
  224.     "RCTiger", -- 564
  225.     "Lada Samara 1500",
  226.     "Zhiguli 1500",
  227.     "Toyota Camry",
  228.     "Bac Mono",
  229.     "FreightFlat (X)",
  230.     "StreakCarriage (X)",
  231.     "Kart", -- 571
  232.     "Mower",
  233.     "Mercedes G65 6x6", -- 573
  234.     "Sweeper",
  235.     "Broadway",
  236.     "Moscvich", -- 576
  237.     "AT-400",
  238.     "Ural",
  239.     "Mercedes G65",
  240.     "Mercedes C63",
  241.     "Kawasaki (medium)", -- 581
  242.     "NewsVan",
  243.     "Tug",
  244.     "Trailer (X)", -- 584
  245.     "Mercedes Maybach",
  246.     "Wayfarer", -- 586
  247.     "Mercedes S63",
  248.     "Hotdog",
  249.     "Volkswagen Sirocco",
  250.     "FreightBox (X)",
  251.     "Trailer (X)",
  252.     "Andromada",-- 592
  253.     "Dodo", -- 593
  254.     "RCCam (X)", -- 594
  255.     "Launch",
  256.     "Audi A6 (police)",
  257.     "Skoda Octavia (Police)",
  258.     "Ford Focus (Police)",
  259.     "UAZ Hunter (Police)",
  260.     "Picador",
  261.     "BTR",
  262.     "BMW M2",
  263.     "Mercedes C63",
  264.     "DestroyCar",
  265.     "SpaceCar", -- 605
  266.     "Luggage A (X)", -- 606
  267.     "Luggage B (X)", -- 607
  268.     "Stairs (X)", -- 608
  269.     "Boxville", -- 609
  270.     "Tiller (X)",
  271.     "UtilityTrailer (X)"
  272. }
  273.  
  274. function asyncHttpRequest(method, url, args, resolve, reject)
  275.     local request_thread = effil.thread(function(method, url, args)
  276.         local requests = require"requests"
  277.         local result, response = pcall(requests.request, method, url, args)
  278.         if result then
  279.             response.json, response.xml = nil, nil
  280.             return true, response
  281.         else
  282.             return false, response
  283.         end
  284.     end)(method, url, args)
  285.  
  286.     if not resolve then
  287.         resolve = function() end
  288.     end
  289.     if not reject then
  290.         reject = function() end
  291.     end
  292.     lua_thread.create(function()
  293.         local runner = request_thread
  294.         while true do
  295.             local status, err = runner:status()
  296.             if not err then
  297.                 if status == "completed" then
  298.                     local result, response = runner:get()
  299.                     if result then
  300.                         resolve(response)
  301.                     else
  302.                         reject(response)
  303.                     end
  304.                     return
  305.                 elseif status == "canceled" then
  306.                     return reject(status)
  307.                 end
  308.             else
  309.                 return reject(err)
  310.             end
  311.             wait(0)
  312.         end
  313.     end)
  314. end
  315.  
  316. function distance_cord(lat1, lon1, lat2, lon2)
  317.     if lat1 == nil or lon1 == nil or lat2 == nil or lon2 == nil or lat1 == "" or lon1 == "" or lat2 == "" or lon2 == "" then
  318.         return 0
  319.     end
  320.     local dlat = math.rad(lat2 - lat1)
  321.     local dlon = math.rad(lon2 - lon1)
  322.     local sin_dlat = math.sin(dlat / 2)
  323.     local sin_dlon = math.sin(dlon / 2)
  324.     local a =
  325.         sin_dlat * sin_dlat + math.cos(math.rad(lat1)) * math.cos(
  326.             math.rad(lat2)
  327.         ) * sin_dlon * sin_dlon
  328.     local c = 2 * math.atan2(math.sqrt(a), math.sqrt(1 - a))
  329.     local d = 6378 * c
  330.     return d
  331. end
  332.  
  333. --HOOKS
  334. local hook = {hooks = {}}
  335. addEventHandler('onScriptTerminate', function(scr)
  336.     if scr == script.this then
  337.         for i, hook in ipairs(hook.hooks) do
  338.             if hook.status then
  339.                 hook.stop()
  340.             end
  341.         end
  342.     end
  343. end)
  344. ffi.cdef [[
  345.     int VirtualProtect(void* lpAddress, unsigned long dwSize, unsigned long flNewProtect, unsigned long* lpflOldProtect);
  346. ]]
  347. function hook.new(cast, callback, hook_addr, size)
  348.     local size = size or 5
  349.     local new_hook = {}
  350.     local detour_addr = tonumber(ffi.cast('intptr_t', ffi.cast('void*', ffi.cast(cast, callback))))
  351.     local void_addr = ffi.cast('void*', hook_addr)
  352.     local old_prot = ffi.new('unsigned long[1]')
  353.     local org_bytes = ffi.new('uint8_t[?]', size)
  354.     ffi.copy(org_bytes, void_addr, size)
  355.     local hook_bytes = ffi.new('uint8_t[?]', size, 0x90)
  356.     hook_bytes[0] = 0xE9
  357.     ffi.cast('uint32_t*', hook_bytes + 1)[0] = detour_addr - hook_addr - 5
  358.     new_hook.call = ffi.cast(cast, hook_addr)
  359.     new_hook.status = false
  360.     local function set_status(bool)
  361.         new_hook.status = bool
  362.         ffi.C.VirtualProtect(void_addr, size, 0x40, old_prot)
  363.         ffi.copy(void_addr, bool and hook_bytes or org_bytes, size)
  364.         ffi.C.VirtualProtect(void_addr, size, old_prot[0], old_prot)
  365.     end
  366.     new_hook.stop = function() set_status(false) end
  367.     new_hook.start = function() set_status(true) end
  368.     new_hook.start()
  369.     table.insert(hook.hooks, new_hook)
  370.     return setmetatable(new_hook, {
  371.         __call = function(self, ...)
  372.             self.stop()
  373.             local res = self.call(...)
  374.             self.start()
  375.             return res
  376.         end
  377.     })
  378. end
  379. --HOOKS
  380.  
  381.  
  382.  
  383. function imgui.TextColoredRGB(text)
  384.   local style = imgui.GetStyle()
  385.   local colors = style.Colors
  386.   local ImVec4 = imgui.ImVec4
  387.  
  388.   local explode_argb = function(argb)
  389.       local a = bit.band(bit.rshift(argb, 24), 0xFF)
  390.       local r = bit.band(bit.rshift(argb, 16), 0xFF)
  391.       local g = bit.band(bit.rshift(argb, 8), 0xFF)
  392.       local b = bit.band(argb, 0xFF)
  393.       return a, r, g, b
  394.   end
  395.  
  396.   local getcolor = function(color)
  397.       if color:sub(1, 6):upper() == 'SSSSSS' then
  398.           local r, g, b = colors[1].x, colors[1].y, colors[1].z
  399.           local a = tonumber(color:sub(7, 8), 16) or colors[1].w * 255
  400.           return ImVec4(r, g, b, a / 255)
  401.       end
  402.       local color = type(color) == 'string' and tonumber(color, 16) or color
  403.       if type(color) ~= 'number' then return end
  404.       local r, g, b, a = explode_argb(color)
  405.       return imgui.ImColor(r, g, b, a):GetVec4()
  406.   end
  407.  
  408.   local render_text = function(text_)
  409.       for w in text_:gmatch('[^\r\n]+') do
  410.           local text, colors_, m = {}, {}, 1
  411.           w = w:gsub('{(......)}', '{%1FF}')
  412.           while w:find('{........}') do
  413.               local n, k = w:find('{........}')
  414.               local color = getcolor(w:sub(n + 1, k - 1))
  415.               if color then
  416.                   text[#text], text[#text + 1] = w:sub(m, n - 1), w:sub(k + 1, #w)
  417.                   colors_[#colors_ + 1] = color
  418.                   m = n
  419.               end
  420.               w = w:sub(1, n - 1) .. w:sub(k + 1, #w)
  421.           end
  422.           if text[0] then
  423.               for i = 0, #text do
  424.                   imgui.TextColored(colors_[i] or colors[1], u8(text[i]))
  425.                   imgui.SameLine(nil, 0)
  426.               end
  427.               imgui.NewLine()
  428.           else imgui.Text(u8(w)) end
  429.       end
  430.   end
  431.  
  432.   render_text(text)
  433. end
  434.  
  435.  
  436. function apply_custom_style()
  437.     imgui.SwitchContext()
  438.     local style = imgui.GetStyle()
  439.     local colors = style.Colors
  440.     local clr = imgui.Col
  441.     local ImVec4 = imgui.ImVec4
  442.  
  443.     style.WindowRounding = 2.0
  444.     style.WindowTitleAlign = imgui.ImVec2(0.5, 0.84)
  445.     style.ChildWindowRounding = 2.0
  446.     style.FrameRounding = 2.0
  447.     style.ItemSpacing = imgui.ImVec2(5.0, 4.0)
  448.     style.ScrollbarSize = 13.0
  449.     style.ScrollbarRounding = 0
  450.     style.GrabMinSize = 8.0
  451.     style.GrabRounding = 1.0
  452.  
  453.     colors[clr.FrameBg]                = ImVec4(0.48, 0.16, 0.16, 0.54)
  454.     colors[clr.FrameBgHovered]         = ImVec4(0.98, 0.26, 0.26, 0.40)
  455.     colors[clr.FrameBgActive]          = ImVec4(0.98, 0.26, 0.26, 0.67)
  456.     colors[clr.TitleBg]                = ImVec4(0.04, 0.04, 0.04, 1.00)
  457.     colors[clr.TitleBgActive]          = ImVec4(0.48, 0.16, 0.16, 1.00)
  458.     colors[clr.TitleBgCollapsed]       = ImVec4(0.00, 0.00, 0.00, 0.51)
  459.     colors[clr.CheckMark]              = ImVec4(0.98, 0.26, 0.26, 1.00)
  460.     colors[clr.SliderGrab]             = ImVec4(0.88, 0.26, 0.24, 1.00)
  461.     colors[clr.SliderGrabActive]       = ImVec4(0.98, 0.26, 0.26, 1.00)
  462.     colors[clr.Button]                 = ImVec4(0.98, 0.26, 0.26, 0.40)
  463.     colors[clr.ButtonHovered]          = ImVec4(0.98, 0.26, 0.26, 1.00)
  464.     colors[clr.ButtonActive]           = ImVec4(0.98, 0.06, 0.06, 1.00)
  465.     colors[clr.Header]                 = ImVec4(0.98, 0.26, 0.26, 0.31)
  466.     colors[clr.HeaderHovered]          = ImVec4(0.98, 0.26, 0.26, 0.80)
  467.     colors[clr.HeaderActive]           = ImVec4(0.98, 0.26, 0.26, 1.00)
  468.     colors[clr.Separator]              = colors[clr.Border]
  469.     colors[clr.SeparatorHovered]       = ImVec4(0.75, 0.10, 0.10, 0.78)
  470.     colors[clr.SeparatorActive]        = ImVec4(0.75, 0.10, 0.10, 1.00)
  471.     colors[clr.ResizeGrip]             = ImVec4(0.98, 0.26, 0.26, 0.25)
  472.     colors[clr.ResizeGripHovered]      = ImVec4(0.98, 0.26, 0.26, 0.67)
  473.     colors[clr.ResizeGripActive]       = ImVec4(0.98, 0.26, 0.26, 0.95)
  474.     colors[clr.TextSelectedBg]         = ImVec4(0.98, 0.26, 0.26, 0.35)
  475.     colors[clr.Text]                   = ImVec4(1.00, 1.00, 1.00, 1.00)
  476.     colors[clr.TextDisabled]           = ImVec4(0.50, 0.50, 0.50, 1.00)
  477.     colors[clr.WindowBg]               = ImVec4(0.06, 0.06, 0.06, 0.94)
  478.     colors[clr.ChildWindowBg]          = ImVec4(1.00, 1.00, 1.00, 0.00)
  479.     colors[clr.PopupBg]                = ImVec4(0.08, 0.08, 0.08, 0.94)
  480.     colors[clr.ComboBg]                = colors[clr.PopupBg]
  481.     colors[clr.Border]                 = ImVec4(0.43, 0.43, 0.50, 0.50)
  482.     colors[clr.BorderShadow]           = ImVec4(0.00, 0.00, 0.00, 0.00)
  483.     colors[clr.MenuBarBg]              = ImVec4(0.14, 0.14, 0.14, 1.00)
  484.     colors[clr.ScrollbarBg]            = ImVec4(0.02, 0.02, 0.02, 0.53)
  485.     colors[clr.ScrollbarGrab]          = ImVec4(0.31, 0.31, 0.31, 1.00)
  486.     colors[clr.ScrollbarGrabHovered]   = ImVec4(0.41, 0.41, 0.41, 1.00)
  487.     colors[clr.ScrollbarGrabActive]    = ImVec4(0.51, 0.51, 0.51, 1.00)
  488.     colors[clr.CloseButton]            = ImVec4(0.41, 0.41, 0.41, 0.50)
  489.     colors[clr.CloseButtonHovered]     = ImVec4(0.98, 0.39, 0.36, 1.00)
  490.     colors[clr.CloseButtonActive]      = ImVec4(0.98, 0.39, 0.36, 1.00)
  491.     colors[clr.PlotLines]              = ImVec4(0.61, 0.61, 0.61, 1.00)
  492.     colors[clr.PlotLinesHovered]       = ImVec4(1.00, 0.43, 0.35, 1.00)
  493.     colors[clr.PlotHistogram]          = ImVec4(0.90, 0.70, 0.00, 1.00)
  494.     colors[clr.PlotHistogramHovered]   = ImVec4(1.00, 0.60, 0.00, 1.00)
  495.     colors[clr.ModalWindowDarkening]   = ImVec4(0.80, 0.80, 0.80, 0.35)
  496. end
  497. apply_custom_style()
  498.  
  499. function hasRename()
  500.   local SCRIPT_NAME = "AdminToolsRodina"
  501.   local SCRIPT_EXTENSION = ".luac"
  502.   if thisScript().name ~= string.format("%s%s", tostring(SCRIPT_NAME), tostring(SCRIPT_EXTENSION)) then
  503.       return true
  504.   else
  505.       return false
  506.   end
  507. end
  508.  
  509. function main() -- Главная функция
  510.     if not isSampLoaded() or not isSampfuncsLoaded() then return end
  511.     while not isSampAvailable() do wait(100) end
  512.     if hasRename() then
  513.         SCM("Верните обратно название скрипта - RodinaTools.luac")
  514.         print("[LOG] Изменено название скрипта. Скрипт завершил работу.")
  515.         thisScript():unload()
  516.     end
  517.     wait(500)
  518.     local _, myID = sampGetPlayerIdByCharHandle(PLAYER_PED)
  519.     local MyNickname = sampGetPlayerNickname(myID)
  520.     local linkAccess = "https://raw.githubusercontent.com/Glade412/RodinaToolsADM/master/AccesADM.txt"
  521.     local fpathAccess = os.getenv('TEMP') .. '\\AAdm.txt'
  522.     downloadUrlToFile(linkAccess, fpathAccess, function(id3, status, p13, p23)
  523.        if status == dlstatus.STATUS_ENDDOWNLOADDATA then
  524.             local fileReadAccess = io.open(fpathAccess, 'r')
  525.             if fileReadAccess then
  526.               local CheckAccess = fileReadAccess:read('*a')
  527.               if CheckAccess:find("(%d+)%:"..MyNickname) then
  528.                 ipServ, PortServ = sampGetCurrentServerAddress()
  529.                 if tostring(ipServ) == tostring("185.169.134.163") and tostring(PortServ) == "7777" then -- CO
  530.                     titleOkrug = "CO"
  531.                     nameOkrug = "Центральный Округ"
  532.                     serverIPandPort_auth = true
  533.                 end
  534.                 if tostring(ipServ) == tostring("185.169.134.60") and tostring(PortServ) == "8904" then -- YUO
  535.                     titleOkrug = "YUO"
  536.                     nameOkrug = "Южный Округ"
  537.                     serverIPandPort_auth = true
  538.                 end
  539.                 if tostring(ipServ) == tostring("185.169.134.62") and tostring(PortServ) == "8904" then -- SO
  540.                     titleOkrug = "SO"
  541.                     nameOkrug = "Северный Округ"
  542.                     serverIPandPort_auth = true
  543.                 end
  544.                 if tostring(ipServ) == tostring("185.169.134.108") and tostring(PortServ) == "7777" then -- VO
  545.                     titleOkrug = "VO"
  546.                     nameOkrug = "Восточный Округ"
  547.                     serverIPandPort_auth = true
  548.                   end
  549.           if tostring(ipServ) == tostring("149.202.199.88") and tostring(PortServ) == "8904" then -- Test
  550.             titleOkrug = "Test"
  551.             nameOkrug = "Test Server Rodina"
  552.             serverIPandPort_auth = true
  553.           end
  554.           if not serverIPandPort_auth then
  555.             print("[LOG] На данном сервере скрипт работать не будет! Работает только на серверах Родины РП.")
  556.             print("[LOG] Был выполнен заход на - "..ipServ..":"..PortServ)
  557.             thisScript():unload()
  558.           end
  559.           print("[LOG] Авторизация на сервер прошла успешно - "..nameOkrug)
  560.           fileReadAccess:close()
  561.           os.remove(fpathAccess)
  562.           authorization = true
  563.         else
  564.           SCM("You do not have access..")
  565.           print("[LOG] Пользователь "..MyNickname.." не имеет доступа к скрипту. Обратитесь к автору скрипта.")
  566.           fileReadAccess:close()
  567.           os.remove(fpathAccess)
  568.           thisScript():unload()
  569.         end
  570.           end
  571.         end
  572.   end)
  573.   imgui.Process = false
  574.     while true do
  575.     wait(0)
  576.     if authorization then
  577.         StartWork()
  578.         authorization = false
  579.     end
  580.     if not SCRIPT_READY and update_ok and startwork_ok and tonumber(my_lvl_adm) then
  581.         SCRIPT_READY = true
  582.         adminschecker()
  583.     end
  584.     if SCRIPT_READY then
  585.         if main_window_state.v or recon_status then
  586.             if recon_status and data.ReconHelper.turn then
  587.                 imgui.Process = true
  588.             end
  589.             if main_window_state.v then
  590.                 imgui.Process = true
  591.             end
  592.         else
  593.             imgui.Process = false
  594.         end
  595.         if admchecker_changemoverender then
  596.         mouseX, mouseY = getCursorPos()
  597.         renderFontDrawText(admchecker_font, '{146300}Admins online {FFFFFF}[?]:', mouseX, mouseY, -1)
  598.         if isKeyDown(VK_LBUTTON) then
  599.             admchecker_changemoverender = false
  600.             data = LIP.load('moonloader\\config\\RodinaTools\\'..nameINI);
  601.             data.AdmChecker.coordX = mouseX
  602.             data.AdmChecker.coordY = mouseY
  603.             LIP.save('moonloader\\config\\RodinaTools\\'..nameINI, data);
  604.             sampToggleCursor(false)
  605.             main_window_state.v = true
  606.         end
  607.         else
  608.         if data.AdmChecker.turn then
  609.             achPosition = data.AdmChecker.coordY + 23
  610.             renderFontDrawText(admchecker_font, '{146300}Admins online {FFFFFF}['..#admchecker_adminList..']:', data.AdmChecker.coordX, data.AdmChecker.coordY, -1)
  611.             for i = 1, #admchecker_adminList do
  612.             renderFontDrawText(admchecker_font, admchecker_adminList[i][1], data.AdmChecker.coordX, achPosition, -1)
  613.             achPosition = achPosition + 17
  614.             end
  615.             end
  616.         end
  617.         if os.clock() >= admchecker_SortingTime and admchecker_SortingList then
  618.             table.sort(scores, function(lhs, rhs)
  619.                 return lhs[2] > rhs[2]
  620.             end)
  621.             admchecker_adminList = scores
  622.             admchecker_SortingList = false
  623.         end
  624.     end
  625.     if sampGetPlayerScore(getMyID()) > 0 and check_lvl_admbool then
  626.         sampSendChat("/admins")
  627.         check_my_lvlAdm = true
  628.         check_lvl_admbool = false
  629.     end
  630.     end
  631. end
  632.  
  633. function StartWork()
  634.     if not doesDirectoryExist("moonloader\\config") then
  635.         print("[LOG] Отсутствует папка config. Она была автоматически создана.")
  636.         createDirectory("moonloader\\config")
  637.     end
  638.     if not doesDirectoryExist("moonloader\\config\\RodinaTools") then
  639.         print("[LOG] Отсутствует папка RodinaTools. Она была автоматически создана.")
  640.         createDirectory("moonloader\\config\\RodinaTools")
  641.     end
  642.     if not doesFileExist("moonloader\\config\\RodinaTools\\"..nameINI) then
  643.         print("[LOG] Отсутствует файл AdmChecker.ini. Он был автоматически создан.")
  644.         local data =
  645.         {
  646.             AdmChecker =
  647.             {
  648.                 turn = true,
  649.                 FontName = "Verdana",
  650.                 FontSize = 9,
  651.                 FontFlag = 5,
  652.                 coordX = 40,
  653.                 coordY = 400,
  654.                 fullInfo = false,
  655.                 reportInfo = false,
  656.                 reportInfoOnlyForMe = false,
  657.                 Move1lvlAdm = true,
  658.                 Move2lvlAdm = true,
  659.                 Move3lvlAdm = true,
  660.                 Move4lvlAdm = true,
  661.                 Move5lvlAdm = true,
  662.                 Move6lvlAdm = true
  663.             },
  664.             ReconHelper =
  665.             {
  666.                 turn = false
  667.             }  
  668.         };
  669.         LIP.save('moonloader\\config\\RodinaTools\\'..nameINI, data);
  670.     end
  671.     data = LIP.load('moonloader\\config\\RodinaTools\\'..nameINI);
  672.   LIP.save('moonloader\\config\\RodinaTools\\'..nameINI, data);
  673.   admchecker_turn = imgui.ImBool(data.AdmChecker.turn)
  674.   recon_turn = imgui.ImBool(data.ReconHelper.turn)
  675.   fullInfo = imgui.ImBool(data.AdmChecker.fullInfo)
  676.   admchecker_input_changeFontName = imgui.ImBuffer(256)
  677.   admchecker_input_changeFontSize = imgui.ImBuffer(256)
  678.   admchecker_input_changeFontFlag = imgui.ImBuffer(256)
  679.   reportInfo = imgui.ImBool(data.AdmChecker.reportInfo)
  680.   reportInfoOnlyForMe = imgui.ImBool(data.AdmChecker.reportInfoOnlyForMe)
  681.   Move1lvlAdm = imgui.ImBool(data.AdmChecker.Move1lvlAdm)
  682.   Move2lvlAdm = imgui.ImBool(data.AdmChecker.Move2lvlAdm)
  683.   Move3lvlAdm = imgui.ImBool(data.AdmChecker.Move3lvlAdm)
  684.   Move4lvlAdm = imgui.ImBool(data.AdmChecker.Move4lvlAdm)
  685.   Move5lvlAdm = imgui.ImBool(data.AdmChecker.Move5lvlAdm)
  686.   Move6lvlAdm = imgui.ImBool(data.AdmChecker.Move6lvlAdm)
  687.     if data.AdmChecker.turn then
  688.         admchecker_statustextmenu = "Включено"
  689.     else
  690.         admchecker_statustextmenu = "Выключено"
  691.     end
  692.     if data.ReconHelper.turn then
  693.         recon_statustextmenu = "Включено"
  694.     else
  695.         recon_statustextmenu = "Выключено"
  696.     end
  697.     admchecker_font = renderCreateFont(data.AdmChecker.FontName, data.AdmChecker.FontSize, data.AdmChecker.FontFlag);
  698.     if not doesFileExist("moonloader\\config\\RodinaTools\\"..titleOkrug.."SAdm.txt") then
  699.         print("[LOG] Отсутствует файл "..titleOkrug.."SAdm.txt. Он был автоматически создан.")
  700.         SCM("Скачиваю файл с Администраторами 5-6 лвла - "..nameOkrug)
  701.         local link = "https://raw.githubusercontent.com/Glade412/RodinaToolsADM/master/SAdminList/"..titleOkrug.."SAdm.txt"
  702.         local fpath = getWorkingDirectory().."/config/RodinaTools/"..titleOkrug.."SAdm.txt"
  703.         downloadUrlToFile(link, fpath, function(id3, status1, p13, p23)
  704.             if status1 == dlstatus.STATUS_ENDDOWNLOADDATA then
  705.                 print("[LOG] Файл "..titleOkrug.."SAdm.txt был успешно скачан.")
  706.             end
  707.         end)
  708.     end
  709.     recon_timeCheckComplete = os.time()
  710.     dialogHook = hook.new('void(__thiscall *)(void *this, uint16_t wID, uint8_t iStyle, char *szCaption, char *szText, char *szButton1, char *szButton2, bool bSend)', dialogHook, getModuleHandle('samp.dll') + 0x6B9C0)
  711.     sampRegisterChatCommand("amenu", cmd_mainimgui)
  712.     sampRegisterChatCommand("admins", cmd_admins)
  713.     SCM('AdminTools Loaded...')
  714.     print("[LOG] Скрипт успешно начал работу.")
  715.     check_lvl_admbool = true
  716.     startwork_ok = true
  717.     update()
  718. end
  719.  
  720. function dialogHook(this, id, style, caption, text, button1, button2, send)
  721.   if ffi.string(caption):find("Статистика игрока") and recon_checkstats then
  722.    recon_textSTAT = ffi.string(text)
  723.    if recon_textSTAT:match("{ffffff}Организация:(.*){DC143C}Нет(.*){ffffff}Должность:(.*){DC143C}Нет(.*){ffffff}Супруг") then
  724.      recon_org = "Не имеется"
  725.      recon_rangCheck = false
  726.    else
  727.      recon_org, recon_rangTitle, recon_rangNumber = recon_textSTAT:match("{ffffff}Организация:.*{DC143C}(.*) {ffffff}Должность:.*{DC143C}(.*)%s%((.*)%).*{ffffff}Супруг")
  728.      recon_rangCheck = true
  729.    end
  730.     recon_checkstats = false
  731.    else
  732.    dialogHook.stop()
  733.    dialogHook.call(this, id, style, caption, text, button1, button2, send)
  734.    dialogHook.start()
  735.  end
  736. end
  737.  
  738.  
  739. -------------------------------CMDS
  740. function cmd_mainimgui()
  741.   main_window_state.v = not main_window_state.v
  742.   imgui.Process = main_window_state.v
  743. end
  744.  
  745. function cmd_admins()
  746.     sampSendChat("/admins")
  747.     sampAddChatMessage("{33CC00}Администрация онлайн:", -1)
  748.     for i = 1, #admchecker_adminList_forCMD do
  749.         sampAddChatMessage(admchecker_adminList_forCMD[i], -1714618369)
  750.     end
  751. end
  752.  
  753. function cmd_checklvl()
  754.     sampSendChat("/admins")
  755.     check_my_lvlAdm = true
  756. end
  757. -----------------------------------
  758.  
  759. function adminschecker()
  760.     lua_thread.create(function ()
  761.         while data.AdmChecker.turn do
  762.             wait(0)
  763.             if sampGetGamestate() == 3 then
  764.                 if not isGamePaused() then
  765.                     sampSendChat("/admins")
  766.                 end
  767.                 wait(tonumber(admchecker_timerForCheck))
  768.             end
  769.         end
  770.     end)
  771. end
  772.  
  773. -------------------------------EVENTS
  774. function sampev.onServerMessage(color, text)
  775.     if color == -1 and text:match("Администрация онлайн:") then
  776.         if SCRIPT_READY and data.AdmChecker.turn then
  777.             scores = {}
  778.             if not doesFileExist("moonloader\\config\\RodinaTools\\"..titleOkrug.."SAdm.txt") then
  779.                 if not admchecker_helpmark then
  780.                     admchecker_helpmark = true
  781.                     SCM("У вас отсутствует файл с Администрацией 5-6 лвла, для установки - /loadsadm")
  782.                 end
  783.             else
  784.                 for line in io.lines(getWorkingDirectory().."/config/RodinaTools/"..titleOkrug.."SAdm.txt") do
  785.                     local AdminNick, lvl = line:match("^(.*),(%d+)")
  786.                     admchecker_lvl = tonumber(lvl)
  787.                     if sampGetPlayerIdByNickname(AdminNick) then
  788.                         SadmID = sampGetPlayerIdByNickname(AdminNick)
  789.                         admchecker_Sid_text = "["..SadmID.."]"
  790.                         if tonumber(admchecker_lvl) == 6 then
  791.                             admchecker_Snick_text = "{c70219}"..AdminNick.."{FFFFFF}"
  792.                             if data.AdmChecker.Move6lvlAdm then
  793.                                 admchecker_SAdmpart = admchecker_Snick_text..""..admchecker_Sid_text
  794.                                 table.insert(scores, {admchecker_SAdmpart, admchecker_lvl})
  795.                             end
  796.                         elseif tonumber(admchecker_lvl) == 5 then
  797.                             admchecker_Snick_text = "{05960a}"..AdminNick.."{FFFFFF}"
  798.                             if data.AdmChecker.Move5lvlAdm then
  799.                                 admchecker_SAdmpart = admchecker_Snick_text..""..admchecker_Sid_text
  800.                                 table.insert(scores, {admchecker_SAdmpart, admchecker_lvl})
  801.                             end
  802.                         end
  803.                     end
  804.                 end
  805.             end
  806.             admchecker_SortingTime = os.clock() + 0.5
  807.             admchecker_SortingList = true
  808.         end
  809.         admchecker_adminList_forCMD = {}
  810.         return false
  811.     end
  812.     if color == -1714618369 and text:match("(%d+)%.%s%{fefe22%}(.*)%s%[ID%:%s(%d+)%]%s%-%s(.*)%[(%d+)%sур%]%s(.*)%-(.*)%[AFK%:%s(%d+)%]%{FFFFFF%}%s%-%sРепутация%:%s(%d+)") then
  813.         local posInAdm, nick, id, titleAdm, lvlAdm, part1, part2, afk, report = text:match("(%d+)%.%s%{fefe22%}(.*)%s%[ID%:%s(%d+)%]%s%-%s(.*)%[(%d+)%sур%]%s(.*)%-(.*)%[AFK%:%s(%d+)%]%{FFFFFF%}%s%-%sРепутация%:%s(%d+)")
  814.         table.insert(admchecker_adminList_forCMD, posInAdm..". {fefe22}"..nick.." [ID: "..id.."] - "..titleAdm.."["..lvlAdm.." ур]"..part1.."-"..part2.."[AFK: "..afk.."]{FFFFFF} - Репутация: "..report)
  815.         if check_my_lvlAdm then
  816.             if nick == sampGetPlayerNickname(getMyID()) then
  817.               my_lvl_adm = lvlAdm
  818.               check_my_lvlAdm = false
  819.             end
  820.         end
  821.         if SCRIPT_READY and data.AdmChecker.turn then
  822.             if part1:match("%{FFFFFF%} %- %{DC2020%}%/re (%d+)") then
  823.                 admchecker_recon_id = part1:match("%{FFFFFF%} %- %{DC2020%}%/re (%d+)")
  824.                 if tonumber(admchecker_recon_id) == getMyID() then
  825.                     admchecker_recon_text = " - {029c37}Следит за тобой{FFFFFF}"
  826.                 else
  827.                     admchecker_recon_text = " - {8c0023}/re "..admchecker_recon_id.."{FFFFFF}"
  828.                 end
  829.             else
  830.                 admchecker_recon_text = ""
  831.             end
  832.             if tonumber(afk) > 0 then
  833.                 admchecker_afk_text = " - {929693}[AFK: "..afk.."]{FFFFFF}"
  834.             else
  835.                 admchecker_afk_text = ""
  836.             end
  837.             local admchecker_id_text = "["..id.."]"
  838.             local admchecker_report_text = " {FFFFFF}- Реп: "..report.."{FFFFFF}"
  839.             local score = tonumber(lvlAdm)
  840.             if data.AdmChecker.fullInfo and data.AdmChecker.reportInfo then
  841.                 if data.AdmChecker.reportInfoOnlyForMe then
  842.                     if nick == sampGetPlayerNickname(getMyID()) then
  843.                         admchecker_other_part = admchecker_id_text..""..admchecker_afk_text..""..admchecker_recon_text..""..admchecker_report_text
  844.                     else
  845.                         admchecker_other_part = admchecker_id_text..""..admchecker_afk_text..""..admchecker_recon_text
  846.                     end
  847.                 else
  848.                     admchecker_other_part = admchecker_id_text..""..admchecker_afk_text..""..admchecker_recon_text..""..admchecker_report_text
  849.                 end
  850.             elseif data.AdmChecker.fullInfo and not data.AdmChecker.reportInfo then
  851.                 admchecker_other_part = admchecker_id_text..""..admchecker_afk_text..""..admchecker_recon_text
  852.             elseif not data.AdmChecker.fullInfo and data.AdmChecker.reportInfo then
  853.                 if data.AdmChecker.reportInfoOnlyForMe == 1 then
  854.                     if nick == sampGetPlayerNickname(getMyID()) then
  855.                         admchecker_other_part = admchecker_id_text..""..admchecker_report_text
  856.                     else
  857.                         admchecker_other_part = admchecker_id_text
  858.                     end
  859.                 else
  860.                     admchecker_other_part = admchecker_id_text..""..admchecker_report_text
  861.                 end
  862.             elseif not data.AdmChecker.fullInfo and not data.AdmChecker.reportInfo then
  863.                 admchecker_other_part = admchecker_id_text
  864.             end
  865.             if tonumber(lvlAdm) == 4 then
  866.                 admchecker_nick_text = "{030FC4}"..nick.."{FFFFFF}"
  867.                 if data.AdmChecker.Move4lvlAdm then
  868.                     admchecker_part = admchecker_nick_text..""..admchecker_other_part
  869.                     table.insert(scores, {admchecker_part, score})
  870.                 end
  871.             elseif tonumber(lvlAdm) == 3 then
  872.                 admchecker_nick_text = "{EEFF00}"..nick.."{FFFFFF}"
  873.                 if data.AdmChecker.Move3lvlAdm then
  874.                     admchecker_part = admchecker_nick_text..""..admchecker_other_part
  875.                     table.insert(scores, {admchecker_part, score})
  876.                 end
  877.             elseif tonumber(lvlAdm) == 2 then
  878.                 admchecker_nick_text = "{2b61ce}"..nick.."{FFFFFF}"
  879.                 if data.AdmChecker.Move2lvlAdm then
  880.                     admchecker_part = admchecker_nick_text..""..admchecker_other_part
  881.                     table.insert(scores, {admchecker_part, score})
  882.                 end
  883.             elseif tonumber(lvlAdm) == 1 then
  884.                 admchecker_nick_text = "{32b0c5}"..nick.."{FFFFFF}"
  885.                 if data.AdmChecker.Move1lvlAdm then
  886.                     admchecker_part = admchecker_nick_text..""..admchecker_other_part
  887.                     table.insert(scores, {admchecker_part, score})
  888.                 end
  889.             end
  890.         end
  891.         return false
  892.     end
  893.     if recon_getipCheck and color == 1790050218 and text:match("Nik %[(.*)%]") then
  894.         local NickPL, RIP, IP = text:match("Nik %[(.*)%]  R%-IP%s%[(.*)]%s%sIP%s%[(.*)%]")
  895.         if recon_ID then
  896.             local recon_getipNick = sampGetPlayerNickname(recon_ID)
  897.             cl = RIP .. " " .. IP
  898.             print(NickPL .. " " .. cl)
  899.             ips = {}
  900.             for word in string.gmatch(cl, "(%d+%p%d+%p%d+%p%d+)") do
  901.                 table.insert(ips, { query = word })
  902.             end
  903.             if #ips > 0 then
  904.                 data_json = cjson.encode(ips)
  905.                 asyncHttpRequest("POST", "http://ip-api.com/batch?fields=25305&lang=ru", { data = data_json },
  906.                     function(response)
  907.                         local rdata = cjson.decode(u8:decode(response.text))
  908.                         local text = ""
  909.                         if rdata[1]["status"] == "success" and rdata[2]["status"] == "success" then
  910.                             local distances =
  911.                             distance_cord(
  912.                                 rdata[1]["lat"],
  913.                                 rdata[1]["lon"],
  914.                                 rdata[2]["lat"],
  915.                                 rdata[2]["lon"]
  916.                             )
  917.                             sampAddChatMessage("[IPChecker] {FFFFFF}Ник - {0f961a}"..recon_getipNick.." {FFFFFF}| RegIP - {0f961a}"..RIP.." {FFFFFF}| LastIP - {0f961a}"..IP, 0xdeb226)
  918.                             sampAddChatMessage("[REG] {FFFFFF}Страна - {0f961a}"..rdata[1]["country"].." {FFFFFF}| Город - {0f961a}"..rdata[1]["city"].." {FFFFFF}| Провайдер - {0f961a}"..rdata[1]["isp"], 0xdeb226)
  919.                             sampAddChatMessage("[LAST] {FFFFFF}Страна - {0f961a}"..rdata[2]["country"].." {FFFFFF}| Город - {0f961a}"..rdata[2]["city"].." {FFFFFF}| Провайдер - {0f961a}"..rdata[2]["isp"], 0xdeb226)
  920.                             sampAddChatMessage("[DIST] {FFFFFF}Расстояние между городами - {0f961a}"..math.ceil(distances-0.5).." {FFFFFF}км", 0xdeb226)
  921.                         end
  922.                 end,
  923.                 function(err)
  924.                     sampAddChatMessage("Информация о IP Произошла ошибка:", -1)
  925.                     sampAddChatMessage(err, -1)
  926.                 end)
  927.         else
  928.             SCM("ID за кем вы следите не найден.")
  929.         end
  930.     end
  931.         recon_getipCheck = false
  932.         return false
  933.     end
  934.     if recon_PgetipCheck and color == 1790050218 and text:match("Nik %[(.*)%]") then
  935.         local NickPL, RIP, IP = text:match("Nik %[(.*)%]  R%-IP%s%[(.*)]%s%sIP%s%[(.*)%]")
  936.         sampSendChat("/pgetip "..IP)
  937.         recon_PgetipCheck = false
  938.     end
  939.     if recon_cmdWeap and color == 1687547391 and text:match("Вы отобрали оружие у игрока%s(.*)%[(%d+)%]") then
  940.         SCM("Оружие отобрано у игрока "..recon_nickname.." ["..recon_ID.."]")
  941.         recon_cmdWeap = false
  942.         return false
  943.     end
  944. end
  945.  
  946. function sampev.onTextDrawHide(textDrawId)
  947.     if textDrawId == recon_TD_main then
  948.         recon_status = false
  949.     end
  950. end
  951.  
  952. function sampev.onShowTextDraw(id, data)
  953.     if data.boxColor == 1428035613 then
  954.         recon_TD_DEL = id
  955.     end
  956. end
  957.  
  958. function sampev.onTextDrawSetString(id, text)
  959.     if text:match("ID%:%s(%d+)___%((.*)%)%~n%~HP%:%s(.*)%~n%~(.*)") then
  960.         recon_TD_main = id
  961.         recon_TD_dop = recon_TD_main + 1
  962.         recon_TD_nickname = recon_TD_main - 1
  963.     end
  964.     --print(id.."    ".. text)
  965.     if id == recon_TD_main then
  966.       RPtext1 = text
  967.       if RPtext1:match("(.*)Arm%:(.*)") then
  968.        recon_ID, versClient, recon_HP, recon_ARM, recon_vHP, color_statusENG, recon_statusENG, recon_vSpeed, recon_ping, recon_fuel, recon_gun, recon_ammo = RPtext1:match("ID%:%s(%d+)___%((.*)%)%~n%~HP%:%s(.*)%~n%~Arm%:%s(.*)%~n%~vHP%:%s(.*)__%(%~(.*)%~eng%s(.*)%~w%~%)%~n%~vSpeed%:%s(%d+)km%/h%~n%~Ping%:%s(%d+)%~n%~Fuel%:%s(.*)%slitres%~n%~Gun%:%sid%s(%d+)__ammo%:%s(.*)")
  969.       if recon_ID and recon_HP and recon_ARM and recon_vHP and recon_statusENG and recon_vSpeed and recon_ping and recon_fuel and recon_gun and recon_ammo then
  970.         recon_nickname = sampGetPlayerNickname(recon_ID)
  971.     --   print(recon_nickname.." | "..recon_ID.." | "..recon_HP.." | "..recon_ARM.." | "..recon_vHP.." | "..recon_statusENG.." | "..recon_vSpeed.." | "..recon_ping.." | "..recon_fuel.." | "..recon_gun.." | "..recon_ammo)
  972.  
  973.       end
  974.       else
  975.       recon_ID, versClient, recon_HP, recon_ARM, recon_ping, recon_gun, recon_ammo = RPtext1:match("ID%:%s(%d+)___%((.*)%)%~n%~HP%:%s(.*)%~n%~Armour%:%s(.*)%~n%~Ping%:%s(%d+)%~n%~Gun%:%sid%s(%d+)__ammo%:%s(.*)")
  976.      if recon_ID and recon_HP and recon_ARM and recon_ping and recon_gun and recon_ammo then
  977.        recon_nickname = sampGetPlayerNickname(recon_ID)
  978.      -- print(recon_nickname.." | "..recon_ID.." | "..recon_HP.." | "..recon_ARM.." | "..recon_ping.." | "..recon_gun.." | "..recon_ammo)
  979.     end
  980.   end
  981.     end
  982.       if id == recon_TD_dop then
  983.         RPtext2 = text
  984.        recon_lvl, recon_money, recon_bankmoney, recon_deposit, recon_warns = RPtext2:match("LVL%:%s(%d+)%~n%~Money%:%s(%d+)_r%~n%~Bank%:%s(%d+)_r%~n%~Deposit%:%s(%d+)_r%~n%~Warn%:%s(%d+)%~n%~")
  985.       if recon_lvl and recon_money and recon_bankmoney and recon_deposit and recon_warns then
  986.      --  print(recon_lvl.." | "..recon_money.." | "..recon_bankmoney.." | "..recon_deposit.." | "..recon_warns)
  987.      end
  988.     end
  989. end
  990.  
  991. function sampev.onSpectatePlayer(playerId, camType)
  992.     recon_ID = playerId
  993.     print(playerId)
  994.   recon_onFoot = true
  995.     recon_status = true
  996. end
  997.  
  998. function sampev.onSpectateVehicle(vehicleId, camType)
  999.     print(vehicleId)
  1000.     recon_vehID = vehicleId
  1001.     recon_onCar = true
  1002.     recon_onCar_stats = true
  1003.     recon_status = true
  1004. end
  1005.  
  1006. function sampev.onSendCommand(command)
  1007.     if command:match("/re%s(%d+)") or command:match("/re_next") then
  1008.         checkStatsPlayerOTHER()
  1009.     end
  1010. end
  1011. -------------------------------------------------------------------
  1012.  
  1013.  
  1014.  
  1015. function imgui.OnDrawFrame()
  1016.   if main_window_state.v then
  1017.     imgui.SetNextWindowSize(imgui.ImVec2(800, 350), imgui.Cond.FirstUseEver)
  1018.     local sW, sH = getScreenResolution()
  1019.     if not recon_status then
  1020.         imgui.ShowCursor = true
  1021.     end
  1022.     imgui.SetNextWindowPos(imgui.ImVec2(sW / 2, sH / 2), imgui.Cond.ImGuiCond_Always, imgui.ImVec2(0.5, 0.5))
  1023.   imgui.Begin("RodinaTools",main_window_state, imgui.WindowFlags.NoResize)
  1024.   imgui.BeginChild('left pane', imgui.ImVec2(150, 0), false)
  1025.   if imgui.Button(u8"Админ Чекер", imgui.ImVec2(145, 20)) then
  1026.         uu()
  1027.     tab[1] = true
  1028.   end
  1029.   if imgui.Button(u8"Рекон Хелпер", imgui.ImVec2(145, 20)) then
  1030.         uu()
  1031.     tab[2] = true
  1032.   end
  1033.   imgui.EndChild()
  1034.   imgui.SameLine(175)
  1035.     if tab[1] == true then
  1036.       imgui.BeginGroup()
  1037.       imgui.Text(u8"Админ Чекер")
  1038.       imgui.Separator()
  1039.       if imgui.ToggleButton(u8("##554479548"), admchecker_turn) then
  1040.         data = LIP.load('moonloader\\config\\RodinaTools\\'..nameINI);
  1041.         if data.AdmChecker.turn then
  1042.           admchecker_statustextmenu = "Выключено"
  1043.           data.AdmChecker.turn = false
  1044.           LIP.save('moonloader\\config\\RodinaTools\\'..nameINI, data);
  1045.         else
  1046.           admchecker_statustextmenu = "Включено"
  1047.           data.AdmChecker.turn = true
  1048.           LIP.save('moonloader\\config\\RodinaTools\\'..nameINI, data);
  1049.         end
  1050.       end
  1051.       imgui.SameLine(30)
  1052.       imgui.Text(u8(admchecker_statustextmenu))
  1053.       imgui.Separator()
  1054.       imgui.BeginGroup()
  1055.       imgui.PushItemWidth(200)
  1056.       imgui.InputText("##changeFontName", admchecker_input_changeFontName)
  1057.       imgui.PopItemWidth()
  1058.       imgui.SameLine(400)
  1059.  
  1060.       if not imgui.IsItemActive() and admchecker_input_changeFontName.v:len() == 0 then
  1061.         imgui.SameLine(4)
  1062.                 imgui.TextColoredRGB("{807f7d}Шрифт: "..data.AdmChecker.FontName)
  1063.       end
  1064.       imgui.SameLine(210)
  1065.       if imgui.Button(u8"Сохранить##1", imgui.ImVec2(70, 20)) then
  1066.         if admchecker_input_changeFontName.v == "" then
  1067.           SCM("Нельзя оставлять пустую строку")
  1068.         else
  1069.         data = LIP.load('moonloader\\config\\RodinaTools\\'..nameINI);
  1070.         data.AdmChecker.FontName = admchecker_input_changeFontName.v
  1071.         LIP.save('moonloader\\config\\RodinaTools\\'..nameINI, data);
  1072.         admchecker_font = renderCreateFont(data.AdmChecker.FontName, data.AdmChecker.FontSize, data.AdmChecker.FontFlag);
  1073.         admchecker_input_changeFontName.v = ""
  1074.         end
  1075.       end
  1076.       imgui.PushItemWidth(200)
  1077.       imgui.InputText("##changeFontSize", admchecker_input_changeFontSize)
  1078.       imgui.PopItemWidth()
  1079.       if not imgui.IsItemActive() and admchecker_input_changeFontSize.v:len() == 0 then
  1080.                 imgui.SameLine(4)
  1081.                 imgui.TextColoredRGB("{807f7d}Размер шрифта: "..data.AdmChecker.FontSize)
  1082.             end
  1083.       imgui.SameLine(210)
  1084.       if imgui.Button(u8"Сохранить##2", imgui.ImVec2(70, 20)) then
  1085.         if admchecker_input_changeFontSize.v == "" then
  1086.           SCM("Нельзя оставлять пустую строку")
  1087.         else
  1088.           data = LIP.load('moonloader\\config\\RodinaTools\\'..nameINI);
  1089.           data.AdmChecker.FontSize = admchecker_input_changeFontSize.v
  1090.           LIP.save('moonloader\\config\\RodinaTools\\'..nameINI, data);
  1091.          admchecker_font = renderCreateFont(data.AdmChecker.FontName, data.AdmChecker.FontSize, data.AdmChecker.FontFlag);
  1092.           admchecker_input_changeFontSize.v = ""
  1093.         end
  1094.       end
  1095.       imgui.PushItemWidth(200)
  1096.       imgui.InputText("##changeFontFlag", admchecker_input_changeFontFlag)
  1097.       imgui.PopItemWidth()
  1098.       if not imgui.IsItemActive() and admchecker_input_changeFontFlag.v:len() == 0 then
  1099.                 imgui.SameLine(4)
  1100.                 imgui.TextColoredRGB("{807f7d}Флаг шрифта: "..data.AdmChecker.FontFlag)
  1101.             end
  1102.       imgui.SameLine(210)
  1103.       if imgui.Button(u8"Сохранить##3", imgui.ImVec2(70, 20)) then
  1104.         if admchecker_input_changeFontFlag.v == "" then
  1105.           SCM("Нельзя оставлять пустую строку")
  1106.         else
  1107.           data = LIP.load('moonloader\\config\\RodinaTools\\'..nameINI);
  1108.           data.AdmChecker.FontFlag = admchecker_input_changeFontFlag.v
  1109.           LIP.save('moonloader\\config\\RodinaTools\\'..nameINI, data);
  1110.           admchecker_font = renderCreateFont(data.AdmChecker.FontName, data.AdmChecker.FontSize, data.AdmChecker.FontFlag);
  1111.           admchecker_input_changeFontFlag.v = ""
  1112.         end
  1113.       end
  1114.       if imgui.Checkbox(u8'Отображать статус рекона', fullInfo) then
  1115.         data = LIP.load('moonloader\\config\\RodinaTools\\'..nameINI);
  1116.         if data.AdmChecker.fullInfo then
  1117.           data.AdmChecker.fullInfo = false
  1118.           LIP.save('moonloader\\config\\RodinaTools\\'..nameINI, data);
  1119.         else
  1120.           data.AdmChecker.fullInfo = true
  1121.           LIP.save('moonloader\\config\\RodinaTools\\'..nameINI, data);
  1122.         end
  1123.       end
  1124.       if imgui.Checkbox(u8'Отображать кол-во репорт', reportInfo) then
  1125.         data = LIP.load('moonloader\\config\\RodinaTools\\'..nameINI);
  1126.         if data.AdmChecker.reportInfo then
  1127.           data.AdmChecker.reportInfo = false
  1128.           LIP.save('moonloader\\config\\RodinaTools\\'..nameINI, data);
  1129.         else
  1130.           data.AdmChecker.reportInfo = true
  1131.           LIP.save('moonloader\\config\\RodinaTools\\'..nameINI, data);
  1132.         end
  1133.       end
  1134.       if data.AdmChecker.reportInfo then
  1135.         if imgui.Checkbox(u8'Отображать только свой репорт', reportInfoOnlyForMe) then
  1136.           data = LIP.load('moonloader\\config\\RodinaTools\\'..nameINI);
  1137.           if data.AdmChecker.reportInfoOnlyForMe then
  1138.             data.AdmChecker.reportInfoOnlyForMe = false
  1139.             LIP.save('moonloader\\config\\RodinaTools\\'..nameINI, data);
  1140.           else
  1141.             data.AdmChecker.reportInfoOnlyForMe = true
  1142.             LIP.save('moonloader\\config\\RodinaTools\\'..nameINI, data);
  1143.           end
  1144.         end
  1145.       end
  1146.       imgui.Text("")
  1147.       if imgui.Button(u8"Сменить позицию рендера##13", imgui.ImVec2(200, 20)) then
  1148.         sampToggleCursor(true)
  1149.         admchecker_changemoverender = true
  1150.         main_window_state.v = false
  1151.       end
  1152.       imgui.Text(u8("Координаты: X"..data.AdmChecker.coordX.."   Y"..data.AdmChecker.coordY))
  1153.       imgui.Text("")
  1154.       imgui.Text("")
  1155.       if imgui.Button(u8"Перекачать список Руководящей Администрации (5+)##1231234", imgui.ImVec2(323, 20)) then
  1156.         local link = "https://raw.githubusercontent.com/Glade412/RodinaToolsADM/master/SAdminList/"..titleOkrug.."SAdm.txt"
  1157.         local fpath = getWorkingDirectory().."/config/RodinaTools/"..titleOkrug.."SAdm.txt"
  1158.         os.remove(fpath)
  1159.          downloadUrlToFile(link, fpath, function(id3, status1, p13, p23)
  1160.           if status1 == dlstatus.STATUS_ENDDOWNLOADDATA then
  1161.             SCM("Файл с Админами 5-6 лвла скачан")
  1162.             print("[LOG] Файл с администрацией успешно скачан.")
  1163.           end
  1164.         end)
  1165.       end
  1166.       imgui.EndGroup()
  1167.       imgui.SameLine(350)
  1168.       imgui.BeginChild('Dop panel#12354', imgui.ImVec2(173, 155), true)
  1169.       if imgui.Checkbox(u8'Отображение 1 лвл`а', Move1lvlAdm) then
  1170.         data = LIP.load('moonloader\\config\\RodinaTools\\'..nameINI);
  1171.         if data.AdmChecker.Move1lvlAdm then
  1172.           data.AdmChecker.Move1lvlAdm = false
  1173.           LIP.save('moonloader\\config\\RodinaTools\\'..nameINI, data);
  1174.         else
  1175.           data.AdmChecker.Move1lvlAdm = true
  1176.           LIP.save('moonloader\\config\\RodinaTools\\'..nameINI, data);
  1177.         end
  1178.       end
  1179.       if imgui.Checkbox(u8'Отображение 2 лвл`а', Move2lvlAdm) then
  1180.         data = LIP.load('moonloader\\config\\RodinaTools\\'..nameINI);
  1181.         if data.AdmChecker.Move2lvlAdm then
  1182.           data.AdmChecker.Move2lvlAdm = false
  1183.           LIP.save('moonloader\\config\\RodinaTools\\'..nameINI, data);
  1184.         else
  1185.           data.AdmChecker.Move2lvlAdm = true
  1186.           LIP.save('moonloader\\config\\RodinaTools\\'..nameINI, data);
  1187.         end
  1188.       end
  1189.       if imgui.Checkbox(u8'Отображение 3 лвл`а', Move3lvlAdm) then
  1190.         data = LIP.load('moonloader\\config\\RodinaTools\\'..nameINI);
  1191.         if data.AdmChecker.Move3lvlAdm then
  1192.           data.AdmChecker.Move3lvlAdm = false
  1193.           LIP.save('moonloader\\config\\RodinaTools\\'..nameINI, data);
  1194.         else
  1195.           data.AdmChecker.Move3lvlAdm = true
  1196.           LIP.save('moonloader\\config\\RodinaTools\\'..nameINI, data);
  1197.         end
  1198.       end
  1199.       if imgui.Checkbox(u8'Отображение 4 лвл`а', Move4lvlAdm) then
  1200.         data = LIP.load('moonloader\\config\\RodinaTools\\'..nameINI);
  1201.         if data.AdmChecker.Move4lvlAdm then
  1202.           data.AdmChecker.Move4lvlAdm = false
  1203.           LIP.save('moonloader\\config\\RodinaTools\\'..nameINI, data);
  1204.         else
  1205.           data.AdmChecker.Move4lvlAdm = true
  1206.           LIP.save('moonloader\\config\\RodinaTools\\'..nameINI, data);
  1207.         end
  1208.       end
  1209.       if imgui.Checkbox(u8'Отображение 5 лвл`а', Move5lvlAdm) then
  1210.         data = LIP.load('moonloader\\config\\RodinaTools\\'..nameINI);
  1211.         if data.AdmChecker.Move5lvlAdm then
  1212.           data.AdmChecker.Move5lvlAdm = false
  1213.           LIP.save('moonloader\\config\\RodinaTools\\'..nameINI, data);
  1214.         else
  1215.           data.AdmChecker.Move5lvlAdm = true
  1216.           LIP.save('moonloader\\config\\RodinaTools\\'..nameINI, data);
  1217.         end
  1218.       end
  1219.       if imgui.Checkbox(u8'Отображение 6 лвл`а', Move6lvlAdm) then
  1220.         data = LIP.load('moonloader\\config\\RodinaTools\\'..nameINI);
  1221.         if data.AdmChecker.Move6lvlAdm then
  1222.           data.AdmChecker.Move6lvlAdm = false
  1223.           LIP.save('moonloader\\config\\RodinaTools\\'..nameINI, data);
  1224.         else
  1225.           data.AdmChecker.Move6lvlAdm = true
  1226.           LIP.save('moonloader\\config\\RodinaTools\\'..nameINI, data);
  1227.         end
  1228.       end
  1229.       imgui.EndChild()
  1230.       imgui.EndGroup()
  1231.     end
  1232.     if tab[2] == true then
  1233.         imgui.BeginGroup()
  1234.         imgui.Text(u8"Рекон Хелпер")
  1235.         imgui.Separator()
  1236.         if imgui.ToggleButton(u8("##554479548"), recon_turn) then
  1237.           data = LIP.load('moonloader\\config\\RodinaTools\\'..nameINI);
  1238.           if data.ReconHelper.turn then
  1239.             recon_statustextmenu = "Выключено"
  1240.             data.ReconHelper.turn = false
  1241.             LIP.save('moonloader\\config\\RodinaTools\\'..nameINI, data);
  1242.             sampSendChat("/reoff")
  1243.           else
  1244.             recon_statustextmenu = "Включено"
  1245.             data.ReconHelper.turn = true
  1246.             LIP.save('moonloader\\config\\RodinaTools\\'..nameINI, data);
  1247.           end
  1248.         end
  1249.         imgui.SameLine(30)
  1250.         imgui.Text(u8(recon_statustextmenu))
  1251.         imgui.Separator()
  1252.       imgui.EndGroup()
  1253.     end
  1254.   imgui.End()
  1255. end
  1256. if recon_status and data.ReconHelper.turn then
  1257.     delrec()
  1258.     RPx, RPy = getScreenResolution()
  1259.    
  1260.     -- 218 - Без кара с рангом
  1261.     -- 198 - без кара и без ранга
  1262.     -- 400 - с каром и без ранга
  1263.     -- 420 - с каром и рангом
  1264.     resultCheckPL, hendlPLcheck = sampGetCharHandleBySampPlayerId(recon_ID)
  1265.     if resultCheckPL and isCharInAnyCar(hendlPLcheck) then
  1266.         if recon_rangCheck then
  1267.             Ycord = 307
  1268.         else
  1269.             Ycord = 287
  1270.         end
  1271.     else
  1272.         if recon_rangCheck then
  1273.             Ycord = 218
  1274.         else
  1275.             Ycord = 198
  1276.         end
  1277.     end
  1278.     imgui.SetNextWindowPos(imgui.ImVec2(RPx - 320, RPy - Ycord), imgui.ImVec2(0.5, 0.5))
  1279.     imgui.SetNextWindowSize(imgui.ImVec2(320, Ycord))
  1280.     imgui.Begin(u8("##reCON3"), _, imgui.WindowFlags.NoCollapse + imgui.WindowFlags.NoResize + imgui.WindowFlags.NoMove + imgui.WindowFlags.NoBringToFrontOnFocus + imgui.WindowFlags.NoSavedSettings + imgui.WindowFlags.NoTitleBar)
  1281.  
  1282.     if recon_nickname and recon_ID and recon_HP and recon_ARM and recon_lvl and recon_ping and recon_gun and recon_ammo and recon_money and recon_bankmoney and recon_deposit and recon_warns then
  1283.         imgui.SameLine(90)
  1284.         imgui.Text(u8(recon_nickname.." ["..recon_ID.."]"))
  1285.         imgui.Columns(4)
  1286.         imgui.Separator()
  1287.         imgui.SetColumnWidth(-1, 80); imgui.Text(u8("Уровень")); imgui.NextColumn()
  1288.         imgui.SetColumnWidth(-1, 75); imgui.Text(u8(recon_lvl)); imgui.NextColumn()
  1289.         imgui.SetColumnWidth(-1, 80); imgui.Text(u8("АФК")); imgui.NextColumn()
  1290.         if sampIsPlayerPaused(recon_ID) then
  1291.             recon_AFK = "Yes"
  1292.         else
  1293.             recon_AFK = "No"
  1294.         end
  1295.         imgui.SetColumnWidth(-1, 75); imgui.Text(u8(recon_AFK)); imgui.NextColumn()
  1296.         imgui.Separator()
  1297.         imgui.SetColumnWidth(-1, 80); imgui.Text(u8("Здоровье")); imgui.NextColumn()
  1298.         imgui.SetColumnWidth(-1, 75); imgui.Text(u8(recon_HP)); imgui.NextColumn()
  1299.         imgui.SetColumnWidth(-1, 80); imgui.Text(u8("Броня")); imgui.NextColumn()
  1300.         imgui.SetColumnWidth(-1, 75); imgui.Text(u8(recon_ARM)); imgui.NextColumn()
  1301.         imgui.Separator()
  1302.         imgui.SetColumnWidth(-1, 80); imgui.Text(u8("Пинг")); imgui.NextColumn()
  1303.         imgui.SetColumnWidth(-1, 75); imgui.Text(u8(recon_ping)); imgui.NextColumn()
  1304.         imgui.SetColumnWidth(-1, 80); imgui.Text(u8("Скин")); imgui.NextColumn()
  1305.         resultskinid, skinID = sampGetPlayerSkin(recon_ID)
  1306.         if not resultskinid then
  1307.             skinID = "-"
  1308.         end
  1309.         imgui.SetColumnWidth(-1, 75); imgui.Text(u8(skinID))
  1310.         imgui.Columns(2)
  1311.         imgui.Separator()
  1312.         imgui.SetColumnWidth(-1, 85); imgui.Text(u8("Оружие/ПТ")); imgui.NextColumn()
  1313.         imgui.SetColumnWidth(-1, 200); imgui.Text(u8(recon_gun.."/"..recon_ammo)); imgui.NextColumn()
  1314.         imgui.Separator()
  1315.         imgui.SetColumnWidth(-1, 80); imgui.Text(u8("Фракция")); imgui.NextColumn()
  1316.         if not recon_org then
  1317.             recon_org = "Не известно"
  1318.         end
  1319.         imgui.SetColumnWidth(-1, 270); imgui.Text(u8(recon_org)); imgui.NextColumn()
  1320.         imgui.Columns(1)
  1321.         if recon_rangCheck then
  1322.         imgui.Columns(2)
  1323.         imgui.Separator()
  1324.         imgui.SetColumnWidth(-1, 80); imgui.Text(u8("Ранг")); imgui.NextColumn()
  1325.         imgui.SetColumnWidth(-1, 270); imgui.Text(u8(recon_rangTitle.." ("..recon_rangNumber..")")); imgui.NextColumn()
  1326.         imgui.Columns(1)
  1327.         end
  1328.         resultFootSpeed, pedSpeed = sampGetCharHandleBySampPlayerId(recon_ID)
  1329.         if resultFootSpeed and not isCharInAnyCar(pedSpeed) then
  1330.             footSpeed = tostring(math.floor(getCharSpeed(pedSpeed)))
  1331.         else
  1332.             footSpeed = "-"
  1333.         end
  1334.         imgui.Columns(4)
  1335.         imgui.Separator()
  1336.         imgui.SetColumnWidth(-1, 80); imgui.Text(u8("Speed Foot")); imgui.NextColumn()
  1337.         imgui.SetColumnWidth(-1, 80); imgui.Text(u8(footSpeed)); imgui.NextColumn()
  1338.         imgui.SetColumnWidth(-1, 75); imgui.Text(u8("Warns")); imgui.NextColumn()
  1339.         imgui.SetColumnWidth(-1, 80); imgui.Text(u8(recon_warns)); imgui.NextColumn()
  1340.         imgui.Columns(3)
  1341.         imgui.Separator()
  1342.         imgui.SetColumnWidth(-1, 106); imgui.CenterColumnText(u8("На руках:")); imgui.NextColumn()
  1343.         imgui.SetColumnWidth(-1, 106); imgui.CenterColumnText(u8("Банк:")); imgui.NextColumn()
  1344.         imgui.SetColumnWidth(-1, 106); imgui.CenterColumnText(u8("Депозит:")); imgui.NextColumn()
  1345.         imgui.SetColumnWidth(-1, 106); imgui.CenterColumnText(u8(recon_money)); imgui.NextColumn()
  1346.         imgui.SetColumnWidth(-1, 106); imgui.CenterColumnText(u8(recon_bankmoney)); imgui.NextColumn()
  1347.         imgui.SetColumnWidth(-1, 106); imgui.CenterColumnText(u8(recon_deposit)); imgui.NextColumn()
  1348.         imgui.Columns(1)
  1349.         imgui.Separator()
  1350.     else
  1351.         recon_nickname = "-"
  1352.         recon_ID = "-"
  1353.         recon_HP = "-"
  1354.         recon_ARM = "-"
  1355.         recon_lvl = "-"
  1356.         recon_gun = 0
  1357.         recon_ammo = "-"
  1358.         recon_money = "-"
  1359.         recon_bankmoney = "-"
  1360.         recon_ping = "-"
  1361.         recon_deposit = "-"
  1362.         recon_warns = "-"
  1363.     end
  1364.     resultcar, hendlPL = sampGetCharHandleBySampPlayerId(recon_ID)
  1365.     if resultcar and isCharInAnyCar(hendlPL) then
  1366.         footSpeed = "InCar"
  1367.         carHandle = storeCarCharIsInNoSave(hendlPL)
  1368.         carType = getCarModel(carHandle)
  1369.         resultIDCAR, idCAR = sampGetVehicleIdByCarHandle(carHandle)
  1370.         if not resultIDCAR then
  1371.             idCAR = "-"
  1372.         end
  1373.         VehName = getCarName(carType)
  1374.         if VehName and recon_statusENG and recon_vSpeed and recon_vHP and recon_fuel then
  1375.         imgui.NewLine()
  1376.         imgui.SameLine(115)
  1377.         imgui.Text(u8(VehName))
  1378.         imgui.Columns(4)
  1379.         imgui.Separator()
  1380.         imgui.SetColumnWidth(-1, 80); imgui.Text(u8("ID машины")); imgui.NextColumn()
  1381.         imgui.SetColumnWidth(-1, 75); imgui.Text(u8(idCAR)); imgui.NextColumn()
  1382.         imgui.SetColumnWidth(-1, 80); imgui.Text(u8("Двигатель")); imgui.NextColumn()
  1383.         imgui.SetColumnWidth(-1, 75); imgui.Text(u8(recon_statusENG)); imgui.NextColumn()
  1384.         imgui.Separator()
  1385.         imgui.SetColumnWidth(-1, 80); imgui.Text(u8("Скорость")); imgui.NextColumn()
  1386.         imgui.SetColumnWidth(-1, 75); imgui.Text(u8(recon_vSpeed)); imgui.NextColumn()
  1387.         imgui.SetColumnWidth(-1, 80); imgui.Text(u8("ХП машины")); imgui.NextColumn()
  1388.         imgui.SetColumnWidth(-1, 75); imgui.Text(u8(recon_vHP))
  1389.         imgui.Columns(2)
  1390.         imgui.Separator()
  1391.         imgui.SetColumnWidth(-1, 80); imgui.Text(u8("Бензин")); imgui.NextColumn()
  1392.         imgui.SetColumnWidth(-1, 75); imgui.Text(u8(recon_fuel.." литров")); imgui.NextColumn()
  1393.         imgui.Columns(1)
  1394.         imgui.Separator()
  1395.         else
  1396.             VehName = "-"
  1397.             recon_statusENG = "-"
  1398.             recon_vSpeed = "-"
  1399.             recon_vHP = "-"
  1400.             recon_fuel = "-"
  1401.         end
  1402.     end
  1403.     if not sampIsDialogActive() then
  1404.         reconpanel()
  1405.     end
  1406.     if sampIsScoreboardOpen() or sampIsChatInputActive() or sampIsDialogActive() then
  1407.         imgui.CaptureMouseFromApp(false)
  1408.     end
  1409.     if hide_imguiCursor then
  1410.         lua_thread.create(function ()
  1411.             wait(100)
  1412.             imgui.ShowCursor = false
  1413.             hide_imguiCursor = false
  1414.         end)
  1415.     end
  1416.         imgui.End()
  1417.  
  1418.         --reconpanel1()
  1419. end
  1420. end
  1421.  
  1422. function reconpanel()
  1423.     RPxPanel, RPyPanel = getScreenResolution()
  1424.     sizeX_reconPanel = 430
  1425.     imgui.SetNextWindowPos(imgui.ImVec2(RPxPanel / 2 - 223, RPyPanel / 1.238), imgui.ImVec2(0.5, 0.5))
  1426.     imgui.SetNextWindowSize(imgui.ImVec2(sizeX_reconPanel, 96))
  1427.     imgui.Begin(u8("##reconPanel2"), _, imgui.WindowFlags.NoCollapse + imgui.WindowFlags.NoResize + imgui.WindowFlags.NoMove + imgui.WindowFlags.NoBringToFrontOnFocus + imgui.WindowFlags.NoTitleBar + imgui.WindowFlags.NoSavedSettings)
  1428.     --imgui.PushStyleVar(imgui.StyleVar.ItemSpacing, imgui.ImVec2(1, 2.5))
  1429.     xCord_back = sizeX_reconPanel / 2 - 50 / 2 - 52
  1430.     xCord_next = sizeX_reconPanel / 2 - 50 / 2 + 52
  1431.     xCord_reoff = sizeX_reconPanel / 2 - 45 / 2
  1432.     imgui.SetCursorPos(imgui.ImVec2(xCord_back, 5))
  1433.     if imgui.Button(u8("<< Back"), imgui.ImVec2(50, 25)) then
  1434.         sampSendChat("/re_prev")
  1435.     end
  1436.     imgui.SetCursorPos(imgui.ImVec2(xCord_reoff, 5))
  1437.     if imgui.Button(u8("REOFF"), imgui.ImVec2(45, 25)) then
  1438.         sampSendChat("/reoff")
  1439.     end
  1440.     imgui.SetCursorPos(imgui.ImVec2(xCord_next, 5))
  1441.     if imgui.Button(u8("Next >>"), imgui.ImVec2(50, 25)) then
  1442.         sampSendChat("/re_next")
  1443.     end
  1444.     imgui.BeginChild('Interaction player', imgui.ImVec2(421, 55), true)
  1445.     if imgui.Button(u8("Stats"), imgui.ImVec2(35, 20)) then
  1446.         sampSendChat("/check "..recon_ID)
  1447.     end
  1448.     imgui.SameLine(45)
  1449.     if imgui.Button(u8("Spawn"), imgui.ImVec2(45, 20)) then
  1450.         sampSendChat("/spplayer "..recon_ID)
  1451.     end
  1452.     imgui.SameLine(96)
  1453.     if imgui.Button(u8("Slap UP"), imgui.ImVec2(48, 20)) then
  1454.         sampSendChat("/slap "..recon_ID.." up")
  1455.     end
  1456.     imgui.SameLine(150)
  1457.     if imgui.Button(u8("Slap DOWN"), imgui.ImVec2(69, 20)) then
  1458.         sampSendChat("/slap "..recon_ID.." down")
  1459.     end
  1460.     imgui.SameLine(225)
  1461.     if imgui.Button(u8("Freeze"), imgui.ImVec2(45, 20)) then
  1462.         sampSendChat("/freeze "..recon_ID)
  1463.     end
  1464.     imgui.SameLine(276)
  1465.     if imgui.Button(u8("UnFreeze"), imgui.ImVec2(60, 20)) then
  1466.         sampSendChat("/unfreeze "..recon_ID)
  1467.     end
  1468.     imgui.SameLine(342)
  1469.     if imgui.Button(u8("setHP"), imgui.ImVec2(38, 20)) then
  1470.         if tonumber(my_lvl_adm) == 1 then
  1471.             sampSendChat("/a /sethp "..recon_ID.." 100")
  1472.         else
  1473.             sampSendChat("/sethp "..recon_ID.." 100")
  1474.         end
  1475.     end
  1476.     imgui.SameLine(386)
  1477.     if imgui.Button(u8("Flip"), imgui.ImVec2(28, 20)) then
  1478.         sampSendChat("/flip "..recon_ID)
  1479.     end
  1480.     if imgui.Button(u8("Goto"), imgui.ImVec2(33, 20)) then
  1481.         sampSendClickTextdraw(recon_TD_DEL + 22)
  1482.     end
  1483.     imgui.SameLine(43)
  1484.     if imgui.Button(u8("GetHere"), imgui.ImVec2(52, 20)) then
  1485.         if tonumber(my_lvl_adm) < 2 then
  1486.             SCM("Ваш уровень должен быть выше 1-го.")
  1487.         else
  1488.             lua_thread.create(function ()
  1489.                 sampSendChat("/reoff")
  1490.                 wait(800)
  1491.                 sampSendChat("/gethere "..recon_ID)
  1492.                 SCM("ID: " .. recon_ID .. " телепортирован к вам.")
  1493.             end)
  1494.         end
  1495.     end
  1496.     imgui.SameLine(101)
  1497.     if imgui.Button(u8("WarnLog"), imgui.ImVec2(57, 20)) then
  1498.         sampSendChat("/warnlog_pl "..recon_ID)
  1499.     end
  1500.     imgui.SameLine(164)
  1501.     if imgui.Button(u8("getIP"), imgui.ImVec2(35, 20)) then
  1502.         if tonumber(my_lvl_adm) < 2 then
  1503.             sampSendChat("/a /getip "..recon_ID)
  1504.         else
  1505.             sampSendChat("/getip "..recon_ID)
  1506.             recon_getipCheck = true
  1507.         end
  1508.     end
  1509.     imgui.SameLine(205)
  1510.     if imgui.Button(u8("PgetIP"), imgui.ImVec2(40, 20)) then
  1511.         if tonumber(my_lvl_adm) < 3 then
  1512.             sampSendChat("/a /pgetip "..recon_ID)
  1513.         else
  1514.             sampSendChat("/getip "..recon_ID)
  1515.             recon_PgetipCheck = true
  1516.         end
  1517.     end
  1518.     imgui.SameLine(251)
  1519.     if imgui.Button(u8("PLveh"), imgui.ImVec2(40, 20)) then
  1520.         if tonumber(my_lvl_adm) < 3 then
  1521.             sampSetChatInputEnabled(true)
  1522.             sampSetChatInputText("/a /plveh " .. recon_ID .. " ")
  1523.         else
  1524.             sampSetChatInputEnabled(true)
  1525.             sampSetChatInputText("/plveh " .. recon_ID .. " ")
  1526.         end
  1527.     end
  1528.     imgui.SameLine(297)
  1529.     if imgui.Button(u8("Weap"), imgui.ImVec2(37, 20)) then
  1530.         if tonumber(my_lvl_adm) == 1 then
  1531.             sampSendChat("/a /weap "..recon_ID)
  1532.         else
  1533.             sampSendChat("/weap "..recon_ID)
  1534.             recon_cmdWeap = true
  1535.         end
  1536.     end
  1537.     imgui.SameLine(340)
  1538.     if imgui.Button(u8("Вы тут?"), imgui.ImVec2(48, 20)) then
  1539.         sampSendChat("/checkbot "..recon_ID..", Вы тут?,Нет,Да,Нет")
  1540.         SCM("Вы кинули проверку на игрока "..recon_nickname.." ["..recon_ID.."]")
  1541.     end
  1542.     imgui.SameLine(394)
  1543.     if imgui.Button(u8("AZ"), imgui.ImVec2(22, 20)) then
  1544.         lua_thread.create(function ()
  1545.             sampSendChat("/reoff")
  1546.             wait(400)
  1547.             sampSendChat("/az "..recon_ID)
  1548.             SCM("Вы телепортировали "..recon_nickname.."["..recon_ID.."] в админ зону.")
  1549.         end)
  1550.     end
  1551.     imgui.EndChild()
  1552.     imgui.End()
  1553. end
  1554.  
  1555. ---------------------------UTILS
  1556. function getMyID()
  1557.     _, myID = sampGetPlayerIdByCharHandle(playerPed)
  1558.     return myID
  1559. end
  1560.  
  1561. function SCM(msg)
  1562.     sampAddChatMessage("[RodinaTools] {FFFFFF}"..msg, 0xdeb226)
  1563. end
  1564.  
  1565. function sampGetPlayerIdByNickname(nick)
  1566.     local _, idbynick = sampGetPlayerIdByCharHandle(playerPed)
  1567.  
  1568.     if tostring(nick) == sampGetPlayerNickname(idbynick) then
  1569.         return idbynick
  1570.     end
  1571.  
  1572.     for id = 0, 800, 1 do
  1573.         if sampIsPlayerConnected(id) and sampGetPlayerNickname(id) == tostring(nick) then
  1574.             return id
  1575.         end
  1576.     end
  1577. end
  1578.  
  1579. function imgui.CenterColumnText(text)
  1580.   imgui.SetCursorPosX((imgui.GetColumnOffset() + (imgui.GetColumnWidth() / 2)) - imgui.CalcTextSize(text).x / 2)
  1581.   imgui.Text(text)
  1582. end
  1583.  
  1584. function uu()
  1585.   for i = 0,2 do
  1586.       tab[i] = false
  1587.   end
  1588. end
  1589.  
  1590. function checkStatsPlayerOTHER()
  1591.     if recon_timeCheckComplete <= os.time() then
  1592.     lua_thread.create(function ()
  1593.       wait(1500)
  1594.     if not sampIsDialogActive() and recon_ID ~= -1 and sampIsPlayerConnected(recon_ID) then
  1595.       recon_checkstats = true
  1596.       sampSendChat("/check " .. recon_ID)
  1597.       recon_checkComplete = true
  1598.       recon_timeCheckComplete = os.time() + 1
  1599.     end
  1600.     end)
  1601.   end
  1602. end
  1603.  
  1604. function delrec()
  1605.     -- 787 последний
  1606.     sampTextdrawDelete(recon_TD_DEL)
  1607.     sampTextdrawDelete(recon_TD_DEL + 1)
  1608.     sampTextdrawDelete(recon_TD_DEL + 2)
  1609.     sampTextdrawDelete(recon_TD_DEL + 3)
  1610.     sampTextdrawDelete(recon_TD_DEL + 4)
  1611.     sampTextdrawDelete(recon_TD_DEL + 5)
  1612.     sampTextdrawDelete(recon_TD_DEL + 6)
  1613.     sampTextdrawDelete(recon_TD_DEL + 7)
  1614.     sampTextdrawDelete(recon_TD_DEL + 8)
  1615.     sampTextdrawDelete(recon_TD_DEL + 9)
  1616.     sampTextdrawDelete(recon_TD_DEL + 10)
  1617.     sampTextdrawDelete(recon_TD_DEL + 11)
  1618.     sampTextdrawDelete(recon_TD_DEL + 12)
  1619.     sampTextdrawDelete(recon_TD_DEL + 13)
  1620.     sampTextdrawDelete(recon_TD_DEL + 14)
  1621.     sampTextdrawDelete(recon_TD_DEL + 15)
  1622.     sampTextdrawDelete(recon_TD_DEL + 16)
  1623.     sampTextdrawDelete(recon_TD_DEL + 17)
  1624.     sampTextdrawDelete(recon_TD_DEL + 18)
  1625.     sampTextdrawDelete(recon_TD_DEL + 19)
  1626.     sampTextdrawDelete(recon_TD_DEL + 20)
  1627.     sampTextdrawDelete(recon_TD_DEL + 21)
  1628.     sampTextdrawDelete(recon_TD_DEL + 22)
  1629.     sampTextdrawDelete(recon_TD_DEL + 23)
  1630.     sampTextdrawDelete(recon_TD_DEL + 24)
  1631.     sampTextdrawDelete(recon_TD_DEL + 25)
  1632.     sampTextdrawDelete(recon_TD_dop)
  1633.     sampTextdrawDelete(recon_TD_nickname)
  1634.     sampTextdrawDelete(recon_TD_main)
  1635. end
  1636.  
  1637. function sampGetPlayerSkin(id)
  1638.     if not id or not sampIsPlayerConnected(tonumber(id)) and not tonumber(id) == select(2, sampGetPlayerIdByCharHandle(PLAYER_PED)) then return false end
  1639.     local isLocalPlayer = tonumber(id) == select(2, sampGetPlayerIdByCharHandle(PLAYER_PED))
  1640.     local result, handle = sampGetCharHandleBySampPlayerId(tonumber(id))
  1641.     if not result and not isLocalPlayer then return false end
  1642.     local skinid = getCharModel(isLocalPlayer and PLAYER_PED or handle)
  1643.     if skinid < 0 or skinid > 311 then return false end
  1644.     return true, skinid
  1645. end
  1646.  
  1647. function getCarName(TypeCar)
  1648.   if type(TypeCar) ~= "number" then
  1649.     return "No valid car id"
  1650.   end
  1651.  
  1652.   if TypeCar < 400 or TypeCar > 611 then
  1653.     return "No valid car id"
  1654.   end
  1655.  
  1656.   return CarName[TypeCar - 399]
  1657. end
  1658.  
  1659. function goupdate()
  1660.     SCM("Обнаружено обновление, загружаю новую версию. Использование скриптов AutoReload и AutoReboot будут конфликтовать")
  1661.     SCM("Текущая версия: "..thisScript().version..". Новая версия: "..version)
  1662.     print("[LOG] Производится обновление скрипта. Текущая версия: "..thisScript().version..". Новая версия: "..version)
  1663.     wait(300)
  1664.     downloadUrlToFile(updatelink, thisScript().path, function(id3, status1, p13, p23) -- качает ваш файлик с latest version
  1665.         if status1 == dlstatus.STATUS_ENDDOWNLOADDATA then
  1666.             SCM("Обновление завершено, перезагружаю..")
  1667.             print("[LOG] Обновление завершено.")
  1668.             thisScript():reload()
  1669.         end
  1670.     end)
  1671. end
  1672.  
  1673. function update()
  1674.   local Updatefpath = os.getenv('TEMP') .. '\\check_UPD_RodinaTools.json'
  1675.   downloadUrlToFile('https://raw.githubusercontent.com/Glade412/RodinaToolsADM/master/autoupdate.json', Updatefpath, function(id, status, p1, p2)
  1676.     if status == dlstatus.STATUS_ENDDOWNLOADDATA then
  1677.     local f = io.open(Updatefpath, 'r')
  1678.     if f then
  1679.       local Updateinfo = decodeJson(f:read('*a'))
  1680.       updatelink = Updateinfo.updateurl
  1681.       if Updateinfo and Updateinfo.latest then
  1682.         version = tonumber(Updateinfo.latest) -- переводит версию в число
  1683.         if version > tonumber(thisScript().version) then -- если версия больше чем версия установленная то...
  1684.           lua_thread.create(goupdate) -- апдейт
  1685.         else -- если меньше, то
  1686.           print("[LOG] Используется актуальная версия - "..thisScript().version)
  1687.           update_ok = true
  1688.         end
  1689.       end
  1690.     end
  1691.   end
  1692. end)
  1693. end
  1694. -----------------------------------
  1695.  
  1696. function LIP.load(fileName)
  1697.     assert(type(fileName) == 'string', 'Parameter "fileName" must be a string.');
  1698.     local file = assert(io.open(fileName, 'r'), 'Error loading file : ' .. fileName);
  1699.     local data = {};
  1700.     local section;
  1701.     for line in file:lines() do
  1702.         local tempSection = line:match('^%[([^%[%]]+)%]$');
  1703.         if(tempSection)then
  1704.             section = tonumber(tempSection) and tonumber(tempSection) or tempSection;
  1705.             data[section] = data[section] or {};
  1706.         end
  1707.         local param, value = line:match('^([%w|_]+)%s-=%s-(.+)$');
  1708.         if(param and value ~= nil)then
  1709.             if(tonumber(value))then
  1710.                 value = tonumber(value);
  1711.             elseif(value == 'true')then
  1712.                 value = true;
  1713.             elseif(value == 'false')then
  1714.                 value = false;
  1715.             end
  1716.             if(tonumber(param))then
  1717.                 param = tonumber(param);
  1718.             end
  1719.             data[section][param] = value;
  1720.         end
  1721.     end
  1722.     file:close();
  1723.     return data;
  1724. end
  1725.  
  1726. function LIP.save(fileName, data)
  1727.     assert(type(fileName) == 'string', 'Parameter "fileName" must be a string.');
  1728.     assert(type(data) == 'table', 'Parameter "data" must be a table.');
  1729.     local file = assert(io.open(fileName, 'w+b'), 'Error loading file :' .. fileName);
  1730.     local contents = '';
  1731.     for section, param in pairs(data) do
  1732.         contents = contents .. ('[%s]\n'):format(section);
  1733.         for key, value in pairs(param) do
  1734.             contents = contents .. ('%s=%s\n'):format(key, tostring(value));
  1735.         end
  1736.         contents = contents .. '\n';
  1737.     end
  1738.     file:write(contents);
  1739.     file:close();
  1740. end
  1741.  
  1742. return LIP;
Add Comment
Please, Sign In to add comment