Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- surface.CreateFont("Roboto16", {font = "Roboto", size = 16, weight = 350})
- surface.CreateFont("Roboto18", {font = "Roboto", size = 18, weight = 350})
- surface.CreateFont("Roboto20", {font = "Roboto", size = 20, weight = 350})
- surface.CreateFont("Roboto22", {font = "Roboto", size = 22, weight = 350})
- surface.CreateFont("Roboto24", {font = "Roboto", size = 24, weight = 350})
- surface.CreateFont("Roboto26", {font = "Roboto", size = 26, weight = 350})
- surface.CreateFont("Roboto28", {font = "Roboto", size = 28, weight = 350})
- surface.CreateFont("Roboto30", {font = "Roboto", size = 30, weight = 350})
- include ("cleanhud/cleanhud_config.lua")
- local polyAmmo = {
- {x = ScrW() - 150, y = ScrH()},
- {x = ScrW() - 150, y = ScrH() - 20},
- {x = ScrW() - 125, y = ScrH() - 45},
- {x = ScrW(), y = ScrH() - 45},
- {x = ScrW(), y = ScrH()}
- }
- local polyAgenda = {
- {x = 0, y = 0},
- {x = ScrW() * 0.2, y = 0},
- {x = ScrW() * 0.2, y = 150},
- {x = ScrW() * 0.2 - 25, y = 175},
- {x = 0, y = 175}
- }
- local usericon = Material("icon16/user.png")
- local moneyicon = Material("icon16/money.png")
- local coinsicon = Material("icon16/coins.png")
- local timeicon = Material("icon16/time.png")
- local hearticon = Material("icon16/heart.png")
- local shieldicon = Material("icon16/shield.png")
- local Page = Material("icon16/page_white.png")
- local textFont
- local nameFont
- local elementSpacing = 0
- local innerSpacing = 0
- local widthComp = 0
- local ostime
- CleanHUD.Agenda = nil
- local plyMeta = FindMetaTable("Player")
- function formatInt(i)
- return tostring(i):reverse():gsub("%d%d%d", "%1,"):reverse():gsub("^,", "")
- end
- CleanHUD.PulseAlpha = 75
- -- presets
- if CleanHUD.ColorPreset == "dark" then
- CleanHUD.PlayerName = Color(0, 200, 190)
- CleanHUD.TextColor = Color(230, 230, 230)
- CleanHUD.AgendaTitleColor = Color(100, 100, 230)
- CleanHUD.BackgroundColor = Color(55, 55, 55, 245)
- CleanHUD.AccentColor = Color(125, 125, 125)
- CleanHUD.HealthBar = Color(255, 120, 120)
- CleanHUD.ArmorBar = Color(120, 120, 255)
- CleanHUD.PulseAlpha = 75
- end
- if CleanHUD.ColorPreset == "light" then
- CleanHUD.PlayerName = Color(40, 40, 40)
- CleanHUD.TextColor = Color(45, 45, 45)
- CleanHUD.AgendaTitleColor = Color(100, 100, 230)
- CleanHUD.BackgroundColor = Color(255, 255, 255, 240)
- CleanHUD.AccentColor = Color(185, 185, 185)
- CleanHUD.HealthBar = Color(255, 120, 120)
- CleanHUD.ArmorBar = Color(120, 120, 255)
- CleanHUD.PulseAlpha = 220
- end
- if CleanHUD.ColorPreset == "teal" then
- CleanHUD.PlayerName = Color(255, 255, 255)
- CleanHUD.TextColor = Color(240, 240, 240)
- CleanHUD.AgendaTitleColor = Color(100, 100, 230)
- CleanHUD.BackgroundColor = Color(0, 200, 165, 210)
- CleanHUD.AccentColor = Color(230, 230, 230)
- CleanHUD.HealthBar = Color(255, 120, 120)
- CleanHUD.ArmorBar = Color(120, 120, 255)
- CleanHUD.PulseAlpha = 190
- end
- if CleanHUD.ColorPreset == "blue" then
- CleanHUD.PlayerName = Color(255, 255, 255)
- CleanHUD.TextColor = Color(240, 240, 240)
- CleanHUD.AgendaTitleColor = Color(100, 100, 230)
- CleanHUD.BackgroundColor = Color(100, 120, 255, 210)
- CleanHUD.AccentColor = Color(230, 230, 230)
- CleanHUD.HealthBar = Color(255, 120, 120)
- CleanHUD.ArmorBar = Color(120, 120, 255)
- CleanHUD.PulseAlpha = 210
- end
- if CleanHUD.ColorPreset == "none" then
- CleanHUD.PulseAlpha = 190
- end
- if ScreenScale(640) == 1600 or ScreenScale(640) == 1440 then
- textFont = "Roboto20"
- nameFont = "Roboto24"
- elementSpacing = 45
- if CleanHUD.Gamemode == "sandbox" then innerSpacing = -15 end
- widthComp = 50
- end
- if ScreenScale(640) <= 1366 then
- textFont = "Roboto20"
- nameFont = "Roboto24"
- elementSpacing = 90
- if CleanHUD.Gamemode == "sandbox" then innerSpacing = -15 end
- widthComp = 90
- elseif ScreenScale(640) == 1920 then
- textFont = "Roboto22"
- nameFont = "Roboto30"
- elementSpacing = 5
- if CleanHUD.Gamemode == "sandbox" then innerSpacing = -20 end
- widthComp = 5
- innerSpacing = -25
- end
- if ScreenScale(640) == 1024 then
- textFont = "Roboto18"
- nameFont = "Roboto22"
- elementSpacing = 90
- widthComp = 80
- innerSpacing = 20
- if CleanHUD.Gamemode == "sandbox" then innerSpacing = 0 end
- end
- if ScreenScale(640) == 800 then
- textFont = "Roboto16"
- nameFont = "Roboto20"
- elementSpacing = 90
- widthComp = 80
- innerSpacing = 20
- if CleanHUD.Gamemode == "sandbox" then innerSpacing = 10 end
- end
- if ScreenScale(640) == 1680 then
- textFont = "Roboto20"
- nameFont = "Roboto26"
- elementSpacing = 5
- innerSpacing = 5
- if CleanHUD.Gamemode == "sandbox" then innerSpacing = -20 end
- widthComp = 5
- end
- local lerpTbl = {}
- lerpTbl.subtractHp = 0
- lerpTbl.subtractArmor = 355
- lerpTbl.subtractFood = 355
- lerpTbl.ammo = 0
- lerpTbl.lowAmmo = 0
- lerpTbl.highFade = false
- -- 335
- local barOrder = {}
- function sortBarOrder()
- barOrder.hp = 0
- barOrder.armor = 3
- barOrder.food = 6
- if LocalPlayer():Health() >= LocalPlayer():Armor() then
- barOrder.hp = barOrder.armor - 3
- elseif LocalPlayer():Health() < LocalPlayer():Armor() then
- barOrder.hp = barOrder.armor
- barOrder.armor = barOrder.hp - 3
- end
- if not DarkRP.disabledDefaults["modules"]["hungermod"] then
- if LocalPlayer():getDarkRPVar("Energy") > LocalPlayer():Armor() then
- barOrder.food = barOrder.armor
- barOrder.armor = barOrder.food + 3
- end
- if LocalPlayer():getDarkRPVar("Energy") > LocalPlayer():Health() then
- barOrder.food = barOrder.hp
- barOrder.hp = barOrder.food + 3
- end
- end
- end
- function drawHp()
- lerpTbl.subtractHp = Lerp(0.03, lerpTbl.subtractHp, (100 - math.Clamp(LocalPlayer():Health(), 0, 100)) * 3.35)
- local poly2 = {
- {x = (ScrW() * 0.333 - 65) + 50 + lerpTbl.subtractHp - widthComp, y = 40 + barOrder.hp},
- {x = (ScrW() * 0.666 + 65) - 50 - lerpTbl.subtractHp + widthComp, y = 40 + barOrder.hp},
- {x = (ScrW() * 0.666 + 61) - 50 - lerpTbl.subtractHp + widthComp, y = 43 + barOrder.hp},
- {x = (ScrW() * 0.333 - 61) + 50 + lerpTbl.subtractHp - widthComp, y = 43 + barOrder.hp}
- }
- -- hp bar
- surface.SetDrawColor(CleanHUD.HealthBar)
- draw.NoTexture()
- surface.DrawPoly(poly2)
- end
- function drawArmor()
- lerpTbl.subtractArmor = Lerp(0.03, lerpTbl.subtractArmor, (100 - math.Clamp(LocalPlayer():Armor(), 0, 100)) * 3.35)
- local poly3 = {
- {x = (ScrW() * 0.333 - 60) + 50 + lerpTbl.subtractArmor - widthComp, y = 40 + barOrder.armor},
- {x = (ScrW() * 0.666 + 60) - 50 - lerpTbl.subtractArmor + widthComp, y = 40 + barOrder.armor},
- {x = (ScrW() * 0.666 + 56) - 50 - lerpTbl.subtractArmor + widthComp, y = 43 + barOrder.armor},
- {x = (ScrW() * 0.333 - 56) + 50 + lerpTbl.subtractArmor - widthComp, y = 43 + barOrder.armor}
- }
- -- hp bar
- surface.SetDrawColor(CleanHUD.ArmorBar)
- draw.NoTexture()
- surface.DrawPoly(poly3)
- end
- function drawFood()
- local energy = LocalPlayer():getDarkRPVar("Energy")
- lerpTbl.subtractFood = Lerp(0.03, lerpTbl.subtractFood, (100 - math.Clamp(energy, 0, 100)) * 3.35)
- local poly4 = {
- {x = (ScrW() * 0.333 - 65) + 50 + lerpTbl.subtractFood - widthComp, y = 40 + barOrder.food},
- {x = (ScrW() * 0.666 + 65) - 50 - lerpTbl.subtractFood + widthComp, y = 40 + barOrder.food},
- {x = (ScrW() * 0.666 + 61) - 50 - lerpTbl.subtractFood + widthComp, y = 43 + barOrder.food},
- {x = (ScrW() * 0.333 - 61) + 50 + lerpTbl.subtractFood - widthComp, y = 43 + barOrder.food}
- }
- -- food/energy bar
- surface.SetDrawColor(CleanHUD.FoodBar)
- draw.NoTexture()
- surface.DrawPoly(poly4)
- end
- function drawAmmo()
- --[[
- {x = ScrW() - 150, y = ScrH()},
- {x = ScrW() - 150, y = ScrH() - 20},
- {x = ScrW() - 125, y = ScrH() - 45},
- {x = ScrW(), y = ScrH() - 45},
- {x = ScrW(), y = ScrH()}
- ]]
- local ammo = LocalPlayer():GetActiveWeapon():Clip1()
- surface.SetDrawColor(CleanHUD.BackgroundColor)
- draw.NoTexture()
- surface.DrawPoly(polyAmmo)
- if ammo <= 5 and LocalPlayer():GetActiveWeapon():Clip1() > -1 then
- if math.Round(lerpTbl.lowAmmo) == 15 then
- lerpTbl.highFade = false
- end
- if math.Round(lerpTbl.lowAmmo) == CleanHUD.PulseAlpha - 25 then
- lerpTbl.highFade = true
- end
- if lerpTbl.highFade then
- lerpTbl.lowAmmo = Lerp (0.03, lerpTbl.lowAmmo, 0)
- else
- lerpTbl.lowAmmo = Lerp (0.03, lerpTbl.lowAmmo, CleanHUD.PulseAlpha)
- end
- surface.SetDrawColor(255, 120, 120, lerpTbl.lowAmmo)
- draw.NoTexture()
- surface.DrawPoly(polyAmmo)
- end
- surface.SetDrawColor(CleanHUD.AccentColor)
- draw.NoTexture()
- surface.DrawLine(ScrW() - 145, ScrH(), ScrW() - 145, ScrH() - 18)
- surface.DrawLine(ScrW() - 145, ScrH() - 18, ScrW() - 123, ScrH() - 40)
- surface.DrawLine(ScrW() - 123, ScrH() - 40, ScrW(), ScrH() - 40)
- end
- function drawAgenda()
- --[[
- {x = 0, y = 0},
- {x = ScrW() * 0.2, y = 0},
- {x = ScrW() * 0.2, y = 125},
- {x = ScrW() * 0.2 - 25, y = 150},
- {x = 0, y = 150}
- ]]
- if CleanHUD.Gamemode == "darkrp" then
- local agenda = LocalPlayer():getAgendaTable()
- if not agenda then return end
- CleanHUD.Agenda = CleanHUD.Agenda or DarkRP.textWrap((LocalPlayer():getDarkRPVar("agenda") or ""):gsub("//", "\n"):gsub("\\n", "\n"), "Roboto28", 440)
- surface.SetDrawColor(CleanHUD.BackgroundColor)
- draw.NoTexture()
- surface.DrawPoly(polyAgenda)
- surface.SetDrawColor(CleanHUD.AccentColor)
- draw.NoTexture()
- surface.DrawLine(0, 170, ScrW() * 0.2 - 30, 170)
- surface.DrawLine(ScrW() * 0.2 - 30, 170, ScrW() * 0.2 - 5, 145)
- surface.DrawLine(ScrW() * 0.2 - 5, 145, ScrW() * 0.2 - 5, 0)
- draw.SimpleText(agenda.Title, "Roboto26", 20, 9, CleanHUD.AgendaTitleColor, TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP)
- draw.DrawText(CleanHUD.Agenda , "Roboto20", 20, 45, CleanHUD.TextColor, TEXT_ALIGN_LEFT)
- end
- end
- plyMeta.drawWantedInfo = function(self)
- if not self:Alive() then return end
- local hisPos = self:GetShootPos()
- local shootPos = LocalPlayer():GetShootPos()
- local aimVec = LocalPlayer():GetAimVector()
- --if not pos:isInSight({localplayer, self}) then return end
- if hisPos:DistToSqr(shootPos) < 45000 then
- local pos = hisPos - shootPos
- local unitPos = pos:GetNormalized()
- if unitPos:Dot(aimVec) > 0.95 then
- local eyepos = self:EyePos()
- eyepos.z = eyepos.z + 15
- eyepos = eyepos:ToScreen()
- if GAMEMODE.Config.showname then
- local nick, plyTeam = self:Nick(), self:Team()
- draw.DrawNonParsedText(nick, "Roboto22", eyepos.x + 1, eyepos.y + 11, Color(100, 100, 00), 1)
- draw.DrawNonParsedText(nick, "Roboto22", eyepos.x, eyepos.y + 10, team.GetColor(plyTeam) , 1)
- end
- local wantedText = DarkRP.getPhrase("wanted", tostring(self:getDarkRPVar("wantedReason")))
- draw.DrawNonParsedText(wantedText, "Roboto24", eyepos.x + 1, eyepos.y - 41, Color(210, 210, 210), 1)
- draw.DrawNonParsedText(wantedText, "Roboto24", eyepos.x, eyepos.y - 40, Color(246, 246, 246), 1)
- end
- end
- end
- plyMeta.drawPlayerInfo = function(self)
- local pos = self:EyePos()
- if (!CleanHUD.RemovePlayerInfoBackground) then
- pos.z = pos.z + 10
- else
- pos.z = pos.z + 12
- end
- pos = pos:ToScreen()
- if CleanHUD.Gamemode == "sandbox" or not self:getDarkRPVar("wanted") then
- -- Move the text up a few pixels to compensate for the height of the text
- pos.y = pos.y - 75
- end
- local nick, plyTeam = self:Nick(), self:Team()
- local teamname = "."
- surface.SetFont("Roboto20")
- local nameWidth = surface.GetTextSize(nick)
- if CleanHUD.Gamemode == "darkrp" then
- teamname = self:getDarkRPVar("job") or team.GetName(self:Team())
- end
- local jobWidth = surface.GetTextSize(teamname)
- local width = 175
- local height = 85
- if (!CleanHUD.RemovePlayerInfoBackground) then
- if (math.max(nameWidth, jobWidth) > (width - 20)) then
- width = math.max(nameWidth, jobWidth) + 22
- end
- end
- if (!CleanHUD.RemovePlayerInfoBackground) then
- draw.RoundedBox(4, pos.x - width/2, pos.y, width, height, CleanHUD.BackgroundColor)
- surface.SetDrawColor(CleanHUD.AccentColor)
- draw.NoTexture()
- surface.DrawLine(pos.x - width/2 + 5, pos.y + 5, pos.x + width / 2 - 5, pos.y + 5)
- surface.DrawLine(pos.x + width / 2 - 5, pos.y + 5, pos.x + width / 2 - 5, pos.y + height - 5)
- surface.DrawLine(pos.x + width / 2 - 5, pos.y + height - 5, pos.x - width/2 + 5, pos.y + height - 5)
- surface.DrawLine(pos.x - width/2 + 5, pos.y + height - 5, pos.x - width/2 + 5, pos.y + 5)
- end
- if (!CleanHUD.RemovePlayerInfoBackground) then
- draw.SimpleText(nick, "Roboto20", pos.x - width/2 + 10, pos.y + 6, CleanHUD.PlayerName)
- else
- draw.SimpleTextOutlined(nick, "Roboto20", pos.x, pos.y + 6, CleanHUD.PlayerName, TEXT_ALIGN_CENTER, nil, 1, Color(30, 30, 30, 80))
- end
- local health = math.Clamp(math.max(self:Health(), 0), 0, 100)
- local barMultiply = (width - 20) / 100
- if (!CleanHUD.RemovePlayerInfoBackground) then
- draw.RoundedBox(2, pos.x - width/2 + 10, pos.y + height - 13, barMultiply * health, 3, CleanHUD.HealthBar)
- else
- draw.RoundedBox(2, pos.x - width/2 + 9, pos.y + height - 14, width - 20 + 2, 5, Color(30, 30, 30, 140))
- draw.RoundedBox(2, pos.x - width/2 + 10, pos.y + height - 13, barMultiply * health, 3, CleanHUD.HealthBar)
- end
- if CleanHUD.Gamemode == "darkrp" then
- if (!CleanHUD.RemoveJobName) then
- if (!CleanHUD.RemovePlayerInfoBackground) then
- draw.SimpleText(teamname, "Roboto20", pos.x - width/2 + 10, pos.y + 27, CleanHUD.TextColor)
- else
- draw.SimpleTextOutlined(teamname, "Roboto20", pos.x, pos.y + 27, CleanHUD.TextColor, TEXT_ALIGN_CENTER, nil, 1, Color(30, 30, 30, 80))
- end
- end
- end
- if CleanHUD.Gamemode == "darkrp" then
- if self:getDarkRPVar("HasGunlicense") then
- surface.SetMaterial(Page)
- surface.SetDrawColor(255,255,255,255)
- surface.DrawTexturedRect(pos.x + 50, pos.y + 13, 24, 24)
- end
- end
- end
- local function DrawEntityDisplay()
- local shootPos = LocalPlayer():GetShootPos()
- local aimVec = LocalPlayer():GetAimVector()
- for k, ply in pairs(players or player.GetAll()) do
- if ply == LocalPlayer() or not ply:Alive() or ply:GetNoDraw() then
- if ply.HUDPanel then
- ply.HUDPanel:Remove()
- ply.HUDPanel = nil
- end
- continue
- end
- local hisPos = ply:GetShootPos()
- if CleanHUD.Gamemode == "darkrp" then
- if ply:getDarkRPVar("wanted") then
- if ply.HUDPanel then
- ply.HUDPanel:Remove()
- ply.HUDPanel = nil
- end
- ply:drawWantedInfo()
- continue
- end
- end
- if CleanHUD.Gamemode == "darkrp" and GAMEMODE.Config.globalshow then
- ply:drawPlayerInfo()
- end
- if hisPos:DistToSqr(shootPos) < 45000 then
- local pos = hisPos - shootPos
- local unitPos = pos:GetNormalized()
- if unitPos:Dot(aimVec) > 0.95 then
- local trace = util.QuickTrace(shootPos, pos, LocalPlayer())
- if trace.Hit and trace.Entity ~= ply then
- if ply.HUDPanel then
- ply.HUDPanel:Remove()
- ply.HUDPanel = nil
- end
- break
- end
- ply:drawPlayerInfo()
- else
- if ply.HUDPanel then
- ply.HUDPanel:Remove()
- ply.HUDPanel = nil
- end
- end
- else
- if ply.HUDPanel then
- ply.HUDPanel:Remove()
- ply.HUDPanel = nil
- end
- end
- end
- local tr = LocalPlayer():GetEyeTrace()
- if CleanHUD.Gamemode == "darkrp" then
- if IsValid(tr.Entity) and tr.Entity:isKeysOwnable() and tr.Entity:GetPos():DistToSqr(LocalPlayer():GetPos()) < 40000 then
- tr.Entity:drawOwnableInfo()
- end
- end
- end
- hook.Add("DarkRPVarChanged", "agenda", function(ply, var, _, new)
- if ply ~= LocalPlayer() then return end
- if var == "agenda" and new then
- CleanHUD.Agenda = DarkRP.textWrap(new:gsub("//", "\n"):gsub("\\n", "\n"), "DarkRPHUD1", 440)
- end
- end)
- hook.Add("HUDPaint", "drawHud", function()
- local poly1 = {
- {x = ScrW() * 0.333 - 70 - widthComp, y = 0},
- {x = (ScrW() * 0.666 + 70 + widthComp), y = 0},
- {x = (ScrW() * 0.666 + 70 + widthComp) - 50, y = 40},
- {x = (ScrW() * 0.333 - 70 - widthComp) + 50, y = 40}
- }
- sortBarOrder()
- drawHp()
- drawArmor()
- if not DarkRP.disabledDefaults["modules"]["hungermod"] then
- if LocalPlayer():getDarkRPVar("Energy") > 4 then
- drawFood()
- end
- end
- drawAgenda()
- DrawEntityDisplay()
- -- poly1
- surface.SetDrawColor(CleanHUD.BackgroundColor)
- draw.NoTexture()
- surface.DrawPoly(poly1)
- -- line
- surface.SetDrawColor(CleanHUD.AccentColor)
- draw.NoTexture()
- surface.DrawLine(ScrW() * 0.333 - 60 - widthComp, 0, (ScrW() * 0.333 - 70) + 55 - widthComp, 35)
- surface.DrawLine((ScrW() * 0.333 - 70) + 55 - widthComp, 35, (ScrW() * 0.666 + 70) - 55 + widthComp, 35)
- surface.DrawLine((ScrW() * 0.666 + 70) - 55 + widthComp, 35, (ScrW() * 0.666 + 60) + widthComp, 0)
- -- job / rank
- surface.SetDrawColor(255, 255, 255)
- surface.SetMaterial(usericon)
- surface.DrawTexturedRect(ScrW() * 0.333 - 10 - elementSpacing, 10, 16, 16)
- if CleanHUD.Gamemode == "darkrp" then
- local job = string.sub(LocalPlayer():getDarkRPVar("job"), 1, 13)
- draw.SimpleText(job, textFont, ScrW() * 0.333 + 15 - elementSpacing, 18, CleanHUD.TextColor, nil, TEXT_ALIGN_CENTER)
- elseif CleanHUD.Gamemode == "sandbox" then
- local rank = string.sub(CleanHUD.UserGroups[LocalPlayer():GetUserGroup()], 1, 13)
- draw.SimpleText(rank, textFont, ScrW() * 0.333 + 15 - elementSpacing, 18, CleanHUD.TextColor, nil, TEXT_ALIGN_CENTER)
- end
- -- money / HP
- if CleanHUD.Gamemode == "darkrp" then
- surface.SetMaterial(moneyicon)
- surface.DrawTexturedRect(ScrW() * 0.333 + 115 - elementSpacing - innerSpacing, 10, 16, 16)
- local money = string.sub(formatInt(LocalPlayer():getDarkRPVar("money")), 1, 11)
- draw.SimpleText("$" .. money, textFont, ScrW() * 0.333 + 137 - elementSpacing - innerSpacing, 18, CleanHUD.TextColor, nil, TEXT_ALIGN_CENTER)
- elseif CleanHUD.Gamemode == "sandbox" then
- surface.SetMaterial(hearticon)
- surface.DrawTexturedRect(ScrW() * 0.333 + 115 - elementSpacing - innerSpacing, 10, 16, 16)
- local health = string.sub(LocalPlayer():Health(), 1, 10)
- draw.SimpleText(health, textFont, ScrW() * 0.333 + 137 - elementSpacing - innerSpacing, 18, CleanHUD.TextColor, nil, TEXT_ALIGN_CENTER)
- end
- -- salary / armor
- if CleanHUD.Gamemode == "darkrp" then
- surface.SetMaterial(coinsicon)
- surface.DrawTexturedRect(ScrW() * 0.666 - 175 + elementSpacing + innerSpacing, 10, 16, 16)
- draw.SimpleText("$" .. formatInt(LocalPlayer():getDarkRPVar("salary")), textFont, ScrW() * 0.666 - 152 + elementSpacing + innerSpacing, 18, CleanHUD.TextColor, nil, TEXT_ALIGN_CENTER)
- elseif CleanHUD.Gamemode == "sandbox" then
- surface.SetMaterial(shieldicon)
- surface.DrawTexturedRect(ScrW() * 0.666 - 170 + elementSpacing + innerSpacing, 10, 16, 16)
- draw.SimpleText(LocalPlayer():Armor(), textFont, ScrW() * 0.666 - 147 + elementSpacing + innerSpacing, 18, CleanHUD.TextColor, nil, TEXT_ALIGN_CENTER)
- end
- -- local time
- ostime = os.time()
- surface.SetMaterial(timeicon)
- surface.DrawTexturedRect(ScrW() * 0.666 - 65 + elementSpacing, 10, 16, 16)
- draw.SimpleText(os.date( "%H:%M" , ostime ), textFont, ScrW() * 0.666 - 40 + elementSpacing, 18, CleanHUD.TextColor, nil, TEXT_ALIGN_CENTER)
- -- playername
- local name = string.sub(LocalPlayer():Nick(), 1, 11)
- local nameY = 29
- if ScreenScale(640) == 1920 then nameY = 32 end
- draw.SimpleText(name, nameFont, ScrW() / 2, nameY, CleanHUD.PlayerName, TEXT_ALIGN_CENTER, TEXT_ALIGN_BOTTOM)
- if IsValid(LocalPlayer():GetActiveWeapon()) then
- lerpTbl.ammo = Lerp(0.045, lerpTbl.ammo, LocalPlayer():GetActiveWeapon():Clip1())
- local mag_extra = LocalPlayer():GetAmmoCount(LocalPlayer():GetActiveWeapon():GetPrimaryAmmoType())
- local ammo = (math.max(math.Round(lerpTbl.ammo), 0)) .. " / " .. mag_extra
- if ammo != "0 / 0" then
- drawAmmo()
- draw.SimpleText(ammo, "Roboto28", (ScrW() - 117) + 100/2, ScrH() - 33, CleanHUD.TextColor, TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP)
- end
- end
- end)
- local hideHUDElements = {
- ["DarkRP_HUD"] = true,
- ["DarkRP_EntityDisplay"] = true,
- ["DarkRP_Agenda"] = true,
- ["DarkRP_LocalPlayerHUD"] = true,
- ["DarkRP_Hungermod"] = true,
- CHudAmmo = true,
- CHudHealth = true,
- CHudBattery = true
- }
- hook.Add("HUDShouldDraw", "hideHudElements", function(name)
- if hideHUDElements[name] then return false end
- end)
- hook.Add("HUDDrawTargetID", "hideCursorHud", function()
- return false
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement