Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- BlackTea = BlackTea or {}
- local SH = ScrH()
- local SW = ScrW()
- function BlackTea.HUDPaint()
- local ply = LocalPlayer()
- BlackTea.HealthInd( ply )
- if ply:Alive() then
- BlackTea.Overlay( ply )
- BlackTea.AmmoElement( ply )
- else
- end
- end
- hook.Add("HUDPaint", "[BlackTea]HUDPaint", BlackTea.HUDPaint)
- function BlackTea.HideDefault( name )
- local nodraw = {
- "CHudHealth",
- "CHudSecondaryAmmo",
- "CHudAmmo",
- "CHudBattery",
- }
- for k, v in pairs( nodraw ) do
- if( v == name ) then
- return false;
- end
- end
- return true;
- end
- hook.Add("HUDShouldDraw", "[BlackTea]HideHUD", BlackTea.HideDefault)
- function BlackTea.EffectThink()
- end
- hook.Add("Think", "[BlackTea]EffectThink", BlackTea.EffectThink)
- ----------------------------------------------
- local HL2Weps = {
- ["weapon_pistol"] = 18,
- ["weapon_357"] = 6,
- ["weapon_smg1"] = 45,
- ["weapon_ar2"] = 30,
- ["weapon_shotgun"] = 6,
- }
- function BlackTea.AmmoElement( ply )
- local wep = ply:GetActiveWeapon()
- local health = ply:Health()
- local armor = ply:Armor()
- if wep:IsValid() then
- local ammo = ply:GetAmmoCount( wep:GetPrimaryAmmoType() )
- local maxammo = 0
- if wep.Primary then
- maxammo = wep.Primary.DefaultClip
- else
- if not HL2Weps[wep:GetClass()] then
- maxammo = 1
- else
- maxammo = HL2Weps[wep:GetClass()]
- end
- end
- if wep:GetPrimaryAmmoType() == 7 then
- maxammo = 1
- end
- local left = math.Round(ammo / maxammo)
- if wep:GetPrimaryAmmoType() == 10 or wep:GetPrimaryAmmoType() == 8 then
- draw.DrawText( left , "HUDNumber5", SW - 98 , SH - 78, color_black, 2)
- draw.DrawText( left , "HUDNumber5", SW - 100 , SH - 80, color_white, 2)
- elseif wep:GetPrimaryAmmoType() == 0 or wep:GetPrimaryAmmoType() == -1 then
- else
- draw.DrawText( wep:Clip1() , "HUDNumber5", SW - 98 , SH - 78, color_black, 2)
- draw.DrawText( left , "ScoreboardText", SW - 88 , SH - 58, color_black, 3)
- draw.DrawText( wep:Clip1() , "HUDNumber5", SW - 100 , SH - 80, color_white, 2)
- draw.DrawText( left , "ScoreboardText", SW - 90 , SH - 60, color_white, 3)
- end
- end
- end
- function BlackTea.Overlay( ply )
- if not ply.WR then ply.WR = 0 end
- if ply.WR > 0 then DrawMaterialOverlay( "models/shadertest/predator", ply.WR ) end
- if ply:WaterLevel() >= 3 then
- ply.WR = 0.15
- else
- ply.WR = ply.WR - RealFrameTime()*0.05
- if ply.WR < 0 then ply.WR = 0 end
- end
- end
- veins = surface.GetTextureID( "whud/veins" )
- ring = surface.GetTextureID( "whud/redring" )
- function BlackTea.HealthInd( ply )
- local hp = math.Clamp( ply:Health(), 0, 60 )
- if hp ~= 60 then
- local mat_alpha = 1 - ( hp / 60 )
- surface.SetDrawColor( 255, 255, 255, mat_alpha * 255 )
- surface.SetTexture( veins )
- surface.DrawTexturedRect( 0, 0, ScrW(), ScrH() )
- surface.SetDrawColor( 255, 255, 255, mat_alpha * 255 )
- surface.SetTexture( ring )
- surface.DrawTexturedRect( 0, 0, ScrW(), ScrH() )
- end
- end
- ---------------------------------------------------------------------------------------
- local firefight = {
- { Sound = "ambient/levels/prison/inside_battle1.wav", Vol = 150 },
- { Sound = "ambient/levels/prison/inside_battle2.wav", Vol = 150 },
- { Sound = "ambient/levels/prison/inside_battle3.wav", Vol = 150 },
- { Sound = "ambient/levels/prison/inside_battle4.wav", Vol = 150 },
- { Sound = "ambient/levels/streetwar/city_battle2.wav", Vol = 150 },
- { Sound = "ambient/levels/streetwar/city_battle3.wav", Vol = 150},
- { Sound = "ambient/levels/streetwar/city_battle4.wav", Vol = 150 },
- { Sound = "ambient/levels/streetwar/city_battle5.wav", Vol = 150 },
- }
- local BNT = CurTime()
- function BlackTea.FireFight()
- if CurTime() > BNT then
- local snd = math.random( 1, #firefight )
- LocalPlayer():EmitSound( firefight[snd].Sound , firefight[snd].Vol )
- if math.random(1, 10) < 7 then
- BNT = CurTime() + math.random( 1, 5 )
- else
- BNT = CurTime() + math.random( 2, 4 )
- end
- end
- end
- local OWS = {
- { Sound = "npc/overwatch/cityvoice/f_anticitizenreport_spkr.wav", Vol = 150 },
- { Sound = "npc/overwatch/cityvoice/f_anticivil1_5_spkr.wav", Vol = 150 },
- { Sound = "npc/overwatch/cityvoice/f_anticivilevidence_3_spkr.wav", Vol = 150 },
- { Sound = "npc/overwatch/cityvoice/f_capitalmalcompliance_spkr.wav", Vol = 150 },
- { Sound = "npc/overwatch/cityvoice/f_sociolevel1_4_spkr.wav", Vol = 150 },
- { Sound = "npc/overwatch/cityvoice/f_localunrest_spkr.wav", Vol = 150},
- { Sound = "npc/overwatch/cityvoice/f_innactionisconspiracy_spkr.wav", Vol = 150 },
- { Sound = "npc/overwatch/cityvoice/f_evasionbehavior_2_spkr.wav", Vol = 150 },
- }
- local NOW = 0
- function BlackTea.OverWatch()
- if CurTime() > NOW then
- local snd = math.random( 1, #OWS )
- LocalPlayer():EmitSound( OWS[snd].Sound , OWS[snd].Vol )
- if math.random(1, 10) < 7 then
- NOW = CurTime() + math.random( 15, 25 )
- else
- NOW = CurTime() + math.random( 15, 35 )
- end
- end
- end
Add Comment
Please, Sign In to add comment