Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local HideOtherThings = {--Write here to hide hud things.If you don't know What should you hide,you can visit here https://wiki.garrysmod.com/page/HUD_Element_List
- ["DarkRP_HUD"] = true,
- ["DarkRP_EntityDisplay"] = true,
- ["DarkRP_LocalPlayerHUD"] = true,
- ["DarkRP_Hungermod"] = true,
- ["DarkRP_Agenda"] = true,
- ["DarkRP_LockdownHUD"] = true,
- ["DarkRP_ArrestedHUD"] = true,
- ["DarkRP_ChatReceivers"] = true,
- ["CHudHealth"] = true,
- ["CHudBattery"] = true
- }
- surface.CreateFont("HUD", {
- font = "Arial",
- size = ScrW() * 0.01,
- })
- surface.CreateFont("HUD2", {
- font = "Bahnschrift SemiBold",
- size = ScrW() * 0.015
- })
- hook.Add( "HUDShouldDraw", "Hiding Other Things", function( name )
- if ( HideOtherThings[ name ] ) then return false end
- -- Don't return anything here, it may break other addons that rely on this hook.
- end )
- hook.Add("HUDPaint", "Etkin's HUD", function()
- --MATERIALS
- local health_icon = Material("hud/health.png")
- local armor_icon = Material("hud/armor.png")
- local name_icon = Material("hud/name.png")
- local job_icon = Material("hud/job.png")
- local money_icon = Material("hud/money.png")
- local salary_icon = Material("hud/salary.png")
- --/MATERIALS
- --VARIABLES
- local health = LocalPlayer():Health()
- local armor = LocalPlayer():Armor()
- local name = LocalPlayer():getDarkRPVar("rpname")
- local job = LocalPlayer():getDarkRPVar("job")
- local money = LocalPlayer():getDarkRPVar("money")
- local salary = LocalPlayer():getDarkRPVar("salary")
- local id = LocalPlayer():SteamID()
- --/VARIABLES
- local scrw = ScrW() --for fast coding
- local scrh = ScrH() --for fas coding
- --MAIN DRAWING
- surface.SetDrawColor(0,0,0,200)
- surface.DrawRect(scrw / 2.5,scrh / 1.16,scrw / 4, scrh / 8)
- surface.SetDrawColor(0,0,0,255)
- surface.DrawOutlinedRect(scrw / 2.5,scrh / 1.16,scrw / 4, scrh / 8)
- surface.SetDrawColor(0,0,0,200)
- surface.DrawRect(scrw / 100,scrh / 1.16,scrw / 4, scrh / 8)
- surface.SetDrawColor(0,0,0,255)
- surface.DrawOutlinedRect(scrw / 100,scrh / 1.16,scrw / 4, scrh / 8)
- --/MAIN DRAWING
- --MATERIAL PAINTING
- surface.SetMaterial(health_icon)
- surface.SetDrawColor(0,0,0,255)
- surface.DrawTexturedRect(scrw / 70,scrh / 1.15, scrw / 40, scrh / 30)
- surface.SetMaterial(armor_icon)
- surface.SetDrawColor(0,0,0,255)
- surface.DrawTexturedRect(scrw / 70,scrh / 1.09, scrw / 40, scrh / 30)
- surface.SetMaterial(name_icon)
- surface.SetDrawColor(0,0,0,255)
- surface.DrawTexturedRect(scrw / 2.45,scrh / 1.15, scrw / 40, scrh / 20)
- surface.SetMaterial(job_icon)
- surface.SetDrawColor(0,0,0,255)
- surface.DrawTexturedRect(scrw / 2.45,scrh / 1.07, scrw / 40, scrh / 20)
- surface.SetMaterial(money_icon)
- surface.SetDrawColor(0,0,0,255)
- surface.DrawTexturedRect(scrw / 1.91,scrh / 1.15, scrw / 40, scrh / 20)
- surface.SetMaterial(salary_icon)
- surface.SetDrawColor(0,0,0,255)
- surface.DrawTexturedRect(scrw / 1.9,scrh / 1.06, scrw / 45, scrh / 25)
- --/MATERIAL PAINTING
- --VARIABLE PAINTING
- draw.RoundedBox(5,scrw / 20,scrh / 1.146,scrw / 5,scrh / 45,Color(0,0,0,200))
- draw.RoundedBox(5,scrw / 20,scrh / 1.146,math.min(100,health) * scrw * 0.002,scrh / 45,Color(0,200,0,200))
- draw.RoundedBox(5,scrw / 20,scrh / 1.08,scrw / 5,scrh / 45,Color(0,0,0,230))
- draw.RoundedBox(5,scrw / 20,scrh / 1.08,math.min(100,armor) * scrw * 0.002,scrh / 45,Color(0,0,200,230))
- draw.DrawText(health.."%","HUD",scrw / 7,scrh / 1.143,Color(255,255,255,255),1)
- draw.DrawText(armor.."%","HUD",scrw / 7,scrh / 1.08,Color(255,255,255,255),1)
- draw.DrawText(id,"HUD2",scrw / 13,scrh / 1.05,Color(255,255,255,255),1)
- draw.DrawText(name,"HUD2",scrw / 2.19,scrh / 1.135,Color(255,255,255,255),1)
- draw.DrawText(job,"HUD2",scrw / 2.19,scrh / 1.055,Color(255,255,255,255),1)
- draw.DrawText(money.."$","HUD2",scrw / 1.7,scrh / 1.135,Color(255,255,255,255),1)
- draw.DrawText(salary.."$","HUD2",scrw / 1.7,scrh / 1.055,Color(255,255,255,255),1)
- --/VARIABLE PAINTING
- end)
- if not engine.ActiveGamemode() == "darkrp" then
- hook.Remove("HUDPaint", "Etkin's HUD")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement