Python1320

CapsAdmin

Feb 28th, 2011
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.23 KB | None | 0 0
  1. if SERVER then
  2.     hook.Add("EntityTakeDamage", "DamageEffects:EntityTakeDamage", function(entity, weapon, attacker, amount, damageinfo)
  3.         if entity:IsPlayer() then
  4.             local breathing = CreateSound(entity, "player/breathe1.wav")
  5.                
  6.             entity:ViewPunch(damageinfo:GetDamageForce()/100)
  7.             entity:SetDSP(33)
  8.             breathing:Play()
  9.             breathing:FadeOut(3)
  10.            
  11.             umsg.Start("DamageEffects:EntityTakeDamage", entity)
  12.                 umsg.Short(amount)
  13.             umsg.End()
  14.         end
  15.     end)
  16. else
  17.     local smoother = 0
  18.     local blackness = 0
  19.    
  20.     usermessage.Hook("DamageEffects:EntityTakeDamage", function(umr)
  21.         local amount = umr:ReadShort()
  22.         blackness = -2
  23.         timer.Simple(amount/100, function()
  24.             blackness = 0
  25.         end)
  26.     end)
  27.    
  28.     hook.Add("RenderScreenspaceEffects", "DamageEffects:RenderScreenspaceEffects", function()
  29.         smoother = smoother + ((blackness - smoother) / 100)
  30.        
  31.         local table = {}
  32.        
  33.         table[ "$pp_colour_addr" ] = 0
  34.         table[ "$pp_colour_addg" ] = 0
  35.         table[ "$pp_colour_addb" ] = 0
  36.         table[ "$pp_colour_brightness" ] = smoother
  37.         table[ "$pp_colour_contrast" ] = 1
  38.         table[ "$pp_colour_colour" ] = 1
  39.         table[ "$pp_colour_mulr" ] = 0
  40.         table[ "$pp_colour_mulg" ] = 0
  41.         table[ "$pp_colour_mulb" ] = 0
  42.        
  43.         DrawColorModify(table)
  44.     end)
  45. end
Add Comment
Please, Sign In to add comment