GM:OnEntityCreated
Description
Called as soon as the entity is created. Very little of the entity's properties will be initialized at this stage. (keyvalues, classname, flags, anything), especially on the serverside.
Some entities on initial map spawn are passed through this hook, and then removed in the same frame. This is used by the engine to precache things like models and sounds, so always check their validity with IsValid.
Removing the created entity during this event can lead to unexpected problems. Use timer.Simple( 0, .... ) to safely remove the entity.
Arguments
Example
When a prop spawns it yells.
Example
Adds all props and ragdolls into a list. More efficient alternative to looping over ents.GetAll.