Garry's Mod Wiki

GM:OnEntityWaterLevelChanged

  GM:OnEntityWaterLevelChanged( Entity entity, number old, number new )

Description

Called when the Entity:WaterLevel of an entity is changed.

0 - The entity isn't in water.

1 - Slightly submerged (at least to the feet).

2 - The majority of the entity is submerged (at least to the waist).

3 - Completely submerged.

This hook can be considered a physics callback, so changing collision rules (Entity:SetSolidFlags) in it may lead to a crash!

Arguments

1 Entity entity
The entity.
2 number old
Previous water level.
3 number new
The new water level.