Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.21 KB | None | 0 0
  1. require "lib.sampfuncs"
  2. require "lib.moonloader"
  3. local sampev = require 'lib.samp.events'
  4. local imgui = require 'imgui'
  5. local encoding = require 'encoding'
  6.  
  7. encoding.default = 'CP1251'
  8. u8 = encoding.UTF8
  9.  
  10. imgui.SwitchContext()
  11. local style = imgui.GetStyle()
  12. local colors = style.Colors
  13. local clr = imgui.Col
  14. local ImVec4 = imgui.ImVec4
  15.  
  16. colors[clr.Text] = ImVec4(0.00, 0.00, 0.00, 0.51)
  17. colors[clr.TextDisabled] = ImVec4(0.24, 0.24, 0.24, 1.00)
  18. colors[clr.WindowBg] = ImVec4(1.00, 1.00, 1.00, 1.00)
  19. colors[clr.ChildWindowBg] = ImVec4(0.96, 0.96, 0.96, 1.00)
  20. colors[clr.PopupBg] = ImVec4(0.92, 0.92, 0.92, 1.00)
  21. colors[clr.Border] = ImVec4(0.86, 0.86, 0.86, 1.00)
  22. colors[clr.BorderShadow] = ImVec4(0.00, 0.00, 0.00, 0.00)
  23. colors[clr.FrameBg] = ImVec4(0.88, 0.88, 0.88, 1.00)
  24. colors[clr.FrameBgHovered] = ImVec4(0.82, 0.82, 0.82, 1.00)
  25. colors[clr.FrameBgActive] = ImVec4(0.76, 0.76, 0.76, 1.00)
  26. colors[clr.TitleBg] = ImVec4(0.00, 0.45, 1.00, 0.82)
  27. colors[clr.TitleBgCollapsed] = ImVec4(0.00, 0.45, 1.00, 0.82)
  28. colors[clr.TitleBgActive] = ImVec4(0.00, 0.45, 1.00, 0.82)
  29. colors[clr.MenuBarBg] = ImVec4(0.00, 0.37, 0.78, 1.00)
  30. colors[clr.ScrollbarBg] = ImVec4(0.00, 0.00, 0.00, 0.00)
  31. colors[clr.ScrollbarGrab] = ImVec4(0.00, 0.35, 1.00, 0.78)
  32. colors[clr.ScrollbarGrabHovered] = ImVec4(0.00, 0.33, 1.00, 0.84)
  33. colors[clr.ScrollbarGrabActive] = ImVec4(0.00, 0.31, 1.00, 0.88)
  34. colors[clr.ComboBg] = ImVec4(0.92, 0.92, 0.92, 1.00)
  35. colors[clr.CheckMark] = ImVec4(0.00, 0.49, 1.00, 0.59)
  36. colors[clr.SliderGrab] = ImVec4(0.00, 0.49, 1.00, 0.59)
  37. colors[clr.SliderGrabActive] = ImVec4(0.00, 0.39, 1.00, 0.71)
  38. colors[clr.Button] = ImVec4(0.00, 0.49, 1.00, 0.59)
  39. colors[clr.ButtonHovered] = ImVec4(0.00, 0.49, 1.00, 0.71)
  40. colors[clr.ButtonActive] = ImVec4(0.00, 0.49, 1.00, 0.78)
  41. colors[clr.Header] = ImVec4(0.00, 0.49, 1.00, 0.78)
  42. colors[clr.HeaderHovered] = ImVec4(0.00, 0.49, 1.00, 0.71)
  43. colors[clr.HeaderActive] = ImVec4(0.00, 0.49, 1.00, 0.78)
  44. colors[clr.ResizeGrip] = ImVec4(0.00, 0.39, 1.00, 0.59)
  45. colors[clr.ResizeGripHovered] = ImVec4(0.00, 0.27, 1.00, 0.59)
  46. colors[clr.ResizeGripActive] = ImVec4(0.00, 0.25, 1.00, 0.63)
  47. colors[clr.CloseButton] = ImVec4(0.00, 0.35, 0.96, 0.71)
  48. colors[clr.CloseButtonHovered] = ImVec4(0.00, 0.31, 0.88, 0.69)
  49. colors[clr.CloseButtonActive] = ImVec4(0.00, 0.25, 0.88, 0.67)
  50. colors[clr.PlotLines] = ImVec4(0.00, 0.39, 1.00, 0.75)
  51. colors[clr.PlotLinesHovered] = ImVec4(0.00, 0.39, 1.00, 0.75)
  52. colors[clr.PlotHistogram] = ImVec4(0.00, 0.39, 1.00, 0.75)
  53. colors[clr.PlotHistogramHovered] = ImVec4(0.00, 0.35, 0.92, 0.78)
  54. colors[clr.TextSelectedBg] = ImVec4(0.00, 0.47, 1.00, 0.59)
  55. colors[clr.ModalWindowDarkening] = ImVec4(0.20, 0.20, 0.20, 0.35)
  56.  
  57. local Deagle_state = imgui.ImBool(false)
  58. local M4_state = imgui.ImBool(false)
  59. local Rpg_state = imgui.ImBool(false)
  60. local Shotgun_state = imgui.ImBool(false)
  61. local Mp5_state = imgui.ImBool(false)
  62. local Ak47_state = imgui.ImBool(false)
  63. local slider1 = imgui.ImBool(false)
  64.  
  65. local main_window_state = imgui.ImBool(false)
  66. local text_buffer = imgui.ImBuffer(256)
  67.  
  68. local doHide = true
  69. local working = false
  70.  
  71. imgui.Process = false
  72.  
  73. function cmd_imgui(arg)
  74. main_window_state.v = not main_window_state.v
  75. imgui.Process = main_window_state.v
  76. end
  77.  
  78. function imgui.OnDrawFrame()
  79. imgui.SetNextWindowSize(imgui.ImVec2(250, 300), imgui.Cond.FirstUseEver)
  80. imgui.Begin(u8"TR - Настройки", main_window_state)
  81. imgui.Text(u8"Выбор оружия")
  82. imgui.Text(u8" ")
  83. imgui.Checkbox("Deagle", Deagle_state)
  84. imgui.Checkbox("M4", M4_state)
  85. imgui.Checkbox("Ak47", Ak47_state)
  86. imgui.Checkbox("Shotgun", Shotgun_state)
  87. imgui.Checkbox("Rpg", Rpg_state)
  88. imgui.Checkbox("Mp5", Mp5_state)
  89. imgui.End()
  90. end
  91.  
  92. function main()
  93. while not isSampAvailable() do wait(0) end
  94. main_window_stat = false
  95. sampAddChatMessage("Скрипт tr запущен. Автор P0M61KxMUERTOS. Активация - /tr.", -1)
  96. sampRegisterChatCommand("tr", function()
  97. working = not working
  98. if working then
  99. whielka = 1
  100. sampAddChatMessage("tr by P0M61K - ON", -1)
  101. else
  102. whielka = 0
  103. sampAddChatMessage("tr by P0M61K - OFF", -1)
  104. end
  105. end)
  106.  
  107. sampRegisterChatCommand("trmenu", cmd_imgui)
  108.  
  109. function sampev.onSendSpawn()
  110. doHide = true
  111. end
  112.  
  113. while true do wait(0)
  114. if main_window_state.v == false then
  115. imgui.Process = false
  116. end
  117.  
  118. if whielka == 1 then
  119. if doHide and getCharHealth(PLAYER_PED) < 50 then
  120. if deagle_state.v then
  121. sampAddChatMessage("Deagle", -1)
  122. end
  123.  
  124. if m4_state.v then
  125. sampAddChatMessage("M4", -1)
  126. end
  127.  
  128. if shotgun_state.v then
  129. sampAddChatMessage("Shotgun", -1)
  130. end
  131.  
  132. if rpg_state.v then
  133. sampAddChatMessage("Rpg", -1)
  134. end
  135.  
  136. if mp5_state.v then
  137. sampAddChatMessage("Mp5", -1)
  138. end
  139.  
  140. if ak47_state.v then
  141. sampAddChatMessage("ak47", -1)
  142. end
  143.  
  144. doHide = false
  145. end
  146. end
  147. end
  148. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement