Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 21.21 KB | None | 0 0
  1.  
  2. local ColorGreen = AUGMENTATIONS.HUDGreenColor
  3. local TranslucentGreen = AUGMENTATIONS.HUDTranslucentGreenColor
  4. local TranslucentBlack = AUGMENTATIONS.HUDTranslucentBlackColor
  5. local GrayColor = AUGMENTATIONS.HUDGrayColor
  6. local MainColor = AUGMENTATIONS.MainColor
  7. local WhiteColor = AUGMENTATIONS.HUDWhiteColor
  8. local DarkGray = AUGMENTATIONS.HUDDarkGrayColor
  9. local BlueColor = AUGMENTATIONS.HUDBlueColor
  10. local RedColor = AUGMENTATIONS.HUDRedColor
  11. local BlueColorTranslucent = AUGMENTATIONS.HUDTranslucentBlueColor
  12.  
  13. local BarLerp = 0
  14. local traceBarLerp = 0
  15. local apBarLerp = 0
  16. local stamBarLerp = 0
  17. local velocity = 20
  18. local augEnergylerp = 0
  19. local aVelocity = 40
  20. local smooth = 0
  21. local smoothHunger = 0
  22. local smoothStam = 0
  23. local smoothTrace = 0
  24.  
  25. local hideTabl = {}
  26. hideTabl["CHudHealth"] = true
  27. hideTabl["CHudBattery"] = true
  28. hideTabl["CHudAmmo"] = true
  29. hideTabl["CHudSecondaryAmmo"] = true
  30. hideTabl["CHudCrosshair"] = true
  31. hideTabl["DarkRP_LocalPlayerHUD"] = true
  32. hideTabl["DarkRP_Hungermod"] = true
  33. hideTabl["DarkRP_EntityDisplay"] = true
  34. hideTabl["DarkRP_Agenda"] = true
  35. hideTabl["DarkRP_ArrestedHUD"] = true
  36. hideTabl["DarkRP_LockdownHUD"] = true
  37.  
  38.  
  39. if CLIENT then
  40. surface.CreateFont( "AmmoFont1", {
  41.     font = "Roboto",
  42.     size = ScrW() * 0.025,
  43.     weight = 100,
  44.     antialias = true,
  45.     extended = true,
  46. })
  47.  
  48. surface.CreateFont( "AmmoFont2", {
  49.     font = "Roboto",
  50.     size = ScrW() * 0.0183,
  51.     weight = 100,
  52.     antialias = true,
  53.     extended = true,
  54. })
  55.  
  56. surface.CreateFont( "MediumFont", {
  57.     font = "DeusEx",
  58.     size = ScrW() * 0.014 ,
  59.     weight = 100,
  60.     antialias = true,
  61.     extended = true,
  62.     shadow = true,
  63. })
  64.  
  65. surface.CreateFont( "DisplayFont", {
  66.     font = "DeusEx",
  67.     size = ScrW() * 0.012 ,
  68.     weight = 100,
  69.     antialias = true,
  70.     extended = true,
  71.     shadow = true,
  72. })
  73.  
  74. surface.CreateFont( "DisplayFont2", {
  75.     font = "DeusEx",
  76.     size = ScrW() * 0.008 ,
  77.     weight = 100,
  78.     antialias = true,
  79.     extended = true,
  80.     shadow = true,
  81. })
  82.  
  83.  
  84. surface.CreateFont( "WeaponNameFont", {
  85.     font = "Roboto",
  86.     size = ScrW() * 0.013,
  87.     weight = 100,
  88.     antialias = true,
  89.     extended = true,
  90. })
  91.  
  92. surface.CreateFont( "RadarFont", {
  93.     font = "DeusEx",
  94.     size = ScrW() * 0.006,
  95.     weight = 100,
  96.     antialias = true,
  97.     extended = true,
  98. })
  99.  
  100. surface.CreateFont( "DeusExFont", {
  101.     font = "DeusEx",
  102.     size = ScrW() * 0.007,
  103.     weight = 100,
  104.     antialias = true,
  105.     extended = true,
  106. })
  107.  
  108. surface.CreateFont( "NonAugmentFont", {
  109.     font = "CloseCaption_Bold",
  110.     size = ScrW() * 0.015,
  111.     weight = 1000,
  112.     antialias = true,
  113.     extended = true,
  114.     shadow = true,
  115. })
  116.     surface.CreateFont( "NonAugmentFont2", {
  117.     font = "CloseCaption_Bold",
  118.     size = ScrW() * 0.013,
  119.     weight = 1000,
  120.     antialias = true,
  121.     extended = true,
  122.     shadow = true,
  123. })
  124.  
  125. surface.CreateFont( "AgendaTitle", {
  126.     font = "DeusEx",
  127.     size = ScrW() * 0.009,
  128.     weight = 100,
  129.     antialias = true,
  130.     extended = true,
  131. })
  132. end
  133. local crosshairsizemul = 0
  134. hook.Add("EntityFireBullets", "AUGDetectAttack", function(ent, data)
  135.         crosshairsizemul = math.Clamp(crosshairsizemul + 1, 0, 3)
  136. end)
  137.  
  138.  
  139. hook.Add( "RenderScreenspaceEffects", "CyberPostProcess", function()
  140.     if (AUGMENTATIONS.EnableHUDandDataLink == false) then return end
  141.     if (AUGMENTATIONS.HUDPostProcess == false) then return end
  142.     local tab = {}
  143.  
  144.     tab[ "$pp_colour_brightness" ] = -0.07
  145.     tab[ "$pp_colour_contrast" ] = 1.18
  146.     tab[ "$pp_colour_colour" ] = 0.5
  147.     tab[ "$pp_colour_mulr" ] = 0
  148.     tab[ "$pp_colour_mulg" ] = 0
  149.     tab[ "$pp_colour_mulb" ] = 2
  150.  
  151.     DrawColorModify( tab )
  152.  end )
  153.  
  154.  
  155. hook.Add( "RenderScreenspaceEffects", "LowHP", function()
  156.     if (AUGMENTATIONS.EnableHUDandDataLink == false) then return end
  157.  
  158.     if LocalPlayer():Health() < 30 and LocalPlayer():GetNWInt("datalink") > 0 then
  159.     DrawMotionBlur( 0.4, 0.8, 0.01 )
  160.     DrawSharpen( 1.8 + math.random(-10, 16), 0.2 )
  161.     else
  162.         DrawSharpen( 1.8 , 0.1 )
  163.     end
  164.    
  165.     if LocalPlayer():GetNWInt("IsCloaked") == 1 then
  166.         DrawColorModify({
  167.             ["$pp_colour_colour"] = 0.3,
  168.             ["$pp_colour_mulg"] = 0,
  169.             ["$pp_colour_contrast"] = 1,
  170.             ["$pp_colour_brightness"] = 0.1
  171.         })
  172.          DrawToyTown( 2, ScrH()/2 )
  173.     end
  174.  end )
  175.  
  176. hook.Add("HUDShouldDraw","HideHUDElements",function(name)
  177.    if hideTabl[name] then
  178.      return false
  179.    end
  180. end)
  181.  
  182. -- local fps = -1
  183. -- local ping = -1
  184. -- hook.Add("Think", "PingFPS", function()
  185.     -- if CurTime() > infoRefreshDelay then
  186.       -- infoRefreshDelay = CurTime() + 1
  187.       -- fps = math.Round(1/RealFrameTime())
  188.       -- ping = LocalPlayer():Ping()
  189.     -- end
  190. -- end)
  191.  
  192. local glitch = 0
  193.  
  194. local function EnergyBar()
  195.     local Language = ALanguage[AUGMENTATIONS.Language]
  196.     local ply = LocalPlayer()
  197.    
  198.     local AEnergyP = ply:GetNWInt("AugmentEnergy") or 0
  199.     local AEnergy = math.Clamp(AEnergyP, 0, 100)
  200.     augEnergylerp = Lerp(FrameTime() * velocity, augEnergylerp, AEnergy)
  201.    
  202.     local x = (ScrW() * AUGMENTATIONS.HUDEnergyPositionX) + glitch
  203.     local y = (ScrH() * AUGMENTATIONS.HUDEnergyPositionY) + glitch
  204.  
  205.     local w = ScrW() + glitch
  206.     local h = ScrH() + glitch
  207.    
  208.     local DrawEnergy = math.Clamp( math.Min(augEnergylerp / 100, 1), 0, 100)
  209.     --Aug Energy
  210.     surface.SetDrawColor(TranslucentBlack)
  211.     surface.DrawRect(x - 10, y + 2.5, w / 9, h / 35)
  212.     surface.SetDrawColor(GrayColor)
  213.     surface.DrawOutlinedRect(x - 10, y + 2.5, w / 9, h / 35)
  214.    
  215.     surface.SetDrawColor(BlueColor)
  216.     surface.SetMaterial(Material("hudelements/battery.png"))
  217.     surface.DrawTexturedRect(x + 165, y + 10, w / 70, h / 70)  
  218.    
  219.     draw.RoundedBox(0, x - 10, y + 2.5, w / 9, h / 35, BlueColorTranslucent)
  220.     draw.RoundedBox(0, x + 15, y + 15, w / 14 * DrawEnergy, h / 240, BlueColor)
  221.    
  222.     if AEnergyP >= 80 then
  223.     draw.RoundedBox(0, x + 130, y + 10, w / 70, h / 70, BlueColor)
  224.     end
  225.    
  226.     if AEnergyP >= 60 then
  227.     draw.RoundedBox(0,  x + 90, y + 10, w / 70, h / 70, BlueColor)
  228.     end
  229.    
  230.     if AEnergyP >= 40 then
  231.     draw.RoundedBox(0, x + 50, y + 10, w / 70, h / 70, BlueColor)
  232.     end
  233.    
  234.     if AEnergyP >= 20 then
  235.     draw.RoundedBox(0, x + 10, y + 10, w / 70, h / 70, BlueColor)
  236.     end
  237.    
  238.     if AEnergyP < 10 then
  239.         draw.DrawText(Language.OutOfEnergy, "MediumFont", x - 10 , y - 250, Color(math.Clamp(math.sin(RealTime() * 5) * 220, 75, 255), 25, 25), TEXT_ALIGN_LEFT)
  240.     end
  241. end
  242.  
  243. local function NonAugmentHUD()
  244.     local Language = ALanguage[AUGMENTATIONS.Language]
  245.     local texture_gradient = surface.GetTextureID("gui/gradient")
  246.     local ply = LocalPlayer()
  247.    
  248.     local x = ScrW() / 2
  249.     local y = ScrH() / 2
  250.  
  251.     local w = ScrW()
  252.     local h = ScrH()
  253.    
  254.         if ply:GetActiveWeapon() == NULL then return end
  255.     if !ply:Alive() then return end
  256.     local HP = ply:Health() or 0
  257.     local Health = math.Clamp(HP, 0, ply:GetMaxHealth())
  258.     local HealthCol = math.Clamp(HP, 0, 100)
  259.     local wep = ply:GetActiveWeapon()
  260.     local PrintName = wep:GetPrintName()
  261.     local primaryammotype = wep:GetPrimaryAmmoType()
  262.     local AP = LocalPlayer():Armor() or 0
  263.     local Armor = math.Clamp(AP, 0, 100)
  264.    
  265.     local HPHung = ply:getDarkRPVar("Energy") or 0
  266.     local Hunger = math.Clamp(HPHung, 0, 2500)
  267.  
  268.     smooth = math.Approach(smooth, HealthCol, 50*FrameTime())
  269.    
  270.     local red = (1 - smooth/100)^(1/2) * 255
  271.     local grn = (smooth/150)^(1/2) * 255
  272.     local blu = (smooth/130)^2 * 255
  273.  
  274.     local col = Color(red, grn, blu) -- create a single color object with the values.
  275.    
  276.     local textHP      = string.upper(Language.NonAugmentHP100)
  277.     local textAP      = string.upper(Language.NonAugmentAP)
  278.     local textJob     = string.upper(ply:getDarkRPVar("job"))
  279.     local textHunger  = string.upper(Language.NonAugmentNoHunger)
  280.     local textHealth  = string.upper(Language.NonAugmentHP)
  281.     local textAmmoType
  282.     if primaryammotype == 7 then
  283.     textAmmoType = string.upper(Language.NonAugmentAmmoShotgun)
  284.     elseif primaryammotype == 4 then
  285.     textAmmoType = string.upper(Language.NonAugmentAmmoSMG)
  286.     elseif primaryammotype == 3 then
  287.     textAmmoType = string.upper(Language.NonAugmentAmmoPistol)
  288.     elseif primaryammotype == 5 then
  289.     textAmmoType = string.upper(Language.NonAugmentAmmo357)
  290.     elseif primaryammotype == 1 then
  291.     textAmmoType = string.upper(Language.NonAugmentAmmoAR2)
  292.     elseif primaryammotype == 14 then
  293.     textAmmoType = string.upper(Language.NonAugmentAmmoSniper)
  294.     else
  295.     textAmmoType = string.upper(Language.NonAugmentAmmoUndefined)
  296.     end
  297.     local textAmmo = textAmmoType .. "  " .. tostring(getAmmo())
  298.     local colorHunger = Color(100,255,100)
  299.     if HPHung < 85 and HPHung >= 70 then
  300.     textHunger = string.upper(Language.NonAugmentSmallHunger)
  301.     colorHunger = Color(200,255,200)
  302.     elseif HPHung < 70 and HPHung >= 50 then
  303.     textHunger = string.upper(Language.NonAugmentHardHunger)
  304.     colorHunger = Color(255,255,100)
  305.     elseif HPHung < 50 and HPHung >= 30 then
  306.     textHunger = string.upper(Language.NonAugmentVeryHardHunger)
  307.     colorHunger = Color(255,100,100)  
  308.     elseif HPHung < 30 and HPHung >= 0 then
  309.     textHunger = string.upper(Language.NonAugmentStarving)  
  310.     colorHunger = Color(255,0,0)  
  311.     end
  312.     local textNick = string.upper(ply:Nick())
  313.     local textWallet = string.upper(DarkRP.formatMoney(ply:getDarkRPVar("money")) .. "+" .. DarkRP.formatMoney(ply:getDarkRPVar("salary")))
  314.     local colorHP = Color(100,255,100)
  315.     local colorAP = BlueColor
  316.     if ply:Armor() == 0 then
  317.     colorAP = WhiteColor
  318.     textAP = string.upper(Language.NonAugmentNoAP)
  319.     end
  320.     if Health < 90 and Health >= 69 then
  321.         textHP = Language.NonAugmentHP90
  322.     elseif Health < 69 and Health >= 49 then
  323.         textHP = Language.NonAugmentHP69
  324.     elseif Health < 49 and Health >= 25 then
  325.         textHP = Language.NonAugmentHP49
  326.     elseif Health < 25 and Health >= 0 then
  327.         textHP = Language.NonAugmentHP25
  328.     end
  329.     surface.SetFont( "NonAugmentFont" )
  330.     local HPtextsize = surface.GetTextSize(textHealth)
  331.     local HP2textsize = surface.GetTextSize(textHP)
  332.     local NickSize = surface.GetTextSize(textNick)
  333.     local JOBsize = surface.GetTextSize(textJob)
  334.     local APtextsize = surface.GetTextSize(textAP)
  335.     draw.TexturedQuad
  336.     {
  337.         texture = surface.GetTextureID "gui/gradient",
  338.         color = Color(10, 10, 10, 230),
  339.         x = x * 0.005,
  340.         y = y * 1.81,
  341.         w = w * 0.55,
  342.         h = h * 0.085
  343.     }
  344.     draw.DrawText(textHealth, 'NonAugmentFont',  x * 0.02, y * 1.9, RedColor, TEXT_ALIGN_LEFT);
  345.     draw.DrawText(textHP, 'NonAugmentFont', HPtextsize + x * 0.02, y * 1.9, col, TEXT_ALIGN_LEFT);
  346.     draw.DrawText(textAP, 'NonAugmentFont', HP2textsize + HPtextsize + x * 0.06, y * 1.9, colorAP, TEXT_ALIGN_LEFT);
  347.     draw.DrawText(textJob, 'NonAugmentFont',  NickSize + x * 0.05, y * 1.82, team.GetColor(ply:Team()), TEXT_ALIGN_LEFT);
  348.     draw.DrawText(textWallet, 'NonAugmentFont',  HPtextsize + HP2textsize + APtextsize + x * 0.1, y * 1.9, ColorGreen, TEXT_ALIGN_LEFT);
  349.     draw.DrawText(textNick, 'NonAugmentFont',  x * 0.02, y * 1.82, MainColor, TEXT_ALIGN_LEFT);
  350.     if (AUGMENTATIONS.HUDDrawHunger == true) then
  351.     draw.DrawText(textHunger, 'NonAugmentFont',  NickSize + JOBsize + x * 0.08, y * 1.82, colorHunger, TEXT_ALIGN_LEFT);
  352.     end
  353.     draw.DrawText("|", 'NonAugmentFont',  x * 0.001, y * 1.9, WhiteColor, TEXT_ALIGN_LEFT);
  354.     draw.DrawText("|", 'NonAugmentFont',  x * 0.001, y * 1.82, WhiteColor, TEXT_ALIGN_LEFT);
  355.     draw.DrawText("|", 'NonAugmentFont',  HP2textsize + HPtextsize + x * 0.03, y * 1.9, WhiteColor, TEXT_ALIGN_LEFT);
  356.     draw.DrawText("|", 'NonAugmentFont',  NickSize + x * 0.03, y * 1.82, WhiteColor, TEXT_ALIGN_LEFT);
  357.     draw.DrawText("|", 'NonAugmentFont',  HPtextsize + HP2textsize + APtextsize + x * 0.075, y * 1.9, WhiteColor, TEXT_ALIGN_LEFT);
  358.     draw.DrawText(textAmmo, 'NonAugmentFont',   w * 0.99, y * 1.9, WhiteColor, TEXT_ALIGN_RIGHT);
  359.     draw.DrawText("|", 'NonAugmentFont',   NickSize + JOBsize + x * 0.06, y * 1.82, WhiteColor, TEXT_ALIGN_LEFT);
  360.    
  361.     if GetGlobalBool("DarkRP_LockDown") then
  362.         if ply:GetNWInt("datalink") > 0 then
  363.             draw.DrawText(DarkRP.getPhrase("lockdown_started"), 'MediumFont',  x, y * 0.05, Color(math.Clamp(math.sin(RealTime() * 5) * 220, 75, 255), 25, 25), TEXT_ALIGN_CENTER);
  364.         else
  365.             draw.DrawText(DarkRP.getPhrase("lockdown_started"), 'NonAugmentFont2',  x, y * 0.05, Color(math.Clamp(math.sin(RealTime() * 5) * 220, 75, 255), 25, 25), TEXT_ALIGN_CENTER);
  366.         end
  367.     end
  368. end
  369.  
  370. local agendaText
  371. local function Agenda()
  372.    --Agenda
  373.     local ply = LocalPlayer()
  374.     local x = ScrW() / 2
  375.     local y = ScrH() / 2
  376.  
  377.     local w = ScrW()
  378.     local h = ScrH()
  379.     local agenda = ply:getAgendaTable()
  380.     if not agenda then return end
  381.     agendaText = agendaText or DarkRP.textWrap((ply:getDarkRPVar("agenda") or ""):gsub("//", "\n"):gsub("\\n", "\n"), "DarkRPHUD1", 440)
  382.     if ply:GetNWInt("datalink") > 0 then
  383.     draw.RoundedBox(0, x * 0.01  , y * 0.02, w * 0.2, h * 0.12, TranslucentBlack)
  384.     surface.SetDrawColor(GrayColor)
  385.     surface.DrawOutlinedRect(x * 0.01  ,y * 0.02,w * 0.2, h * 0.12)
  386.     surface.DrawOutlinedRect(x * 0.01  ,y * 0.02,w * 0.2, h * 0.02)
  387.    
  388.     draw.DrawText(agenda.Title, "AgendaTitle", x * 0.03  , y * 0.02, MainColor, TEXT_ALIGN_LEFT)
  389.     draw.DrawText(agendaText, "MediumFont", x * 0.03  , y * 0.09, WhiteColor, TEXT_ALIGN_LEFT)
  390.     else
  391.     draw.TexturedQuad
  392.     {
  393.         texture = surface.GetTextureID "gui/gradient",
  394.         color = Color(10, 10, 10, 230),
  395.         x = x * 0.01,
  396.         y = y * 0.018,
  397.         w = w * 0.16,
  398.         h = h * 0.035
  399.     }
  400.     draw.DrawText("|", 'NonAugmentFont',  x * 0.01, y * 0.02, WhiteColor, TEXT_ALIGN_LEFT);
  401.     draw.DrawText(string.upper(agenda.Title), "NonAugmentFont", x * 0.03, y * 0.02, MainColor, TEXT_ALIGN_LEFT)
  402.     draw.DrawText(agendaText, "NonAugmentFont2", x * 0.03, y * 0.09, WhiteColor, TEXT_ALIGN_LEFT)
  403.     end
  404. end
  405.  
  406.  
  407.  
  408. local radar = {}
  409.  
  410. radar.radius = 1000
  411.  
  412. radar.Detect = {"player", "blastfungus", "rpg_missile", "crossbow_bolt", "npc_", "sent_", "prop_vehicle_", "func_door", "prop_door_rotating", "func_door_rotating"}
  413.  
  414. function PlayerPos( ply, otherPly, dist )
  415.     return ply:GetPos():DistToSqr( otherPly:GetPos() ) < ( dist*dist )
  416. end
  417.  
  418. hook.Add( "HUDPaint", "DrawRadar", function()
  419.     if (AUGMENTATIONS.EnableHUDandDataLink == false) then return end
  420.     local Language = ALanguage[AUGMENTATIONS.Language]
  421.     radar.w = ScrW() * 0.11 + glitch
  422.     radar.h = ScrH() * 0.195 + glitch
  423.     radar.x = (ScrW()/2) * AUGMENTATIONS.HUDRadarX + glitch  
  424.     radar.y = (ScrH()/2) * AUGMENTATIONS.HUDRadarY + glitch
  425.  
  426.     local lpl = LocalPlayer()
  427.     local Health = lpl:Health() or 0
  428.     if ( not lpl:Alive() ) then return end
  429.    
  430.     if (lpl:IsValid()) then
  431.         if Health < 30 and Health >= 15 then
  432.             glitch = math.random(0, 30)
  433.         elseif Health < 15 and Health >= 10 then
  434.             glitch = math.random(0, 40)
  435.         elseif Health < 10 then
  436.             glitch = math.random(0, 50)
  437.         else
  438.             glitch = 0
  439.     end
  440.     end
  441.  
  442.  
  443.     if lpl:GetNWInt("datalink") > 1 then
  444.     surface.SetDrawColor(TranslucentBlack)
  445.     surface.DrawRect(radar.x, radar.y, radar.w, radar.h)
  446.     surface.SetDrawColor(GrayColor)
  447.     surface.DrawOutlinedRect(radar.x, radar.y, radar.w, radar.h)
  448.  
  449.     local players = {}
  450.  
  451.     for i = 1, 1000 do
  452.  
  453.             local ent = ents.GetByIndex(i)
  454.  
  455.             if ent:IsValid() then
  456.                 local type = ent:GetClass()
  457.  
  458.                 for k, v in ipairs(radar.Detect) do
  459.                     if string.find(type,v) then
  460.                         table.insert(players,ent)
  461.                     end
  462.                 end
  463.             end
  464.         end
  465.  
  466.         for i, pl in ipairs(players) do
  467.             local cx = radar.x+radar.w/2
  468.             local cy = radar.y+radar.h/2
  469.             local vdiff = pl:GetPos()-lpl:GetPos()
  470.             local dummy = nil
  471.  
  472.  
  473.             if (vdiff:Length() > radar.radius) then dummy = nil else -- In soviet russia, code badly you!
  474.                 if pl:IsPlayer() then
  475.                     if ( pl:Alive() and lpl~=pl ) then
  476.                         local px = (vdiff.x/radar.radius)
  477.                         local py = (vdiff.y/radar.radius)
  478.                         local z = math.sqrt( px*px + py*py )
  479.                         local phi = math.deg( math.rad( math.atan2( px, py ) ) - math.rad( math.atan2( lpl:GetAimVector().x, lpl:GetAimVector().y ) ) + 90 )
  480.                         px = math.cos(phi)*z
  481.                         py = math.sin(phi)*z
  482.                         if pl:GetNWInt("radartransparency") == 0 then
  483.                         draw.RoundedBox( 4, cx+px*radar.w/2-4  , cy+py*radar.h/2-4, 6, 6, ColorGreen )
  484.                         draw.DrawText(Language.SomebodyText, "RadarFont", cx+px*radar.w/2  , cy+py*radar.h/2+8, WhiteColor, TEXT_ALIGN_CENTER)
  485.                         end
  486.                     end
  487.                 end
  488.  
  489.  
  490.                 if ((not pl:IsPlayer()) and pl:IsValid() ) then
  491.  
  492.                     local px = (vdiff.x/radar.radius)
  493.                     local py = (vdiff.y/radar.radius)
  494.                     local z = math.sqrt( px*px + py*py )
  495.                     local phi = math.deg( math.rad( math.atan2( px, py ) ) - math.rad( math.atan2( lpl:GetAimVector().x, lpl:GetAimVector().y ) ) + 90 )
  496.                     local directionAng = math.pi / 6
  497.                     local aimvector = lpl:GetAimVector()
  498.                     local entVector = pl:GetPos() - lpl:GetShootPos()
  499.                     local dot = aimvector:Dot( entVector ) / entVector:Length()
  500.                     px = math.cos(phi)*z
  501.                     py = math.sin(phi)*z
  502.  
  503.                     if string.find(pl:GetClass(),"prop_vehicle_") then
  504.  
  505.                     surface.SetMaterial(Material("hudelements/car.png"))
  506.                     surface.SetDrawColor(BlueColor)
  507.                     surface.DrawTexturedRect(cx+px*radar.w/2-4  , cy+py*radar.h/2-4, 10, 16)
  508.                     elseif string.find(pl:GetClass(),"prop_door_rotating") or string.find(pl:GetClass(),"func_door") then
  509.                     if dot > directionAng and  PlayerPos( lpl, pl, 600 ) then
  510.                     surface.SetDrawColor(ColorGreen)  
  511.                     else
  512.                     surface.SetDrawColor(0,0,0,0)  
  513.                     end
  514.                     surface.SetMaterial(Material("hudelements/door.png"))
  515.                     surface.DrawTexturedRect(cx+px*radar.w/2-4  , cy+py*radar.h/2-4, 10, 10)                      
  516.                     elseif string.find(pl:GetClass(),"prop_physics_multiplayer") then
  517.                         draw.RoundedBox( 0, cx+px*radar.w/2-4  , cy+py*radar.h/2-4, 6, 6, Color(0,0,0,0) )
  518.                     else
  519.                         draw.RoundedBox( 0, cx+px*radar.w/2-4  , cy+py*radar.h/2-4, 6, 6,MainColor )
  520.                     end
  521.  
  522.                         local radarentname = ""
  523.                         if string.find(pl:GetClass(),"blastfungus") then radarentname = ""
  524.                         elseif string.find(pl:GetClass(),"npc_") then radarentname =  "NPC"
  525.                         elseif string.find(pl:GetClass(),"sent_") then radarentname = string.sub(pl:GetClass(),6)
  526.                         elseif string.find(pl:GetClass(),"prop_vehicle_") then radarentname = ""
  527.                         elseif string.find(pl:GetClass(),"prop_door_rotating") or string.find(pl:GetClass(),"func_door") then radarentname = ""
  528.                         elseif string.find(pl:GetClass(),"prop_physics_multiplayer") then radarentname = ""
  529.                         else radarentname = pl:GetClass()
  530.                         end
  531.  
  532.                         local nametable = string.Explode("_",radarentname)
  533.                         radarentname = table.concat(nametable," ")
  534.                         local radarentname1 = string.sub(radarentname,0,1)
  535.                         local radarentname2 = string.sub(radarentname,2)
  536.                         radarentname1 = string.upper(radarentname1)
  537.                         radarentname = radarentname1..radarentname2
  538.  
  539.                             draw.DrawText(radarentname, "RadarFont", cx+px*radar.w/2  , cy+py*radar.h/2+8, WhiteColor, TEXT_ALIGN_CENTER)  
  540.                     end
  541.  
  542.                 end
  543.             end
  544.  
  545.     if not lpl:InVehicle() then
  546.         surface.SetMaterial(Material("hudelements/player.png"))
  547.         surface.SetDrawColor(MainColor)
  548.         surface.DrawTexturedRect(radar.x+radar.w/2-8  , radar.y+radar.h/2-8, 15, 15)
  549.     end
  550.     end
  551. end)
  552.  
  553.  
  554. hook.Add("HUDPaint", "DrawElements", function()
  555.     local ply = LocalPlayer()
  556.     defstels = ply:GetNWInt("stels")
  557.     defcyberhands = ply:GetNWInt("cyberhands")
  558.     deflegscyber = ply:GetNWInt("legscyber")
  559.     defkeypadcrackingmodule = ply:GetNWInt("keypadcrackingmodule")
  560.     defdatalink = ply:GetNWInt("datalink")
  561.     defthermalvisor = ply:GetNWInt("thermalvisor")
  562.         if ( AUGMENTATIONS.HUDDrawEnergy == true ) then
  563.             if (defstels > 0) or (defcyberhands > 0) or (deflegscyber > 0) or (defkeypadcrackingmodule > 0) or (defdatalink > 0) or (defthermalvisor > 0) then
  564.                 EnergyBar()
  565.             end
  566.         end
  567. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement