Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -----------------------------------------------------
- local formatMoney = DarkRP.formatMoney
- local getPhrase = DarkRP.getPhrase
- local drawSTextOutlined = draw.SimpleTextOutlined
- local drawSText = draw.SimpleText
- local drawText = draw.DrawText
- local teamGC=team.GetColor
- local Color=Color
- local GetGlobalBool=GetGlobalBool
- local CurTime=CurTime
- local FrameTime=FrameTime
- local surface=surface
- local math=math
- hook.Add("InitPostEntity","1337InitPostAvatar",function()
- surface.CreateFont( "TargetIDBG", {
- font = "roboto",
- size = 22,
- weight = 900,
- antialias = true,
- extended = true,
- })
- surface.CreateFont( "TargetIDBG2", {
- font = "roboto",
- size = 26,
- weight = 900,
- antialias = true,
- extended = true,
- })
- surface.CreateFont( "TargetIDBG2_SuperBig", {
- font = "roboto",
- size = 106,
- weight = 900,
- extended = true,
- antialias = true,
- })
- surface.CreateFont( "TargetIDMN", {
- font = "roboto",
- size = 22,
- weight = 900,
- extended = true,
- antialias = true,
- })
- local VoiceChatTexture = surface.GetTextureID("voice/icntlk_pl")
- local Page = Material("icon64/tool.png")
- local grad2 = surface.GetTextureID('gui/gradient_down')
- local sw,sh = ScrW(),ScrH()
- local localplayer = LocalPlayer()
- local avat = vgui.Create('AvatarImage')
- avat:SetPlayer(localplayer,64)
- avat:SetSize(50,50)
- avat:SetPos(5,sh-55)
- local Arrested = function() end
- usermessage.Hook("GotArrested", function(msg)
- local StartArrested = CurTime()
- local ArrestedUntil = msg:ReadFloat()
- Arrested = function()
- if CurTime() - StartArrested <= ArrestedUntil and localplayer:getDarkRPVar("Arrested") then
- drawSText(getPhrase("youre_arrested", math.ceil(ArrestedUntil - (CurTime() - StartArrested))), "TargetIDBG2", sw/2, sh - sh/12, Color(255,255,255), 1)
- elseif not localplayer:getDarkRPVar("Arrested") then
- Arrested = function() end
- end
- end
- end)
- local money=0
- function GAMEMODE:HUDPaint()
- local mhel = localplayer:GetMaxHealth()
- local h = localplayer:Health()
- local a = localplayer:Armor()
- local g = localplayer:getDarkRPVar("Energy")
- local m = localplayer:getDarkRPVar("money")
- if h<0 then h=0 end
- if money!=m then
- local progress = 0
- local stat = math.abs(m-money) or 0
- local change = vgui.Create("DPanel")
- change:SetSize(250,25)
- change:SetPos(490,sh-30)
- local color = money<m and Color(0,255,0) or Color(255,0,0)
- change.Paint = function(self,w,h)
- drawSTextOutlined(formatMoney(stat),"TargetIDBG2",0,h/2,color,TEXT_ALIGN_LEFT,TEXT_ALIGN_CENTER,1,Color(0,0,0))
- end
- change.Think = function()
- progress=progress+FrameTime()
- if progress>1 then change:Remove() end
- change:SetPos(490,sh-30-progress*80)
- change:SetAlpha(255*(1-progress))
- end
- money=m
- end
- surface.SetDrawColor(Color(0,0,0,200))
- surface.DrawRect(60,sh-30,210,25)
- surface.DrawRect(275,sh-30,210,25)
- surface.SetDrawColor(Color(200,141,0))
- surface.DrawRect(276,sh-29,208*g/100,23)
- surface.SetDrawColor(Color(255,0,0))
- surface.DrawRect(61,sh-29,208*math.Clamp(h/mhel,0,1),23)
- drawSTextOutlined(math.Round(g).."%","TargetIDMN",380,sh-30+25/2,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER,1,Color(0,0,0,150))
- drawSTextOutlined(h.."%","TargetIDMN",160,sh-30+25/2,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER,1,Color(0,0,0,150))
- if a>0 then
- surface.SetDrawColor(Color(0,0,0,200))
- surface.DrawRect(60,sh-5,210,5)
- surface.SetDrawColor(Color(0,0,255))
- surface.DrawRect(61,sh-6,208*math.Clamp(a/100,0,1),5)
- end
- drawSTextOutlined(localplayer:getDarkRPVar("job").." | "..formatMoney(localplayer:getDarkRPVar("salary")),"TargetIDMN",60,sh-45,teamGC(localplayer:Team()),TEXT_ALIGN_LEFT,TEXT_ALIGN_CENTER,1,Color(0,0,0,150))
- drawSTextOutlined(formatMoney(money),"TargetIDBG2",490,sh-30+25/2,Color(255,255,255),TEXT_ALIGN_LEFT,TEXT_ALIGN_CENTER,1,Color(0,0,0,150))
- if localplayer:getDarkRPVar("HasGunlicense") then
- surface.SetMaterial(Page)
- surface.SetDrawColor(Color(255,255,255))
- surface.DrawTexturedRect(14,sh-90,32,32)
- end
- local agenda = localplayer:getAgendaTable()
- if agenda then
- local text = localplayer:getDarkRPVar("agenda")
- if text then
- surface.SetDrawColor(Color(40,40,40,220))
- surface.DrawRect( 10, 30, 460, 90 )
- surface.SetDrawColor(Color(80,80,80,220))
- surface.DrawRect( 10, 10, 460, 20)
- drawSText(agenda.Title, "DarkRPHUD1", 240, 12, Color(255,255,255),TEXT_ALIGN_CENTER)
- text = text:gsub("//", "\n"):gsub("\\n", "\n")
- text = DarkRP.textWrap(text, "DarkRPHUD1", 440)
- drawText(text, "DarkRPHUD1", 20, 35, Color(255,255,255), 0)
- end
- end
- if localplayer.DRPIsTalking then
- local Rotating = math.sin(CurTime()*3)
- local backwards = 0
- if Rotating < 0 then
- Rotating = 1-(1+Rotating)
- backwards = 180
- end
- surface.SetTexture(VoiceChatTexture)
- surface.SetDrawColor(Color(255,0,0))
- surface.DrawTexturedRectRotated(sw - 100, 100--[[sh/2]], Rotating*96, 96, backwards)
- end
- if GetGlobalBool("DarkRP_LockDown") then
- local sin = (math.sin(CurTime()) + 1) / 2
- surface.SetTexture(grad2)
- surface.SetDrawColor(0,0,0,255)
- surface.DrawTexturedRect(0,0,sw,40)
- drawSText(getPhrase("lockdown_started"), "TargetIDBG", sw/2, 10, Color(sin * 255, 0, 255 - (sin * 255), 255), TEXT_ALIGN_CENTER)
- end
- if g==0 then
- local sin = (math.sin(CurTime()) + 1) / 2
- drawSText("Голодание", "TargetIDBG2_SuperBig",sw/2,sh-200, Color(sin * 255, 0, 255 - (sin * 255), 255), TEXT_ALIGN_CENTER)
- end
- Arrested()
- self.BaseClass:HUDPaint()
- end
- hook.Remove("InitPostEntity","1337InitPostAvatar")
- end)
- usermessage.Hook("_Notify",function(msg)
- GAMEMODE:AddNotify(msg:ReadString(), msg:ReadShort(), msg:ReadLong())
- surface.PlaySound("buttons/lightswitch2.wav")
- end)
- function GM:HUDDrawTargetID()
- return false
- end
- function GM:HUDShouldDraw(name)
- if name == "CHudHealth" or
- name == "CHudBattery" or
- name == "CHudSuitPower"
- then
- return false
- else
- return true
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment