Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function HUDPaint()
- if (LocalPlayer():GetActiveWeapon() == NULL or LocalPlayer():GetActiveWeapon() == "Camera") then return end
- if ( !LocalPlayer():Alive() ) then return end
- if shouldDraw then
- SWEP = LocalPlayer():GetActiveWeapon()
- length = LocalPlayer():Health() *2
- Alength = LocalPlayer():Armor() *2
- ypos = ScrH() - 75
- poly = { { },{ },{ },{} }
- poly[1]["x"] = 150
- poly[1]["y"] = ypos
- poly[1]["u"] = 1
- poly[1]["v"] = 0
- poly[2]["x"] = length+150
- poly[2]["y"] = ypos
- poly[2]["u"] =0
- poly[2]["v"] = 0
- poly[3]["x"] = length + 175
- poly[3]["y"] = ypos+15
- poly[3]["u"] = 0
- poly[3]["v"] = 0
- poly[4]["x"] = 150
- poly[4]["y"] = ypos+15
- poly[4]["u"] =1
- poly[4]["v"] = 1
- poly2 = { { },{ },{ },{} }
- poly2[1]["x"] = 150
- poly2[1]["y"] = ypos+15
- poly2[1]["u"] =1
- poly2[1]["v"] = 0
- poly2[2]["x"] = Alength+175
- poly2[2]["y"] = ypos+15
- poly2[2]["u"] =0
- poly2[2]["v"] = 0
- poly2[3]["x"] = Alength+150
- poly2[3]["y"] = ypos+30
- poly2[3]["u"] = 0
- poly2[3]["v"] = 0
- poly2[4]["x"] = 150
- poly2[4]["y"] = ypos +30
- poly2[4]["u"] =1
- poly2[4]["v"] = 1
- local CamData = {}
- CamData.angles = Angle(90,90,0)
- CamData.origin = Vector(LocalPlayer():GetPos().x,LocalPlayer():GetPos().y,512)
- CamData.x = 10
- CamData.y = 10
- CamData.w = 200
- CamData.h = 200
- render.RenderView( CamData )
- surface.SetTexture( triangletex ) --set the texture of the triangle
- surface.SetDrawColor( 255, 50, 50, 255 ) --set the additive color
- surface.DrawPoly( poly ) --draw the triangle with our triangle table
- surface.SetDrawColor( 50, 50, 255, 255 ) --set the additive color
- surface.DrawPoly( poly2 ) --draw the triangle with our triangle table
- surface.SetDrawColor( 200, 200, 200, 255 ) --set the additive color
- surface.DrawLine( 150, ypos+14,400, ypos+14 )
- surface.DrawLine( 150, ypos+15,400, ypos+15 )
- surface.DrawLine( 150, ypos+16,400, ypos+16 )
- surface.DrawLine( ScrW()-450, ypos+14,ScrW()-150, ypos+14 )
- surface.DrawLine( ScrW()-450, ypos+15,ScrW()-150, ypos+15 )
- surface.DrawLine( ScrW()-450, ypos+16,ScrW()-150, ypos+16 )
- draw.SimpleText(LocalPlayer():Health(), "BANKGOTHIC", 170, ScrH() - 70, Color(255,255,255,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
- draw.SimpleText(LocalPlayer():Armor(), "BANKGOTHIC", 170, ScrH() - 50, Color(255,255,255,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
- draw.SimpleText(string.ToMinutesSeconds( CurTime()), "BANKGOTHIC", 80, ScrH() - 150, Color(255,255,255,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
- local center = Vector( 75, ScrH()-60, 0 )
- local scale = Vector( 75, 75, 0 )
- local segmentdist = 360 / ( 2 * math.pi * math.max( scale.x, scale.y ) / 2 )
- surface.SetDrawColor( 200, 200, 200, 255 )
- for a = 0, 130 - segmentdist, segmentdist do
- surface.DrawLine( center.x + math.cos( math.rad( a ) ) * scale.x, center.y - math.sin( math.rad( a ) ) * scale.y, center.x + math.cos( math.rad( a + segmentdist ) ) * scale.x, center.y - math.sin( math.rad( a + segmentdist ) ) * scale.y )
- surface.DrawLine( center.x+1 + math.cos( math.rad( a ) ) * scale.x, center.y - math.sin( math.rad( a ) ) * scale.y, center.x + math.cos( math.rad( a + segmentdist ) ) * scale.x, center.y+1 - math.sin( math.rad( a + segmentdist ) ) * scale.y )
- surface.DrawLine( center.x+2 + math.cos( math.rad( a ) ) * scale.x, center.y - math.sin( math.rad( a ) ) * scale.y, center.x + math.cos( math.rad( a + segmentdist ) ) * scale.x, center.y+2 - math.sin( math.rad( a + segmentdist ) ) * scale.y )
- end
- local center = Vector( ScrW()-75, ScrH()-60, 0 )
- local scale = Vector( 75, 75, 0 )
- local segmentdist = 360 / ( 2 * math.pi * math.max( scale.x, scale.y ) / 2 )
- for a = 0, 180 - segmentdist, segmentdist do
- surface.DrawLine( center.x + math.cos( math.rad( a ) ) * scale.x, center.y - math.sin( math.rad( a ) ) * scale.y, center.x + math.cos( math.rad( a + segmentdist ) ) * scale.x, center.y - math.sin( math.rad( a + segmentdist ) ) * scale.y )
- surface.DrawLine( center.x+1 + math.cos( math.rad( a ) ) * scale.x, center.y - math.sin( math.rad( a ) ) * scale.y, center.x + math.cos( math.rad( a + segmentdist ) ) * scale.x, center.y+1 - math.sin( math.rad( a + segmentdist ) ) * scale.y )
- surface.DrawLine( center.x+2 + math.cos( math.rad( a ) ) * scale.x, center.y - math.sin( math.rad( a ) ) * scale.y, center.x + math.cos( math.rad( a + segmentdist ) ) * scale.x, center.y+2 - math.sin( math.rad( a + segmentdist ) ) * scale.y )
- end
- //Ammo
- local bulletNum = SWEP:Clip1()
- draw.SimpleText(bulletNum, "BANKGOTHIC2", ScrW()-185, ScrH() - 75, Color(200,200,200,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
- if bulletNum <=50 then
- for i = 1,bulletNum do
- surface.DrawLine( ScrW()-200-i*5, ypos-5,ScrW()-200-i*5, ypos+10 )
- surface.DrawLine( ScrW()-201-i*5, ypos-5,ScrW()-201-i*5, ypos+10 )
- surface.DrawLine( ScrW()-202-i*5, ypos-5,ScrW()-202-i*5, ypos+10 )
- end
- else
- local max = LocalPlayer():GetActiveWeapon().Primary.ClipSize
- local BarLength = (bulletNum*240)/max
- surface.DrawRect(ScrW()-210-BarLength, ypos-5, BarLength, 15 )
- end
- end
- end
- hook.Add("HUDPaint","Hud", HUDPaint)
- function hidehud(name)
- if shouldDraw then
- for k, v in pairs{"CHudHealth", "CHudBattery", "CHudAmmo", "CHudSecondaryAmmo"} do
- if name == v then return false end
- end
- end
- end
- hook.Add("HUDShouldDraw", "hidehud", hidehud)
- function toggleCodHud()
- shouldDraw = not shouldDraw
- end
- concommand.Add("toggleCodHud",toggleCodHud)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement