Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local hideHUDElements = {
- ['DarkRP_HUD'] = true,
- ['DarkRP_EntityDisplay'] = true,
- ['DarkRP_LocalPlayerHUD'] = true,
- ['DarkRP_Hungermod'] = true,
- ['DarkRP_Agenda'] = true,
- ['DarkRP_LockdownHUD'] = true,
- ['DarkRP_ArrestedHUD'] = true,
- ['CHudHealth'] = true,
- ['CHudBattery'] = true,
- ['CHudAmmo'] = true,
- ['CHudSecondaryAmmo'] = true
- }
- hook.Add("HUDShouldDraw", "HideDefaultDarkRPHud", function(name)
- if hideHUDElements[name] or name == "CHudHealth" or name == "CHudBattery" then return false end
- end)
- hook.Add("HUDPaint", "DrawMyHud", function()
- local ply = LocalPlayer()
- local time = CurTime()
- local armorBar = {
- { x = ScrW() / 2 - 320, y = ScrH() - 60 },
- { x = ScrW() / 2 - 80, y = ScrH() - 60 },
- { x = ScrW() / 2 - 80, y = ScrH() - 30 },
- { x = ScrW() / 2 - 340, y = ScrH() - 30 }
- }
- local healthBar = {
- { x = ScrW() / 2 + 80, y = ScrH() - 60 },
- { x = ScrW() / 2 + 320, y = ScrH() - 60 },
- { x = ScrW() / 2 + 340, y = ScrH() - 30 },
- { x = ScrW() / 2 + 80, y = ScrH() - 30 }
- }
- local PlayerHealth = {
- { x = ScrW() / 2 + 81, y = ScrH() - 60 },
- { x = ScrW() / 2 + 300*(ply:Health()/ 100), y = ScrH() - 60 },
- { x = ScrW() / 2 + ply:Health() * 3.2 , y = ScrH() - 30 },
- { x = ScrW() / 2 + 81, y = ScrH() - 30 }
- }
- print(PlayerHealth[1]["x"])
- print(PlayerHealth[2]["x"])
- print(ply:Health())
- surface.SetDrawColor(255, 255, 255, 15)
- draw.NoTexture()
- surface.DrawPoly(armorBar)
- surface.DrawPoly(healthBar)
- surface.DrawRect(ScrW() / 2 - 70, ScrH() - 94 , 64, 64)
- surface.DrawRect(ScrW() / 2 + 6, ScrH() - 94 , 64, 64)
- surface.SetDrawColor(0, 153, 0, 220)
- surface.DrawPoly(PlayerHealth)
- surface.SetDrawColor(0, 206, 209, 220)
- //surface.DrawPoly(PlayerArmor)
- DrawHUDLines(healthBar)
- DrawHUDLines(armorBar)
- end)
- function DrawHUDLines(strTable)
- surface.SetDrawColor(255, 255, 255, 150)
- local count = 1
- for k, v in pairs(strTable) do
- if count > 3 then
- surface.DrawLine(strTable[4]["x"], strTable[4]["y"], strTable[1]["x"], strTable[1]["y"])
- else
- surface.DrawLine(strTable[k]["x"], strTable[k]["y"], strTable[k + 1]["x"], strTable[k + 1]["y"])
- count = count + 1
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement