Advertisement
Guest User

Untitled

a guest
Aug 21st, 2019
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.82 KB | None | 0 0
  1. script_version(10)
  2.  
  3. local imgui = require 'imgui'
  4. local encoding = require 'encoding'
  5. local inicfg = require 'inicfg'
  6. local hook = require 'lib.samp.events'
  7. encoding.default = 'CP1251'
  8. u8 = encoding.UTF8
  9.  
  10. local mainIni = inicfg.load({
  11. config =
  12. {
  13. lic = false,
  14. trade = false,
  15. tlf = false,
  16. arm = false,
  17. msk = false,
  18. smk = false,
  19. time = false,
  20. lock = false,
  21. jlock = false,
  22. fcar = false,
  23. recar = false,
  24. key = false,
  25. vr = false,
  26. aut = false,
  27. abc = false,
  28. acd = false,
  29. mbc = false,
  30. at = false,
  31. act = false,
  32. waitb = 10000,
  33. zz = false,
  34. pizza = false,
  35. vip = false,
  36. drugs = false,
  37. flood = false,
  38. olock = false,
  39. chatsms = " ",
  40. rtsms = " ",
  41. famsms = " ",
  42. smsbc = " ",
  43. smsvip = " ",
  44. chasi = " "
  45. }
  46. }, "ARZ Helper")
  47.  
  48. local lic = imgui.ImBool(mainIni.config.lic)
  49. local trade = imgui.ImBool(mainIni.config.trade)
  50. local tlf = imgui.ImBool(mainIni.config.tlf)
  51. local arm = imgui.ImBool(mainIni.config.arm)
  52. local msk = imgui.ImBool(mainIni.config.msk)
  53. local smk = imgui.ImBool(mainIni.config.smk)
  54. local time = imgui.ImBool(mainIni.config.time)
  55. local lock = imgui.ImBool(mainIni.config.lock)
  56. local jlock = imgui.ImBool(mainIni.config.jlock)
  57. local fcar = imgui.ImBool(mainIni.config.fcar)
  58. local recar = imgui.ImBool(mainIni.config.recar)
  59. local key = imgui.ImBool(mainIni.config.key)
  60. local vr = imgui.ImBool(mainIni.config.vr)
  61. local aut = imgui.ImBool(mainIni.config.aut)
  62. local abc = imgui.ImBool(mainIni.config.abc)
  63. local zz = imgui.ImBool(mainIni.config.zz)
  64. local waitb = imgui.ImInt(mainIni.config.waitb)
  65. local olock = imgui.ImBool(mainIni.config.olock)
  66. local acd = imgui.ImBool(mainIni.config.acd)
  67. local pizza = imgui.ImBool(mainIni.config.pizza)
  68. local at = imgui.ImBool(mainIni.config.at)
  69. local flood = imgui.ImBool(mainIni.config.flood)
  70. local vip = imgui.ImBool(mainIni.config.vip)
  71. local drugs = imgui.ImBool(mainIni.config.drugs)
  72. local smsbc = imgui.ImBuffer(''..mainIni.config.smsbc, 500)
  73. local chatsms = imgui.ImBuffer(''..mainIni.config.chatsms, 500)
  74. local rtsms = imgui.ImBuffer(''..mainIni.config.rtsms, 500)
  75. local famsms = imgui.ImBuffer(''..mainIni.config.famsms, 500)
  76. local smsvip = imgui.ImBuffer(''..mainIni.config.smsvip, 500)
  77. local chasi = imgui.ImBuffer(''..mainIni.config.chasi, 500)
  78. local mbc = imgui.ImBool(mainIni.config.mbc)
  79.  
  80. local status = inicfg.load(mainIni, 'ARZ Helper.ini')
  81. if not doesFileExist('moonloader/config/ARZ Helper.ini') then inicfg.save(mainIni, 'ARZ Helper.ini') end
  82.  
  83. local main_window_state = imgui.ImBool(false)
  84. function imgui.OnDrawFrame()
  85. imgui.ShowCursor = main_window_state.v
  86. if main_window_state.v then
  87. imgui.SetNextWindowSize(imgui.ImVec2(700, 520), imgui.Cond.FirstUseEver)
  88. if not window_pos then
  89. ScreenX, ScreenY = getScreenResolution()ScreenX, ScreenY = getScreenResolution()
  90. imgui.SetNextWindowPos(imgui.ImVec2(ScreenX / 2 , ScreenY / 2), imgui.Cond.FirsUseEver, imgui.ImVec2(0.5, 0.5))
  91. end
  92. imgui.Begin('By Fyger | ARZ Helper', main_window_state, imgui.WindowFlags.NoResize + imgui.WindowFlags.NoCollapse + imgui.WindowFlags.NoScrollbar)
  93. imgui.Text(u8"VK Author: @mq228_suqa1488 | Сокращенные команды: /findihouse - /fh, /findibiz - /fbiz")
  94. imgui.BeginChild("##g_sexbar", imgui.ImVec2(300, 120), true, imgui.WindowFlags.NoScrollbar)
  95. imgui.Checkbox(u8"Показ скилов ближайшему игроку", lic)
  96. imgui.SameLine()
  97. imgui.TextQuestion(u8'При нажатии клавиш ALT + 1 вы покажите лицензии ближайшему игроку')
  98. imgui.Checkbox(u8"Торговля ближайшему игроку", trade)
  99. imgui.SameLine()
  100. imgui.TextQuestion(u8'При нажатии клавиш ALT + 2 вы предложите торговлю ближайшему игроку')
  101. imgui.Checkbox(u8"Телефон", tlf)
  102. imgui.SameLine()
  103. imgui.TextQuestion(u8"При нажатии на клавишу P у вас откроется телефон" )
  104. imgui.SameLine()
  105. imgui.Checkbox(u8"Удаление хуйни", flood)
  106. imgui.SameLine()
  107. imgui.TextQuestion(u8"Данная функция удалит из чата такие сообщения как: пригласите друга, со склада sf выехал матовоз и т.д" )
  108. imgui.EndChild()
  109. imgui.BeginChild("##gay_bar", imgui.ImVec2(300, 120), true, imgui.WindowFlags.NoScrollbar)
  110. imgui.Checkbox(u8"Бронежилет", arm)
  111. imgui.SameLine()
  112. imgui.TextQuestion(u8"При сочетании клавиш ARM у вас появится бронежилет")
  113. imgui.SameLine()
  114. imgui.Checkbox(u8"Titan VIP смс", vip)
  115. imgui.SameLine()
  116. imgui.TextQuestion(u8"Как только какой то игрок купит Титан Вип - скрипт отправит в чат это сообщение")
  117. imgui.Checkbox(u8"Маска", msk)
  118. imgui.SameLine()
  119. imgui.TextQuestion(u8"При сочетании клавиш MASK у вас появится маска")
  120. imgui.SameLine()
  121. imgui.PushItemWidth(170)
  122. imgui.InputText(u8"", smsvip)
  123. imgui.Checkbox(u8"Сигарета", smk)
  124. imgui.SameLine()
  125. imgui.TextQuestion(u8"При сочетании клавиш SMK у вас появится сигарета")
  126. imgui.SameLine()
  127. imgui.Checkbox(u8"Наркотики", drugs)
  128. imgui.SameLine()
  129. imgui.TextQuestion(u8"При сочетании клавиш alt + 1/2/3 (нумпад) вы используете наркотики")
  130. imgui.EndChild()
  131. imgui.BeginChild("##bar_bar", imgui.ImVec2(300, 120), true, imgui.WindowFlags.NoScrollbar)
  132. imgui.Checkbox(u8"Часы", time)
  133. imgui.SameLine()
  134. imgui.PushItemWidth(70)
  135. imgui.InputText(u8"Отыгровка часов", chasi)
  136. imgui.SameLine()
  137. imgui.TextQuestion(u8"При сочетании клавиш EZ вы посмотрите на часы")
  138. imgui.Checkbox(u8"Закрытие транспорта", lock)
  139. imgui.SameLine()
  140. imgui.TextQuestion(u8"При нажатии на клавишу L вы закроете/откроете свой транспорт")
  141. imgui.Checkbox(u8"Закрытие аренды", jlock)
  142. imgui.SameLine()
  143. imgui.TextQuestion(u8"При сочитании клвиш JL вы закроете/откроете свой арендованный транспорт")
  144. imgui.EndChild()
  145. if imgui.Button(u8'Сохранить настройки',imgui.ImVec2(150,65)) then
  146. mainIni.config.lic = lic.v
  147. mainIni.config.trade = trade.v
  148. mainIni.config.tlf = tlf.v
  149. mainIni.config.arm = arm.v
  150. mainIni.config.msk = msk.v
  151. mainIni.config.smk = smk.v
  152. mainIni.config.time = time.v
  153. mainIni.config.lock = lock.v
  154. mainIni.config.jlock = jlock.v
  155. mainIni.config.fcar = fcar.v
  156. mainIni.config.recar = recar.v
  157. mainIni.config.key = key.v
  158. mainIni.config.aut = aut.v
  159. mainIni.config.abc = abc.v
  160. mainIni.config.acd = acd.v
  161. mainIni.config.mbc = mbc.v
  162. mainIni.config.at = at.v
  163. mainIni.config.smsbc = smsbc.v
  164. mainIni.config.chatsms = chatsms.v
  165. mainIni.config.rtsms = rtsms.v
  166. mainIni.config.famsms = famsms.v
  167. mainIni.config.zz = zz.v
  168. mainIni.config.flood = flood.v
  169. mainIni.config.olock = olock.v
  170. mainIni.config.pizza = pizza.v
  171. mainIni.config.vip = vip.v
  172. mainIni.config.smsvip = smsvip.v
  173. mainIni.config.chasi = chasi.v
  174. mainIni.config.drugs = drugs.v
  175. mainIni.config.waitb = waitb.v
  176. inicfg.save(mainIni, 'ARZ Helper.ini')
  177. end
  178. imgui.SetCursorPos(imgui.ImVec2(325, 61))
  179. imgui.BeginChild("##ear_bar", imgui.ImVec2(365, 120), true, imgui.WindowFlags.NoScrollbar)
  180. imgui.Checkbox(u8"Заправить авто", fcar)
  181. imgui.SameLine()
  182. imgui.TextQuestion(u8"При сочитании клвишь CAN вы заправите транспорт используя канистру")
  183. imgui.SameLine()
  184. imgui.Checkbox(u8"Cкип диалога о ЗЗ", zz)
  185. imgui.SameLine()
  186. imgui.TextQuestion(u8"Как только скрипт увидит диалог с текстом •запрещено дратся• - он его пропустит")
  187. imgui.Checkbox(u8"Починить авто", recar)
  188. imgui.SameLine()
  189. imgui.TextQuestion(u8"При сочитании клвишь RECAR вы почините транспорт используя ремкомплект")
  190. imgui.SameLine()
  191. imgui.Checkbox(u8"Cкип диалога о пицце", pizza)
  192. imgui.SameLine()
  193. imgui.TextQuestion(u8"Как только скрипт увидит диалог с текстом •вы успешно положили пиццу• - он его пропустит")
  194. imgui.Checkbox(u8"Ключи от авто", key)
  195. imgui.SameLine()
  196. imgui.TextQuestion(u8"При нажатии на клавиру K вы вставите/заберете ключи")
  197. imgui.SameLine()
  198. imgui.Checkbox(u8"Закрытие орг. т/с", olock)
  199. imgui.SameLine()
  200. imgui.TextQuestion(u8"При сочитании клавиш OL вы откроете/закроете организационный транспорт")
  201. imgui.EndChild()
  202. imgui.SetCursorPos(imgui.ImVec2(325, 189))
  203. imgui.BeginChild("##g_leftbar", imgui.ImVec2(365, 165), true, imgui.WindowFlags.NoScrollbar)
  204. imgui.Checkbox(u8"Авто скип ответа на репорт/мут", aut)
  205. imgui.SameLine()
  206. imgui.TextQuestion(u8"Как только скрипт увидит ответ администратора/диалог с мутом он пропустит диалог")
  207. imgui.Text(u8"Активация: /Piar")
  208. imgui.SameLine()
  209. imgui.SliderInt(u8"Задержка", waitb, 10000, 60000)
  210. imgui.InputText(u8"Реклама в /vr", chatsms)
  211. imgui.InputText(u8"Доп. пиар", rtsms)
  212. imgui.InputText(u8"Доп пиар", famsms)
  213. imgui.EndChild()
  214. imgui.SetCursorPos(imgui.ImVec2(325, 360))
  215. imgui.BeginChild("##g_pftbar", imgui.ImVec2(365, 150), true, imgui.WindowFlags.NoScrollbar)
  216. imgui.Checkbox(u8"Авто закрытие дверей авто", acd)
  217. imgui.SameLine()
  218. imgui.TextQuestion(u8"Как только скрипт увидит что вы словили авто по госсу он автоматически закроет двери авто")
  219. imgui.Checkbox(u8"Сообщение после ловли", mbc)
  220. imgui.SameLine()
  221. imgui.TextQuestion(u8"Это сообщение отправится после ловли")
  222. imgui.InputText(u8"Сообщение", smsbc)
  223. imgui.Checkbox(u8"Авто тайм после ловли", at)
  224. imgui.SameLine()
  225. imgui.TextQuestion(u8"После удачной ловли скрипт сам пропишет /time с отыгровкой")
  226. imgui.EndChild()
  227. imgui.SetCursorPos(imgui.ImVec2(175, 445))
  228. if imgui.Button(u8"Перезагрузить скрипт", imgui.ImVec2(140,65)) then
  229. thisScript():reload()
  230. end
  231. imgui.End()
  232. end
  233. end
  234. function main()
  235. while not isSampAvailable() do wait(0) end
  236. autoupdate("https://www.dropbox.com/s/pjfzgpgu7ndrgem/huita.json?dl=1", '['..string.upper(thisScript().name)..']: ', "https://www.dropbox.com/s/jt5k96otghj3b5g/ARZ_Helper.lua?dl=1")
  237. sampRegisterChatCommand("piar", function()
  238. act = not act; sampAddChatMessage(act and '{01A0E9}Реклама включена!' or '{01A0E9}Реклама выключена!', -1)
  239. if act then
  240. piar()
  241. end
  242. end)
  243. sampRegisterChatCommand("arzh", function()
  244. main_window_state.v = not main_window_state.v
  245. end)
  246. sampRegisterChatCommand("arzobnova",obnova)
  247. sampRegisterChatCommand('fh', function(num)
  248. sampSendChat('/findihouse '..num)
  249. end)
  250. sampRegisterChatCommand('fbiz', function(num)
  251. sampSendChat('/findibiz '..num)
  252. end)
  253. sampAddChatMessage("{01A0E9}[ARZ Helper] {ffffff}Загружен!",-1)
  254. while true do
  255. wait(0)
  256. imgui.Process = main_window_state.v
  257. if lic.v and wasKeyPressed(0x31) and isKeyDown(0x12) then
  258. local veh, ped = storeClosestEntities(PLAYER_PED)
  259. local _, id = sampGetPlayerIdByCharHandle(ped)
  260. if id then
  261. sampSendChat('/showskill '..id)
  262. end
  263. end
  264. if trade.v and wasKeyPressed(0x32) and isKeyDown(0x12) then
  265. local veh, ped = storeClosestEntities(PLAYER_PED)
  266. local _, id = sampGetPlayerIdByCharHandle(ped)
  267. if _ then
  268. sampSendChat('/trade '..id)
  269. end
  270. end
  271. if tlf.v and wasKeyPressed(0x50) and not sampIsCursorActive() then
  272. sampSendChat("/phone")
  273. end
  274. if arm.v then
  275. if testCheat("arm") and not sampIsChatInputActive() then
  276. sampSendChat("/me используя магию надел бронежилет")
  277. sampSendChat("/armour")
  278. end
  279. end
  280. if smk.v then
  281. if testCheat("smk") then
  282. sampSendChat("/smoke")
  283. end
  284. end
  285. if msk.v then
  286. if testCheat("msk") and not sampIsCursorActive() then
  287. sampSendChat("/mask")
  288. end
  289. end
  290. if time.v then
  291. if testCheat("ez") and not sampIsCursorActive() then
  292. sampSendChat(u8:decode(chasi.v))
  293. wait(1200)
  294. sampSendChat("/time")
  295. wait(1200)
  296. sampSendChat ("/do На часах "..os.date('%H:%M:%S'))
  297. end
  298. end
  299. if olock.v and not sampIsCursorActive() then
  300. if testCheat("ol") then
  301. sampSendChat("/olock")
  302. end
  303. end
  304. if jlock.v and not sampIsChatInputActive() then
  305. if testCheat("jl") then
  306. sampSendChat("/jlock")
  307. end
  308. end
  309. if lock.v and not sampIsChatInputActive() then
  310. if testCheat("l") then
  311. sampSendChat("/lock")
  312. end
  313. end
  314. if drugs.v and not sampIsCursorActive() then
  315. if wasKeyPressed(0x61) and isKeyDown(0x12) then
  316. sampSendChat("/usedrugs 1")
  317. end
  318. if wasKeyPressed(0x62) and isKeyDown(0x12) then
  319. sampSendChat("/usedrugs 2")
  320. end
  321. if wasKeyPressed(0x63) and isKeyDown(0x12) then
  322. sampSendChat("/usedrugs 3")
  323. end
  324. end
  325. if fcar.v and not sampIsCursorActive() then
  326. if testCheat("can") then
  327. sampSendChat("/fillcar")
  328. end
  329. end
  330. if recar.v and not sampIsCursorActive() then
  331. if testCheat("recar") then
  332. sampSendChat("/repcar")
  333. end
  334. end
  335. if key.v and not sampIsCursorActive() then
  336. if testCheat("k") then
  337. sampSendChat("/key")
  338. end
  339. end
  340. end
  341. end
  342.  
  343. function hook.onServerMessage(color, text)
  344. if acd.v then
  345. if text:find("Поздравляем! Теперь этот транспорт принадлежит вам!") and not text:find('говорит') and not text:find('- |') then
  346. sampSendChat('/lock')
  347. end
  348. end
  349. if mbc.v then
  350. if text:find("Поздравляем! Теперь этот транспорт принадлежит вам!") or text:find("(.-)Поздравляю! Теперь этот дом ваш!(.-)") then
  351. lua_thread.create(function()
  352. wait(500)
  353. sampSendChat(u8:decode(smsbc.v))
  354. end)
  355. end
  356. end
  357. if at.v then
  358. if text:find("Поздравляем! Теперь этот транспорт принадлежит вам!") or text:find("(.-)Поздравляю! Теперь этот дом ваш!(.-)") and not text:find('говорит') and not text:find('- |') then
  359. lua_thread.create(function()
  360. if mbc.v then
  361. wait(5000)
  362. end
  363. sampSendChat("/me взглянул на часы с гравировкой •Топ ловец•")
  364. sampSendChat("/time")
  365. wait(1200)
  366. sampSendChat ("/do На часах "..os.date('%H:%M:%S'))
  367. end)
  368. end
  369. end
  370. if vip.v then
  371. if text:find 'Игрок (.-) приобрел Titan VIP' and not text:find('говорит') and not text:find('- |') then
  372. sampSendChat(u8:decode(smsvip.v))
  373. end
  374. end
  375. if flood.v then
  376. if text:find("~~~~~~~~~~~~~~~~~~~~~~~~~~") then
  377. return false
  378. end
  379. if text:find("- Основные команды") and not text:find("говорит") then
  380. return false
  381. end
  382. if text:find("- Пригласи друга") and not text:find("говорит") then
  383. return false
  384. end
  385. if text:find("- Донат и получение") and not text:find("говорит") then
  386. return false
  387. end
  388. if text:find("Со склада армии") and not text:find("говорит") then
  389. return false
  390. end
  391. if text:find("Между использованием предметов") and not text:find("говорит") then
  392. return false
  393. end
  394. if text:find("начал работу новый") and not text:find("говорит") then
  395. return false
  396. end
  397. if text:find("вы сможете получить") and not text:find("говорит") then
  398. return false
  399. end
  400. if text:find("выехал матовоз") and not text:find("говорит") then
  401. return false
  402. end
  403. end
  404. end
  405. function hook.onShowDialog(dialogId, dialogStyle, dialogTitle, okButtonText, cancelButtonText, dialogText)
  406. if aut.v then
  407. if dialogText:find("Вы получили бан") then
  408. return false
  409. end
  410. if dialogId == 1333 then
  411. return false
  412. end
  413. if dialogId == 1332 then
  414. return false
  415. end
  416. end
  417. if zz.v then
  418. if dialogText:find("В этом месте запрещено") then
  419. return false
  420. end
  421. end
  422. if pizza.v then
  423. if dialogText:find("Вы успешно положили") then
  424. return false
  425. end
  426. end
  427. if tlf.v then
  428. if dialogId == 1000 then
  429. setVirtualKeyDown(13, false)
  430. end
  431. end
  432. end
  433.  
  434. function piar()
  435. lua_thread.create(function()
  436. if act then
  437. sampSendChat(u8:decode(chatsms.v))
  438. wait(1200)
  439. sampSendChat(u8:decode(rtsms.v))
  440. wait(1200)
  441. sampSendChat(u8:decode(famsms.v))
  442. wait (waitb.v)
  443. return true
  444. end
  445. end)
  446. end
  447. function apply_custom_style()
  448. if not state then
  449. imgui.SwitchContext()
  450. local style = imgui.GetStyle()
  451. local colors = style.Colors
  452. local clr = imgui.Col
  453. local ImVec4 = imgui.ImVec4
  454. local ImVec2 = imgui.ImVec2
  455. style.WindowPadding = ImVec2(15, 15)
  456. style.WindowRounding = 5.0
  457. style.FramePadding = ImVec2(5, 5)
  458. style.FrameRounding = 4.0
  459. style.ItemSpacing = ImVec2(12, 8)
  460. style.ItemInnerSpacing = ImVec2(8, 6)
  461. style.IndentSpacing = 25.0
  462. style.ScrollbarSize = 15.0
  463. style.ScrollbarRounding = 9.0
  464. style.GrabMinSize = 5.0
  465. style.GrabRounding = 3.0
  466.  
  467. colors[clr.Text] = ImVec4(0.80, 0.80, 0.83, 1.00)
  468. colors[clr.TextDisabled] = ImVec4(0.24, 0.23, 0.29, 1.00)
  469. colors[clr.WindowBg] = ImVec4(0.06, 0.05, 0.07, 1.00)
  470. colors[clr.ChildWindowBg] = ImVec4(0.07, 0.07, 0.09, 1.00)
  471. colors[clr.PopupBg] = ImVec4(0.07, 0.07, 0.09, 1.00)
  472. colors[clr.Border] = ImVec4(0.80, 0.80, 0.83, 0.88)
  473. colors[clr.BorderShadow] = ImVec4(0.92, 0.91, 0.88, 0.00)
  474. colors[clr.FrameBg] = ImVec4(0.10, 0.09, 0.12, 1.00)
  475. colors[clr.FrameBgHovered] = ImVec4(0.24, 0.23, 0.29, 1.00)
  476. colors[clr.FrameBgActive] = ImVec4(0.56, 0.56, 0.58, 1.00)
  477. colors[clr.TitleBg] = ImVec4(0.10, 0.09, 0.12, 1.00)
  478. colors[clr.TitleBgCollapsed] = ImVec4(1.00, 0.98, 0.95, 0.75)
  479. colors[clr.TitleBgActive] = ImVec4(0.07, 0.07, 0.09, 1.00)
  480. colors[clr.MenuBarBg] = ImVec4(0.10, 0.09, 0.12, 1.00)
  481. colors[clr.ScrollbarBg] = ImVec4(0.10, 0.09, 0.12, 1.00)
  482. colors[clr.ScrollbarGrab] = ImVec4(0.80, 0.80, 0.83, 0.31)
  483. colors[clr.ScrollbarGrabHovered] = ImVec4(0.56, 0.56, 0.58, 1.00)
  484. colors[clr.ScrollbarGrabActive] = ImVec4(0.06, 0.05, 0.07, 1.00)
  485. colors[clr.ComboBg] = ImVec4(0.19, 0.18, 0.21, 1.00)
  486. colors[clr.CheckMark] = ImVec4(0.80, 0.80, 0.83, 0.31)
  487. colors[clr.SliderGrab] = ImVec4(0.80, 0.80, 0.83, 0.31)
  488. colors[clr.SliderGrabActive] = ImVec4(0.06, 0.05, 0.07, 1.00)
  489. colors[clr.Button] = ImVec4(0.10, 0.09, 0.12, 1.00)
  490. colors[clr.ButtonHovered] = ImVec4(0.24, 0.23, 0.29, 1.00)
  491. colors[clr.ButtonActive] = ImVec4(0.56, 0.56, 0.58, 1.00)
  492. colors[clr.Header] = ImVec4(0.10, 0.09, 0.12, 1.00)
  493. colors[clr.HeaderHovered] = ImVec4(0.56, 0.56, 0.58, 1.00)
  494. colors[clr.HeaderActive] = ImVec4(0.06, 0.05, 0.07, 1.00)
  495. colors[clr.ResizeGrip] = ImVec4(0.00, 0.00, 0.00, 0.00)
  496. colors[clr.ResizeGripHovered] = ImVec4(0.56, 0.56, 0.58, 1.00)
  497. colors[clr.ResizeGripActive] = ImVec4(0.06, 0.05, 0.07, 1.00)
  498. colors[clr.CloseButton] = ImVec4(0.40, 0.39, 0.38, 0.16)
  499. colors[clr.CloseButtonHovered] = ImVec4(0.40, 0.39, 0.38, 0.39)
  500. colors[clr.CloseButtonActive] = ImVec4(0.40, 0.39, 0.38, 1.00)
  501. colors[clr.PlotLines] = ImVec4(0.40, 0.39, 0.38, 0.63)
  502. colors[clr.PlotLinesHovered] = ImVec4(0.25, 1.00, 0.00, 1.00)
  503. colors[clr.PlotHistogram] = ImVec4(0.40, 0.39, 0.38, 0.63)
  504. colors[clr.PlotHistogramHovered] = ImVec4(0.25, 1.00, 0.00, 1.00)
  505. colors[clr.TextSelectedBg] = ImVec4(0.25, 1.00, 0.00, 0.43)
  506. colors[clr.ModalWindowDarkening] = ImVec4(1.00, 0.98, 0.95, 0.73)
  507. end
  508. end
  509. apply_custom_style()
  510.  
  511. function imgui.TextQuestion(text)
  512. imgui.TextDisabled('(?)')
  513. if imgui.IsItemHovered() then
  514. imgui.BeginTooltip()
  515. imgui.PushTextWrapPos(450)
  516. imgui.TextUnformatted(text)
  517. imgui.PopTextWrapPos()
  518. imgui.EndTooltip()
  519. end
  520. end
  521.  
  522. function autoupdate(json_url, prefix, url)
  523. local dlstatus = require('moonloader').download_status
  524. local json = getWorkingDirectory() .. '\\'..thisScript().name..'-version.json'
  525. if doesFileExist(json) then os.remove(json) end
  526. downloadUrlToFile(json_url, json,
  527. function(id, status, p1, p2)
  528. if status == dlstatus.STATUSEX_ENDDOWNLOAD then
  529. if doesFileExist(json) then
  530. local f = io.open(json, 'r')
  531. if f then
  532. local info = decodeJson(f:read('*a'))
  533. updatelink = info.updateurl
  534. updateversion = info.latest
  535. f:close()
  536. os.remove(json)
  537. if updateversion ~= thisScript().version then
  538. lua_thread.create(function(prefix)
  539. local dlstatus = require('moonloader').download_status
  540. local color = -1
  541. sampAddChatMessage((prefix..'Обнаружено обновление. Пытаюсь обновиться c '..thisScript().version..' на '..updateversion), color)
  542. wait(250)
  543. downloadUrlToFile(updatelink, thisScript().path,
  544. function(id3, status1, p13, p23)
  545. if status1 == dlstatus.STATUS_DOWNLOADINGDATA then
  546. print(string.format('Загружено %d из %d.', p13, p23))
  547. elseif status1 == dlstatus.STATUS_ENDDOWNLOADDATA then
  548. print('Загрузка обновления завершена.')
  549. sampAddChatMessage((prefix..'{01A0E9}Обновление завершено!'), color)
  550. sampAddChatMessage((prefix..'Пропишите {01A0E9}/arzobnova {ffffff}что бы узнать подробнее!'), color)
  551. goupdatestatus = true
  552. lua_thread.create(function() wait(500) thisScript():reload() end)
  553. end
  554. if status1 == dlstatus.STATUSEX_ENDDOWNLOAD then
  555. if goupdatestatus == nil then
  556. sampAddChatMessage((prefix..'Обновление прошло неудачно. Запускаю устаревшую версию..'), color)
  557. update = false
  558. end
  559. end
  560. end
  561. )
  562. end, prefix
  563. )
  564. else
  565. update = false
  566. sampAddChatMessage("{01A0E9}[ARZ Helper] {ffffff}Обновление не требуется", -1)
  567. end
  568. end
  569. else
  570. print('v'..thisScript().version..': Не могу проверить обновление. Смиритесь или проверьте самостоятельно на '..url)
  571. update = false
  572. end
  573. end
  574. end
  575. )
  576. while update ~= false do wait(100) end
  577. end
  578. function obnova()
  579. sampAddChatMessage("Добавил закрытие организационного транспорта, и удаление всякой хуйни из чата",-1)
  580. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement