Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. local HUD = {}
  2. HUD.HideElements = {}
  3. HUD.HideElements["CHudBattery"] = true;
  4. HUD.HideElements["CHudCrosshair"] = true;
  5. HUD.HideElements["CHudHealth"] = true;
  6. HUD.HideElements["CHudAmmo"] = true;
  7. HUD.HideElements["CHudDamageIndicator"] = true;
  8.  
  9. HUD.Anchor = {}
  10. HUD.Anchor.X = 30;
  11. HUD.Anchor.Y = 30;
  12.  
  13. HUD.MainWidth = 300;
  14. HUD.MainHeight = 90;
  15.  
  16. HUD.Element1 = {
  17. { x = 0, y = (HUD.MainHeight / 2) },
  18. { x = 8, y = 0 },
  19. { x = 16, y = 0 },
  20. { x = 8, y = (HUD.MainHeight / 2) }
  21. }
  22.  
  23. function HUD:SetToAnchorPoint()
  24. for i = 1, #HUD.Element1 do
  25. HUD.Element1[i].x = HUD.Element1[i].x + HUD.Anchor.X;
  26. HUD.Element1[i].y = HUD.Element1[i].y + HUD.Anchor.Y;
  27. end
  28. end
  29.  
  30. function HUD:DrawHUD()
  31. draw.RoundedBox(2, HUD.Anchor.X, (HUD.MainHeight / 2) + HUD.Anchor.Y, HUD.MainWidth, 3, Color(223, 163, 0));
  32. surface.SetDrawColor( 223, 163, 0, 255 )
  33. draw.NoTexture()
  34. surface.DrawPoly(HUD.Element1);
  35. --draw.RoundedBox(2, 46, (HUD.MainHeight/2) + 30 + 3,number width,number height,table color)
  36. end
  37. HUD:SetToAnchorPoint();
  38. hook.Add("HUDPaint", "MizmoDrawHUD", HUD.DrawHUD);
  39.  
  40. function HUD:RemoveGarrysmodDefaultHud(name)
  41. if (HUD.HideElements[name]) then
  42. return false ;
  43. end
  44. end
  45. hook.Add("HUDShouldDraw", "RemoveGarrysmodDefaultHud", HUD.RemoveGarrysmodDefaultHud);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement