Advertisement
DontSleep

fallout new vegas hud helix plugin

Jul 4th, 2025
336
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.71 KB | Gaming | 0 0
  1. local PLUGIN = PLUGIN
  2. PLUGIN.name = "Fallout HUD"
  3. PLUGIN.author = "DontSleep"
  4. PLUGIN.description = "HUD Fallout New Vegas"
  5.  
  6. function PLUGIN:ShouldDrawCrosshair(client, weapon)
  7.     return false
  8. end
  9.  
  10. function PLUGIN:ShouldHideBars()
  11.     return true
  12. end
  13.  
  14. function PLUGIN:CanDrawAmmoHUD(weapon)
  15.     return false
  16. end
  17.  
  18. local hide = {
  19.     CHudHealth = true,
  20.     CHudBattery = true,
  21.     CHudAmmo = true,
  22.     CHudSecondaryAmmo = true
  23. }
  24.  
  25. local crosshairMat = Material("fonvui/hud/hud_crosshair.png")
  26.  
  27. hook.Add("HUDPaint", "DrawCustomCrosshair", function()
  28.     local x, y = ScrW() / 2, ScrH() / 2
  29.     local size = 64
  30.  
  31.     surface.SetDrawColor(252,177,65,255)
  32.     surface.SetMaterial(crosshairMat)
  33.     surface.DrawTexturedRect(x - size/2, y - size/2, size, size)
  34. end)
  35.  
  36. hook.Add("HUDShouldDraw", "HideDefaultHUD", function(name)
  37.     if hide[name] then return false end
  38. end)
  39.  
  40. hook.Add("HUDShouldDraw", "HideDefaultCrosshair", function(name)
  41.     if name == "CHudCrosshair" then
  42.         return false
  43.     end
  44. end)
  45.  
  46. hook.Add("HUDPaint", "DrawCustomHealthBar", function()
  47.     local client = LocalPlayer()
  48.     if (!IsValid(client)) then return end
  49.  
  50.     local hp = client:Health()
  51.     local maxHp = client:GetMaxHealth()
  52.    
  53.  
  54.    
  55.     local w, h = 430, 250
  56.     local x = ScrW() - w - 1450
  57.     local y = ScrH() - h + 90
  58.  
  59.    
  60.    
  61.     local mat = Material("fonvui/hud/hud_left_main.png")
  62.     surface.SetMaterial(mat)
  63.     surface.SetDrawColor(252,177,65,255)
  64.     surface.DrawTexturedRect(x, y, w , h)
  65.     surface.SetFont("FalloutFont")
  66.     surface.SetTextPos(x + 35, y + 3)
  67.     surface.SetTextColor(252,177,65,255)
  68.     surface.DrawText("HP")
  69.  
  70.    
  71.     local mat = Material("fonvui/hud/hud_right_main.png")
  72.     surface.SetMaterial(mat)
  73.     surface.SetDrawColor(252,177,65,255)
  74.     surface.DrawTexturedRect(x + 1430, y, w , h)
  75.     surface.SetFont("FalloutFont")
  76.     surface.SetTextPos(x + 1800, y + 3)
  77.     surface.SetTextColor(252,177,65,255)
  78.     surface.DrawText("AP")
  79.  
  80.     local compassMat = Material("fonvui/hud/compass.png")
  81. local compassW, compassH = 620, 600    
  82. local drawW, drawH = 350, 45          
  83. local compassX = x + 30
  84. local compassY = y + 80
  85.  
  86. local yaw = LocalPlayer():EyeAngles().y
  87. yaw = math.NormalizeAngle(yaw)
  88.  
  89. local u = ( 1 - (yaw / 360)) % 1
  90.  
  91. local halfDrawU = (drawW / compassW) / 2
  92. local uStart = u - halfDrawU
  93. local uEnd = u + halfDrawU
  94.  
  95.  
  96. if uStart < 0 then uStart = uStart + 1 end
  97. if uEnd > 1 then uEnd = uEnd - 1 end
  98.  
  99. surface.SetDrawColor(252, 177, 65, 255)
  100. surface.SetMaterial(compassMat)
  101.  
  102. if uStart > uEnd then
  103.    
  104.     local leftUVWidth = 1 - uStart
  105.     local leftPixelWidth = drawW * (leftUVWidth / (leftUVWidth + uEnd))
  106.    
  107.     surface.DrawTexturedRectUV(compassX, compassY, leftPixelWidth, drawH, uStart, 0, 1, 1)
  108.  
  109.    
  110.     local rightPixelWidth = drawW - leftPixelWidth
  111.    
  112.     surface.DrawTexturedRectUV(compassX + leftPixelWidth, compassY, rightPixelWidth, drawH, 0, 0, uEnd, 1)
  113. else
  114.    
  115.     surface.DrawTexturedRectUV(compassX, compassY, drawW, drawH, uStart, 0, uEnd, 1)
  116. end
  117.  
  118.  
  119. local hpMat = Material("fonvui/hud/percent_hud.png")
  120. local hp = math.Clamp(LocalPlayer():Health() / LocalPlayer():GetMaxHealth(), 0, 1)
  121.  
  122. local barX = x + 25
  123. local barY = y + 35
  124. local barW = w - 105
  125. local barH = h - 225
  126. local visibleW = barW * hp
  127.  
  128.  
  129. render.SetScissorRect(barX, barY, barX + visibleW, barY + barH, true)
  130.  
  131.  
  132. surface.SetMaterial(hpMat)
  133. surface.SetDrawColor(225, 225, 225)
  134. surface.DrawTexturedRect(barX, barY, barW, barH)
  135.  
  136.  
  137. render.SetScissorRect(0, 0, 0, 0, false)
  138.  
  139.  
  140. local hpMat = Material("fonvui/hud/percent_hud.png")
  141. local ply = LocalPlayer()
  142. local char = ply:GetCharacter()
  143. local stamina = ply:GetLocalVar("stm", 0)
  144. stamina = math.Clamp(stamina / 100, 0, 1)
  145.  
  146.  
  147. local rightX = x + 1482
  148. local barX = rightX + 25
  149. local barY = y + 35
  150. local barW = w - 105
  151. local barH = h - 225
  152. local visibleW = barW * stamina
  153.  
  154.  
  155. render.SetScissorRect(barX, barY, barX + visibleW, barY + barH, true)
  156.  
  157. surface.SetMaterial(hpMat)
  158. surface.SetDrawColor(225, 225, 225)
  159. surface.DrawTexturedRect(barX, barY, barW, barH)
  160.  
  161. render.SetScissorRect(0, 0, 0, 0, false)
  162.  
  163. local ply = LocalPlayer()
  164. local wep = ply:GetActiveWeapon()
  165.  
  166. if IsValid(wep) and wep:Clip1() >= 0 then
  167.     local ammoInMag = wep:Clip1()
  168.     local ammoReserve = ply:GetAmmoCount(wep:GetPrimaryAmmoType())
  169.     local ammoText = string.format("%02d / %02d", ammoInMag, ammoReserve)
  170.  
  171.     surface.SetFont("FalloutFont")
  172.     surface.SetTextColor(252, 177, 65, 255)
  173.  
  174.     local ammoX = x + 1690 + 30
  175.     local ammoY = y + 80
  176.  
  177.     surface.SetTextPos(ammoX, ammoY)
  178.     surface.DrawText(ammoText)
  179. end
  180.  
  181.  
  182. end)
  183.  
  184. surface.CreateFont("FalloutFont", {
  185.     font = "Monofonto",
  186.     size = 34,
  187.     weight = 500,
  188.     antialias = true,
  189. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement