Advertisement
Guest User

Untitled

a guest
Dec 13th, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.90 KB | None | 0 0
  1. local ply = LocalPlayer()
  2. local sw, sh = ScrW(), ScrH()
  3. local Color = Color
  4. local GetGlobalEntity = GetGlobalEntity
  5. local surface_CreateFont = surface.CreateFont
  6. local box = draw.RoundedBox
  7. local draw_SimpleText = draw.SimpleText
  8. local ui = vgui.Create
  9. local hook_Add = hook.Add
  10. local hook_Remove = hook.Remove
  11. local net_Receive = net.Receive
  12. local math_sin = math.sin
  13.  
  14. local rp_col_Black = Color(0,0,0)
  15. local rp_col_White = Color(255,255,255)
  16.  
  17. surface_CreateFont("dn.hitman", {
  18. font = "PCPaintSmallBold",
  19. size = 25,
  20. extended = true,
  21. -- antialias = true,
  22. })
  23.  
  24. local icon = Material('petooh.png')
  25. local function image()
  26. local cin_pos = math_sin( CurTime() * 5 ) * 2
  27. surface.SetMaterial(icon)
  28. surface.SetDrawColor(rp_col_White)
  29. surface.DrawTexturedRect(sw-495, 20-cin_pos, 128, 128)
  30. end
  31.  
  32. local function text(text, x, y, main_color, second_color)
  33. local cin = math_sin( RealTime()+1)*2
  34. local cin_pos = math_sin( CurTime() * 5 ) * 2
  35. draw_SimpleText( text, 'dn.hitman', x+1+cin_pos, y-2-cin_pos, Color(cin * second_color.r, second_color.g, cin * second_color.b), TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP)
  36. draw_SimpleText( text, 'dn.hitman', x+cin_pos, y-cin_pos, Color(main_color.r, cin * main_color.g, main_color.b - (cin * main_color.b)), TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP)
  37. end
  38.  
  39. local fr = nil
  40. local function AddOffer(victim)
  41. if fr and IsValid(fr) then fr:Remove() end
  42.  
  43. fr = ui('DFrame')
  44. fr:SetSize(sw,sh)
  45. fr:ShowCloseButton(false)
  46. fr:SetDraggable(false)
  47. fr:SetTitle('')
  48. fr:Center()
  49. fr.Paint = function(self, w, h)
  50. box( 0, sw-400, 40, 400, 60, rp_col_Black )
  51. text( 'Цель: '..victim:Name(), sw-380, 55, Color( 240, 200, 170, 255 ), Color(100,120,160))
  52. image()
  53. box( 0, sw-150, 102, 150, 75, rp_col_Black )
  54. text( 'Принять?', sw-140, 110, Color( 240, 200, 170, 255 ), Color(100,120,160))
  55. end
  56.  
  57. local btn = ui("DButton", fr)
  58. btn:SetSize(50, 35)
  59. btn:SetPos(sw-140, 135)
  60. btn:SetText("Да")
  61. btn:SetTextColor(Color(0,255,0))
  62. btn:SetFont('dn.hitman')
  63. btn.Paint = function(self, w, h) end
  64. btn.OnCursorEntered = function()
  65. btn:SetTextColor(Color(0,255,0,100))
  66. end
  67. btn.OnCursorExited = function()
  68. btn:SetTextColor(Color(0,255,0))
  69. end
  70. btn.DoClick = function()
  71. net.Start('hit.Accept')
  72. net.WriteEntity(victim)
  73. net.SendToServer()
  74. surface.PlaySound('buttons/lightswitch2.wav')
  75. fr:Close()
  76. end
  77.  
  78. local btn = ui("DButton", fr)
  79. btn:SetSize(50, 35)
  80. btn:SetPos(sw-70, 135)
  81. btn:SetText("Нет")
  82. btn:SetColor(Color(255,0,0))
  83. btn:SetFont('dn.hitman')
  84. btn.Paint = function(self, w, h) end
  85. btn.OnCursorEntered = function()
  86. btn:SetTextColor(Color(255,0,0,100))
  87. end
  88. btn.OnCursorExited = function()
  89. btn:SetTextColor(Color(255,0,0))
  90. end
  91. btn.DoClick = function()
  92. net.Start('hit.Deny')
  93. net.WriteEntity(victim)
  94. net.SendToServer()
  95. surface.PlaySound('buttons/lightswitch2.wav')
  96. fr:Close()
  97. end
  98. end
  99.  
  100. local function HitMenu(victim, active)
  101. local txt = 'Цель: '..victim:Name()
  102.  
  103. fr2 = ui('DFrame')
  104. fr2:SetSize(sw,sh)
  105. fr2:ShowCloseButton(false)
  106. fr2:SetDraggable(false)
  107. fr2:SetTitle('')
  108. fr2:Center()
  109. fr2.Paint = function(self, w, h)
  110. box( 0, sw-400, 40, 400, 60, rp_col_Black )
  111. text( txt, sw-380, 55, Color( 255, 50, 100, 255 ), Color(30,160,100))
  112. image()
  113. end
  114. fr2.Think = function(self)
  115. if not ply.activeHit then
  116. txt = cfg_Jacket_SuccessUI
  117. timer.Simple(6, function() self:Remove() end)
  118. return
  119. end
  120. end
  121. end
  122.  
  123. net_Receive('hit.Active', function(len, pl)
  124. local victim = net.ReadEntity()
  125. local status = net.ReadBool()
  126. ply.activeHit = status
  127.  
  128. if not status then
  129. if fr and IsValid(fr) then fr:Remove() end
  130. if not ply.hotline_mami then return end
  131. hook_Remove("Hitman.Halo")
  132. ply.hotline_mami:Stop()
  133. return
  134. end
  135.  
  136. HitMenu(victim)
  137.  
  138. sound.PlayURL( "http://greenplayservers.ru/content/rytra/hotline_miami_"..math.random(1,6)..".mp3", "mono", function( sound )
  139. if IsValid( sound ) then
  140. sound:SetVolume( 0.3 )
  141. sound:Play()
  142. ply.hotline_mami = sound
  143. end
  144. end)
  145. end)
  146.  
  147. hook_Add("HUDPaint", "Hitman.Hud", function()
  148. if ply.activeHit then
  149. local victim = ply:GetNWEntity('hit.Target')
  150. local pos = victim:GetPos():ToScreen()
  151. text( 'Цель', pos.x-20, pos.y-50, Color( 255, 50, 100, 255 ), Color(30,160,100))
  152. text( 'X', pos.x, pos.y-80, Color( 255, 50, 100, 255 ), Color(30,160,100))
  153. end
  154. end)
  155.  
  156. net_Receive('hit.newOffer', function(l, pl) AddOffer(net.ReadEntity()) end)
  157.  
  158. /*
  159. sound.PlayURL( "http://greenplayservers.ru/content/rytra/hotline_miami_"..table.Random(1,6)..".mp3", "mono", function( sound )
  160. ^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^
  161. https://imgur.com/g7xNfqX
  162.  
  163. ссылка на мой сайт, тк там лежат все треки
  164. это быстрее, чем добавлять их в файлы сервера
  165. (при желании - перенесу все файлы)
  166.  
  167. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement