I try write my first useful lua plugin but i have many problems. This plugin should prevent from irresponsible players which lags server (spams props etc.).
My idea is that plugin should count number of collides for each entity in a given unit of time. If server will have fps drop - he will freeze entities with the biggest count of collides and kick/ban players which created/used them.
I think i know how to save count of collides in entity (Entity:SetVar) but i don’t know how to hook collides. I found interesting event: ENTITY:PhysicsCollide but, first, im not sure do i properly hook it.
function Collide( colData, collider ) Msg("bleble") end hook.Add("PhysicsCollide", "physCol", Collide)
function PhysicsCollide( colData, collider ) Msg("bleble") end
Looks like both doesn’t work (I spawn props, touch them together but in console nothing appear).
In old wiki, at “ENT.PhysicsCollide” I found:
I searched additional information about “Scripted Entities” and i found in old wiki:
But I tested my script for Bouncy Ball and doesn’t work too Also i dont know how to convert normal entities to scripted entities (easy way).
What I am doing wrong? Help please.