Garry's Mod Wiki

Revision Difference

CEffectData:GetDamageType#561510

<function name="GetDamageType" parent="CEffectData" type="classfunc"> <description>Returns the damage type of the effect</description> <realm>Shared</realm> <rets> <ret name="" type="number">Damage type of the effect, see <page>Enums/DMG</page></ret> </rets> </function>⤶ ⤶ ⤶ <example>⤶ <description>All of these expressions are equivalent to each other, evaluating to `true` if the damageinfo contains bullet, explosive, or club damage:⤶ ```lua⤶ bit.band(dmginfo:GetDamageType(), bit.bor(DMG_BULLET, DMG_BLAST, DMG_CLUB)) ~= 0⤶ ```⤶ ```lua⤶ dmginfo:IsDamageType(DMG_BULLET + DMG_BLAST + DMG_CLUB)⤶ ```⤶ ```lua⤶ dmginfo:IsBulletDamage() or dmginfo:IsExplosionDamage() or dmginfo:IsDamageType(DMG_CLUB)⤶ ```⤶ </description>⤶ </example></function>