Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local header = net.ReadHeader
- local netid = util.NetworkIDToString
- local lower = string.lower
- function net.Incoming( len, ply )
- local z = header()
- local id = netid( z )
- if !id then return end
- local da = net.Receivers[lower( id )]
- if !da then return end
- if !ply.NetSpam then
- ply.NetSpam = {
- SysTime(), 1
- }
- return da( len, ply )
- end
- if SysTime() - ply.NetSpam[1] < 0.5 and ply.NetSpam[2] > 10 then
- return ply:Kick( "Net spam." )
- else
- ply.NetSpam[1] = SysTime()
- ply.NetSpam[2] = ply.NetSpam[2] + 1
- timer.Create( "zxcvbnm,", 1, 1, function()
- if !IsValid( ply ) then return end
- ply.NetSpam = nil
- end )
- return da( len, ply )
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement