Garry's Mod Wiki

Revision Difference

GM:OnDamagedByExplosion#552889

<function name="OnDamagedByExplosion" parent="GM" type="hook"> <ishook>yes</ishook>⤶ <description>Called when a player has been hurt by an explosion. Override to disable default sound effect.</description> <realm>Server</realm> <predicted>No</predicted>⤶ <args> <arg name="ply" type="Player">Player who has been hurt</arg> <arg name="dmginfo" type="CTakeDamageInfo">Damage info from explsion</arg> </args> </function> <example> <description> Disables the high pitched ringing sound effect. Note that this hook does not have a return value, and instead by default it calls <page>Player:SetDSP</page>( 35, false ) in the base gamemode. </description> <code> hook.Add( "OnDamagedByExplosion", "DisableSound", function() return true end ) </code> </example>