Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.63 KB | None | 0 0
  1. if SERVER then
  2.  
  3. local Delay = 30
  4.  
  5. function GAMEMODE:ShowSpare1(pl)
  6. if GAMEMODE:InRound() && pl:Alive() && (pl:Team() == TEAM_HUNTERS || pl:Team() == TEAM_PROPS) && pl.last_taunt_time + TAUNT_DELAY <= CurTime() && #PROP_TAUNTS > 1 && #HUNTER_TAUNTS > 1 then
  7. repeat
  8. if pl:Team() == TEAM_HUNTERS then
  9. rand_taunt = table.Random(HUNTER_TAUNTS)
  10. else
  11. rand_taunt = table.Random(PROP_TAUNTS)
  12. end
  13. until rand_taunt != pl.last_taunt
  14.  
  15. pl.last_taunt_time = CurTime()
  16. pl.last_taunt = rand_taunt
  17.  
  18. pl:EmitSound(rand_taunt, 100)
  19. pl.NextTaunt = Delay
  20. end
  21. end
  22.  
  23.  
  24.  
  25.  
  26. hook.Add("PlayerSpawn","TimeResetter",function(ply)
  27. if ply:Team() == TEAM_HUNTERS then return end
  28. ply.NextTaunt = Delay
  29. ply:SetNWInt("NextTaunt",ply.NextTaunt)
  30. end)
  31.  
  32.  
  33.  
  34. timer.Create("TimeCD",1,0,function()
  35. for k,v in pairs(player.GetAll()) do
  36. if v:Alive() and v:Team() != TEAM_HUNTERS then
  37. v.NextTaunt = v.NextTaunt - 1
  38. v:SetNWInt("NextTaunt",v.NextTaunt)
  39. if v.NextTaunt <= 0 then
  40. ShowSpare1(ply)
  41.  
  42. v.NextTaunt = Delay
  43. v:SetNWInt("NextTaunt",v.NextTaunt)
  44. end
  45. end
  46. end
  47. end)
  48.  
  49. end
  50.  
  51. if CLIENT then
  52.  
  53.  
  54. surface.CreateFont( "AutoTaunt", {
  55. font = "Euphemia",
  56. size = 43,
  57. weight = 500,
  58. blursize = 0,
  59. scanlines = 0,
  60. antialias = true,
  61. } )
  62.  
  63. hook.Add("HUDPaint","AutoTaunt",function()
  64. if not LocalPlayer():Alive() or LocalPlayer():Team() == TEAM_HUNTERS then return end
  65. surface.SetDrawColor(Color(0,0,0))
  66. surface.DrawRect( ScrW()-340, ScrH()-150, 330, 140 )
  67.  
  68. surface.SetDrawColor(Color(0,200,0))
  69. surface.DrawRect( ScrW()-330, ScrH()-140, 310, 70 )
  70.  
  71. draw.DrawText( "Auto-Taunt", "AutoTaunt", ScrW()-170, ScrH()-60, Color(255,255,255), TEXT_ALIGN_CENTER )
  72. draw.DrawText( LocalPlayer():GetNWInt("NextTaunt") or 0, "AutoTaunt", ScrW()-170, ScrH()-125, Color(0,0,0), TEXT_ALIGN_CENTER )
  73. end)
  74.  
  75. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement