Garry's Mod Wiki

Garry's Mod Wiki

  number CTakeDamageInfo:GetDamageType()

Description

Returns a bitflag which indicates the damage type(s) of the damage.

Consider using CTakeDamageInfo:IsDamageType instead. Value returned by this function can contain multiple damage types.

Returns

1 number with DMG enum
Damage type(s), a combination of DMG enum

Example

All of these expressions are equivalent to each other, evaluating to true if the damageinfo contains bullet, explosive, or club damage:

bit.band(dmginfo:GetDamageType(), bit.bor(DMG_BULLET, DMG_BLAST, DMG_CLUB)) ~= 0
dmginfo:IsDamageType(DMG_BULLET + DMG_BLAST + DMG_CLUB)
dmginfo:IsBulletDamage() or dmginfo:IsExplosionDamage() or dmginfo:IsDamageType(DMG_CLUB)

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...