Advertisement
Guest User

Untitled

a guest
Dec 15th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. local header = net.ReadHeader
  2. local netid = util.NetworkIDToString
  3. local lower = string.lower
  4.  
  5.  
  6. function net.Incoming( len, ply )
  7. local z = header()
  8. local id = netid( z )
  9. if !id then return end
  10.  
  11. local da = net.Receivers[lower( id )]
  12. if !da then return end
  13.  
  14. if !ply.NetSpam then
  15. ply.NetSpam = {
  16. SysTime(), 1
  17. }
  18. return da( len, ply )
  19. end
  20. if SysTime() - ply.NetSpam[1] < 0.5 and ply.NetSpam[2] > 10 then
  21. return ply:Kick( "Net spam." )
  22. else
  23. ply.NetSpam[1] = SysTime()
  24. ply.NetSpam[2] = ply.NetSpam[2] + 1
  25. timer.Create( "zxcvbnm,", 1, 1, function()
  26. if !IsValid( ply ) then return end
  27. ply.NetSpam = nil
  28. end )
  29. return da( len, ply )
  30. end
  31. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement