Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ply = LocalPlayer()
- local sw, sh = ScrW(), ScrH()
- local Color = Color
- local GetGlobalEntity = GetGlobalEntity
- local surface_CreateFont = surface.CreateFont
- local box = draw.RoundedBox
- local draw_SimpleText = draw.SimpleText
- local ui = vgui.Create
- local hook_Add = hook.Add
- local hook_Remove = hook.Remove
- local net_Receive = net.Receive
- local math_sin = math.sin
- local rp_col_Black = Color(0,0,0)
- local rp_col_White = Color(255,255,255)
- surface_CreateFont("dn.hitman", {
- font = "PCPaintSmallBold",
- size = 25,
- extended = true,
- -- antialias = true,
- })
- local icon = Material('petooh.png')
- local function image()
- local cin_pos = math_sin( CurTime() * 5 ) * 2
- surface.SetMaterial(icon)
- surface.SetDrawColor(rp_col_White)
- surface.DrawTexturedRect(sw-495, 20-cin_pos, 128, 128)
- end
- local function text(text, x, y, main_color, second_color)
- local cin = math_sin( RealTime()+1)*2
- local cin_pos = math_sin( CurTime() * 5 ) * 2
- 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)
- 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)
- end
- local fr = nil
- local function AddOffer(victim)
- if fr and IsValid(fr) then fr:Remove() end
- fr = ui('DFrame')
- fr:SetSize(sw,sh)
- fr:ShowCloseButton(false)
- fr:SetDraggable(false)
- fr:SetTitle('')
- fr:Center()
- fr.Paint = function(self, w, h)
- box( 0, sw-400, 40, 400, 60, rp_col_Black )
- text( 'Цель: '..victim:Name(), sw-380, 55, Color( 240, 200, 170, 255 ), Color(100,120,160))
- image()
- box( 0, sw-150, 102, 150, 75, rp_col_Black )
- text( 'Принять?', sw-140, 110, Color( 240, 200, 170, 255 ), Color(100,120,160))
- end
- local btn = ui("DButton", fr)
- btn:SetSize(50, 35)
- btn:SetPos(sw-140, 135)
- btn:SetText("Да")
- btn:SetTextColor(Color(0,255,0))
- btn:SetFont('dn.hitman')
- btn.Paint = function(self, w, h) end
- btn.OnCursorEntered = function()
- btn:SetTextColor(Color(0,255,0,100))
- end
- btn.OnCursorExited = function()
- btn:SetTextColor(Color(0,255,0))
- end
- btn.DoClick = function()
- net.Start('hit.Accept')
- net.WriteEntity(victim)
- net.SendToServer()
- surface.PlaySound('buttons/lightswitch2.wav')
- fr:Close()
- end
- local btn = ui("DButton", fr)
- btn:SetSize(50, 35)
- btn:SetPos(sw-70, 135)
- btn:SetText("Нет")
- btn:SetColor(Color(255,0,0))
- btn:SetFont('dn.hitman')
- btn.Paint = function(self, w, h) end
- btn.OnCursorEntered = function()
- btn:SetTextColor(Color(255,0,0,100))
- end
- btn.OnCursorExited = function()
- btn:SetTextColor(Color(255,0,0))
- end
- btn.DoClick = function()
- net.Start('hit.Deny')
- net.WriteEntity(victim)
- net.SendToServer()
- surface.PlaySound('buttons/lightswitch2.wav')
- fr:Close()
- end
- end
- local function HitMenu(victim, active)
- local txt = 'Цель: '..victim:Name()
- fr2 = ui('DFrame')
- fr2:SetSize(sw,sh)
- fr2:ShowCloseButton(false)
- fr2:SetDraggable(false)
- fr2:SetTitle('')
- fr2:Center()
- fr2.Paint = function(self, w, h)
- box( 0, sw-400, 40, 400, 60, rp_col_Black )
- text( txt, sw-380, 55, Color( 255, 50, 100, 255 ), Color(30,160,100))
- image()
- end
- fr2.Think = function(self)
- if not ply.activeHit then
- txt = cfg_Jacket_SuccessUI
- timer.Simple(6, function() self:Remove() end)
- return
- end
- end
- end
- net_Receive('hit.Active', function(len, pl)
- local victim = net.ReadEntity()
- local status = net.ReadBool()
- ply.activeHit = status
- if not status then
- if fr and IsValid(fr) then fr:Remove() end
- if not ply.hotline_mami then return end
- hook_Remove("Hitman.Halo")
- ply.hotline_mami:Stop()
- return
- end
- HitMenu(victim)
- sound.PlayURL( "http://greenplayservers.ru/content/rytra/hotline_miami_"..math.random(1,6)..".mp3", "mono", function( sound )
- if IsValid( sound ) then
- sound:SetVolume( 0.3 )
- sound:Play()
- ply.hotline_mami = sound
- end
- end)
- end)
- hook_Add("HUDPaint", "Hitman.Hud", function()
- if ply.activeHit then
- local victim = ply:GetNWEntity('hit.Target')
- local pos = victim:GetPos():ToScreen()
- text( 'Цель', pos.x-20, pos.y-50, Color( 255, 50, 100, 255 ), Color(30,160,100))
- text( 'X', pos.x, pos.y-80, Color( 255, 50, 100, 255 ), Color(30,160,100))
- end
- end)
- net_Receive('hit.newOffer', function(l, pl) AddOffer(net.ReadEntity()) end)
- /*
- sound.PlayURL( "http://greenplayservers.ru/content/rytra/hotline_miami_"..table.Random(1,6)..".mp3", "mono", function( sound )
- ^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^
- https://imgur.com/g7xNfqX
- ссылка на мой сайт, тк там лежат все треки
- это быстрее, чем добавлять их в файлы сервера
- (при желании - перенесу все файлы)
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement